1. 17 Jun, 2019 6 commits
    • Eric Farman's avatar
      vfio-ccw: Adjust the first IDAW outside of the nested loops · 8aabf0ed
      Eric Farman authored
      Now that pfn_array_table[] is always an array of 1, it seems silly to
      check for the very first entry in an array in the middle of two nested
      loops, since we know it'll only ever happen once.
      
      Let's move this outside the loops to simplify things, even though
      the "k" variable is still necessary.
      Signed-off-by: default avatarEric Farman <farman@linux.ibm.com>
      Reviewed-by: default avatarCornelia Huck <cohuck@redhat.com>
      Message-Id: <20190606202831.44135-7-farman@linux.ibm.com>
      Signed-off-by: default avatarCornelia Huck <cohuck@redhat.com>
      8aabf0ed
    • Eric Farman's avatar
      vfio-ccw: Rearrange pfn_array and pfn_array_table arrays · cc06ee98
      Eric Farman authored
      While processing a channel program, we currently have two nested
      arrays that carry a slightly different structure.  The direct CCW
      path creates this:
      
        ccwchain->pfn_array_table[1]->pfn_array[#pages]
      
      while an IDA CCW creates:
      
        ccwchain->pfn_array_table[#idaws]->pfn_array[1]
      
      The distinction appears to state that each pfn_array_table entry
      points to an array of contiguous pages, represented by a pfn_array,
      um, array.  Since the direct-addressed scenario can ONLY represent
      contiguous pages, it makes the intermediate array necessary but
      difficult to recognize.  Meanwhile, since an IDAL can contain
      non-contiguous pages and there is no logic in vfio-ccw to detect
      adjacent IDAWs, it is the second array that is necessary but appearing
      to be superfluous.
      
      I am not aware of any documentation that states the pfn_array[] needs
      to be of contiguous pages; it is just what the code does today.
      I don't see any reason for this either, let's just flip the IDA
      codepath around so that it generates:
      
        ch_pat->pfn_array_table[1]->pfn_array[#idaws]
      
      This will bring it in line with the direct-addressed codepath,
      so that we can understand the behavior of this memory regardless
      of what type of CCW is being processed.  And it means the casual
      observer does not need to know/care whether the pfn_array[]
      represents contiguous pages or not.
      
      NB: The existing vfio-ccw code only supports 4K-block Format-2 IDAs,
      so that "#pages" == "#idaws" in this area.  This means that we will
      have difficulty with this overlap in terminology if support for
      Format-1 or 2K-block Format-2 IDAs is ever added.  I don't think that
      this patch changes our ability to make that distinction.
      Signed-off-by: default avatarEric Farman <farman@linux.ibm.com>
      Reviewed-by: default avatarCornelia Huck <cohuck@redhat.com>
      Message-Id: <20190606202831.44135-6-farman@linux.ibm.com>
      Signed-off-by: default avatarCornelia Huck <cohuck@redhat.com>
      cc06ee98
    • Eric Farman's avatar
      s390/cio: Use generalized CCW handler in cp_init() · 99afcb05
      Eric Farman authored
      It is now pretty apparent that ccwchain_handle_ccw()
      (nee ccwchain_handle_tic()) does everything that cp_init()
      wants to do.
      
      Let's remove that duplicated code from cp_init() and let
      ccwchain_handle_ccw() handle it itself.
      Signed-off-by: default avatarEric Farman <farman@linux.ibm.com>
      Reviewed-by: default avatarCornelia Huck <cohuck@redhat.com>
      Message-Id: <20190606202831.44135-5-farman@linux.ibm.com>
      Signed-off-by: default avatarCornelia Huck <cohuck@redhat.com>
      99afcb05
    • Eric Farman's avatar
      s390/cio: Generalize the TIC handler · 363fe5f7
      Eric Farman authored
      Refactor ccwchain_handle_tic() into a routine that handles a channel
      program address (which itself is a CCW pointer), rather than a CCW pointer
      that is only a TIC CCW.  This will make it easier to reuse this code for
      other CCW commands.
      Signed-off-by: default avatarEric Farman <farman@linux.ibm.com>
      Reviewed-by: default avatarCornelia Huck <cohuck@redhat.com>
      Message-Id: <20190606202831.44135-4-farman@linux.ibm.com>
      Signed-off-by: default avatarCornelia Huck <cohuck@redhat.com>
      363fe5f7
    • Eric Farman's avatar
      s390/cio: Refactor the routine that handles TIC CCWs · e64bd689
      Eric Farman authored
      Extract the "does the target of this TIC already exist?" check from
      ccwchain_handle_tic(), so that it's easier to refactor that function
      into one that cp_init() is able to use.
      Signed-off-by: default avatarEric Farman <farman@linux.ibm.com>
      Reviewed-by: default avatarCornelia Huck <cohuck@redhat.com>
      Message-Id: <20190606202831.44135-3-farman@linux.ibm.com>
      Signed-off-by: default avatarCornelia Huck <cohuck@redhat.com>
      e64bd689
    • Eric Farman's avatar
      s390/cio: Squash cp_free() and cp_unpin_free() · 812271b9
      Eric Farman authored
      The routine cp_free() does nothing but call cp_unpin_free(), and while
      most places call cp_free() there is one caller of cp_unpin_free() used
      when the cp is guaranteed to have not been marked initialized.
      
      This seems like a dubious way to make a distinction, so let's combine
      these routines and make cp_free() do all the work.
      Signed-off-by: default avatarEric Farman <farman@linux.ibm.com>
      Reviewed-by: default avatarCornelia Huck <cohuck@redhat.com>
      Message-Id: <20190606202831.44135-2-farman@linux.ibm.com>
      Signed-off-by: default avatarCornelia Huck <cohuck@redhat.com>
      812271b9
  2. 15 Jun, 2019 17 commits
  3. 11 Jun, 2019 5 commits
    • Heiko Carstens's avatar
      s390/kdump: get rid of compile warning · 2980ba6a
      Heiko Carstens authored
      Move the CONFIG_CRASH_DUMP ifdef to get rid of this:
      
      arch/s390/kernel/machine_kexec.c:146:22: warning: 'do_start_kdump' defined but not used [-Wunused-function]
      Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      2980ba6a
    • Vasily Gorbik's avatar
      RAID/s390: remove invalid 'r' inline asm operand modifier · eec0a43d
      Vasily Gorbik authored
      gcc silently ignores unsupported inline asm operand modifiers, effectively
      turning '%r0' into '%0', but upcoming clang 9 complains about them:
      lib/raid6/s390vx8.c:63:16: error: invalid operand in inline asm: 'VLM $2,$3,0,${1:r}'
              asm volatile ("VLM %2,%3,0,%r1"
                            ^
      
      Clean up what look like a typo 'r' inline asm operand modifier usage.
      Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
      Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      eec0a43d
    • Mauro Carvalho Chehab's avatar
      s390: include/asm/debug.h add kerneldoc markups · a20aa857
      Mauro Carvalho Chehab authored
      Instead of keeping the documentation inside s390dbf.rst,
      move them to arch/s390/include/asm/debug.h, using standard
      kernel-doc markups.
      
      Keeping the documentation close to the code helps to keep it
      updated. It also makes easier to document other stuff inside
      debug.h, as all it needs is to add kernel-doc markups inside
      it, as the file will be already be included at the produced
      documentation.
      
      -
      
      Those were converted to kerneldoc using this script specially
      designed to parse ths file, and manually editted:
      
      <script>
      use strict;
      
      my $mode = "";
      my $parameter = "";
      my $ret = "";
      my $descr = "";
      
      sub add_var($)
      {
      	my $ln = shift;
      
      	$ln =~ s/^\s+//;
      	$ln =~ s/\s+$//;
      
      	return if ($ln eq "");
      
      	$ln =~ s/^(\S+)\s+/$1\t/;
      
      	print " * \@$ln\n";
      }
      
      sub add_return($)
      {
      	my $ln = shift;
      
      	print " *\n * Return:\n" if ($mode ne "Return Value:");
      
      	$ln =~ s/^\s+//;
      	$ln =~ s/\s+$//;
      
      	return if ($ln eq "");
      
      	print " * -   $ln\n";
      }
      
      sub add_description($)
      {
      	my $ln = shift;
      
      	print " *\n * \n" if ($mode ne "Description:");
      
      	$ln =~ s/^\s+//;
      	$ln =~ s/\s+$//;
      
      	return if ($ln eq "");
      
      	print " * $ln\n";
      }
      
      sub flush_results()
      {
      	print " */\n\n";
      }
      
      while (<>) {
      	if (m/^[\-]+$/) {
      		flush_results();
      		$mode = "";
      		$parameter = "";
      		$ret = "";
      		$descr = "";
      		next;
      	}
      	if (m/(Parameter:)(.*)/) {
      		print " *\n" if ($mode eq "func");
      		add_var($2);
      		$mode = $1;
      		next;
      	}
      	if (m/(Return Value:)(.*)/) {
      		add_return($2);
      		$mode = $1;
      		next;
      	}
      	if (m/(Description:)(.*)/) {
      		add_description($2);
      		$mode = $1;
      		next;
      	}
      	if ($mode eq "Parameter:") {
      		add_var($_);
      		next;
      	}
      	if ($mode eq "Return Value:") {
      		add_return($_);
      		next;
      	}
      	if ($mode eq "Description:") {
      		add_description($_);
      		next;
      	}
      	next if (m/^\s*$/);
      
      	if (m/^\S+.*\s\*?(\S+)\s*\(/) {
      		if ($mode eq "") {
      			print "/**\n * $1()\n";
      		} else {
      			print " * $1()\n";
      		}
      		$mode="func";
      	}
      }
      flush_results();
      </script>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      a20aa857
    • Mauro Carvalho Chehab's avatar
      docs: s390: convert docs to ReST and rename to *.rst · 8b4a503d
      Mauro Carvalho Chehab authored
      Convert all text files with s390 documentation to ReST format.
      
      Tried to preserve as much as possible the original document
      format. Still, some of the files required some work in order
      for it to be visible on both plain text and after converted
      to html.
      
      The conversion is actually:
        - add blank lines and identation in order to identify paragraphs;
        - fix tables markups;
        - add some lists markups;
        - mark literal blocks;
        - adjust title markups.
      
      At its new index.rst, let's add a :orphan: while this is not linked to
      the main index.rst file, in order to avoid build warnings.
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      8b4a503d
    • Mauro Carvalho Chehab's avatar
      docs: Debugging390.txt: convert table to ascii artwork · dc3988f4
      Mauro Carvalho Chehab authored
      The first bit/value table inside the document is very
      hard to read and won't fit ReST format. Also, some columns aren't
      properly aligned.
      
      Convert it to a nice ascii artwork table with makes it easier to
      read as plain text and is compatible with ReST format parser
      on Sphinx.
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      dc3988f4
  4. 07 Jun, 2019 9 commits
  5. 04 Jun, 2019 3 commits