Skip to content
Snippets Groups Projects
  1. Sep 19, 2017
    • Paolo Bonzini's avatar
      scsi: move block/scsi.h to include/scsi/constants.h · 08e2c9f1
      Paolo Bonzini authored
      
      Complete the transition by renaming this header, which was
      shared by block/iscsi.c and the SCSI emulation code.
      
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      08e2c9f1
    • Paolo Bonzini's avatar
      scsi: introduce sg_io_sense_from_errno · 1ead6b4e
      Paolo Bonzini authored
      
      Move more knowledge of SG_IO out of hw/scsi/scsi-generic.c, for
      reusability.
      
      Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      1ead6b4e
    • Paolo Bonzini's avatar
      scsi: introduce scsi_build_sense · a3760467
      Paolo Bonzini authored
      
      Move more knowledge of sense data format out of hw/scsi/scsi-bus.c
      for reusability.
      
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      a3760467
    • Paolo Bonzini's avatar
      scsi: move non-emulation specific code to scsi/ · e5b5728c
      Paolo Bonzini authored
      
      util/scsi.c includes some SCSI code that is shared by block/iscsi.c and
      hw/scsi, but the introduction of the persistent reservation helper
      will add many more instances of this.  There is also include/block/scsi.h,
      which actually is not part of the core block layer.
      
      The persistent reservation manager will also need a home.  A scsi/
      directory provides one for both the aforementioned shared code and
      the PR manager code.
      
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      e5b5728c
    • Paolo Bonzini's avatar
      scsi: rename scsi_build_sense to scsi_convert_sense · 37b6045c
      Paolo Bonzini authored
      
      After introducing the scsi/ subdirectory, there will be a scsi_build_sense
      function that is the same as scsi_req_build_sense but without needing
      a SCSIRequest.  The existing scsi_build_sense function gets in the way,
      remove it.
      
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      37b6045c
    • Fam Zheng's avatar
      scsi-block: Support rerror/werror · 14b20748
      Fam Zheng authored
      
      This makes the werror/rerror options available on the scsi-block device,
      to allow user specify error handling policy similar to scsi-hd.
      
      Signed-off-by: default avatarFam Zheng <famz@redhat.com>
      Message-Id: <20170821141008.19383-5-famz@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      14b20748
    • Fam Zheng's avatar
      scsi: Introduce scsi_sense_buf_to_errno · a485b234
      Fam Zheng authored
      
      This recognizes the "fixed" and "descriptor" format sense data, extracts
      the sense key/asc/ascq fields then converts them to an errno.
      
      Signed-off-by: default avatarFam Zheng <famz@redhat.com>
      Message-Id: <20170821141008.19383-4-famz@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      a485b234
    • Fam Zheng's avatar
      scsi: Improve scsi_sense_to_errno · 5efa3c04
      Fam Zheng authored
      
      Tweak the errno mapping to return more accurate/appropriate values.
      
      Signed-off-by: default avatarFam Zheng <famz@redhat.com>
      Message-Id: <20170821141008.19383-3-famz@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      5efa3c04
    • Fam Zheng's avatar
      scsi: Refactor scsi sense interpreting code · 28751358
      Fam Zheng authored
      
      So that it can be reused outside of iscsi.c.
      
      Also update MAINTAINERS to include the new files in SCSI section.
      
      Signed-off-by: default avatarFam Zheng <famz@redhat.com>
      Message-Id: <20170821141008.19383-2-famz@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      28751358
    • Hannes Reinecke's avatar
      scsi-bus: correct responses for INQUIRY and REQUEST SENSE · b07fbce6
      Hannes Reinecke authored
      
      According to SPC-3 INQUIRY and REQUEST SENSE should return GOOD
      even on unsupported LUNS.
      
      Signed-off-by: default avatarHannes Reinecke <hare@suse.com>
      Message-Id: <1503049022-14749-1-git-send-email-hare@suse.de>
      Reported-by: default avatarLaszlo Ersek <lersek@redhat.com>
      Fixes: ded6ddc5
      Cc: qemu-stable@nongnu.org
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarHannes Reinecke <hare@suse.de>
      b07fbce6
    • Richard W.M. Jones's avatar
      virtio-scsi: Add virtqueue_size parameter allowing virtqueue size to be set. · 5c0919d0
      Richard W.M. Jones authored
      Since Linux switched to blk-mq as the default in Linux commit
      5c279bd9e406 ("scsi: default to scsi-mq"), virtio-scsi LUNs consume
      about 10x as much guest kernel memory.
      
      This commit allows you to choose the virtqueue size for each
      virtio-scsi-pci controller like this:
      
        -device virtio-scsi-pci,id=scsi,virtqueue_size=16
      
      The default is still 128 as before.  Using smaller virtqueue_size
      allows many more disks to be added to small memory virtual machines.
      For a 1 vCPU, 500 MB, no swap VM I observed:
      
        With scsi-mq enabled (upstream kernel):              175 disks
          -"- ditto -"-   virtqueue_size=64:                 318 disks
          -"- ditto -"-   virtqueue_size=16:                 775 disks
        With scsi-mq disabled (kernel before 5c279bd9e406): 1755 disks
      
      Note that to have any effect, this requires a kernel patch:
      
        https://lkml.org/lkml/2017/8/10/689
      
      
      
      Signed-off-by: default avatarRichard W.M. Jones <rjones@redhat.com>
      Message-Id: <20170810165255.20865-1-rjones@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      5c0919d0
    • Joseph Myers's avatar
      target/i386: fix phminposuw in-place operation · aa406fea
      Joseph Myers authored
      
      The SSE4.1 phminposuw instruction finds the minimum 16-bit element in
      the source vector, putting the value of that element in the low 16
      bits of the destination vector, the index of that element in the next
      three bits and zeroing the rest of the destination.  The helper for
      this operation fills the destination from high to low, meaning that
      when the source and destination are the same register, the minimum
      source element can be overwritten before it is copied to the
      destination.  This patch fixes it to fill the destination from low to
      high instead, so the minimum source element is always copied first.
      This fixes one gcc test failure in my GCC 6-based testing (and so
      concludes the present sequence of patches, as I don't have any further
      gcc test failures left in that testing that I attribute to QEMU bugs).
      
      Signed-off-by: default avatarJoseph Myers <joseph@codesourcery.com>
      
      Message-Id: <alpine.DEB.2.20.1708111422580.11919@digraph.polyomino.org.uk>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      aa406fea
    • Joseph Myers's avatar
      target/i386: fix pcmpxstrx substring search · ae35eea7
      Joseph Myers authored
      
      One of the cases of the SSE4.2 pcmpestri / pcmpestrm / pcmpistri /
      pcmpistrm instructions does a substring search.  The implementation of
      this case in the pcmpxstrx helper is incorrect.  The operation in this
      case is a search for a string (argument d to the helper) in another
      string (argument s to the helper); if a copy of d at a particular
      position would run off the end of s, the resulting output bit should
      be 0 whether or not the strings match in the region where they
      overlap, but the QEMU implementation was wrongly comparing only up to
      the point where s ends and counting it as a match if an initial
      segment of d matched a terminal segment of s.  Here, "run off the end
      of s" means that some byte of d would overlap some byte outside of s;
      thus, if d has zero length, it is considered to match everywhere,
      including after the end of s.  This patch fixes the implementation to
      correspond with the proper instruction semantics.  This fixes four gcc
      test failures in my GCC 6-based testing.
      
      Signed-off-by: default avatarJoseph Myers <joseph@codesourcery.com>
      
      Message-Id: <alpine.DEB.2.20.1708102139310.8101@digraph.polyomino.org.uk>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      ae35eea7
    • Joseph Myers's avatar
      target/i386: fix packusdw in-place operation · 80e19606
      Joseph Myers authored
      
      The SSE4.1 packusdw instruction combines source and destination
      vectors of signed 32-bit integers into a single vector of unsigned
      16-bit integers, with unsigned saturation.  When the source and
      destination are the same register, this means each 32-bit element of
      that register is used twice as an input, to produce two of the 16-bit
      output elements, and so if the operation is carried out
      element-by-element in-place, no matter what the order in which it is
      applied to the elements, the first element's operation will overwrite
      some future input.  The helper for packssdw avoids this issue by
      computing the result in a local temporary and copying it to the
      destination at the end; this patch fixes the packusdw helper to do
      likewise.  This fixes three gcc test failures in my GCC 6-based
      testing.
      
      Signed-off-by: default avatarJoseph Myers <joseph@codesourcery.com>
      
      Message-Id: <alpine.DEB.2.20.1708100023050.9262@digraph.polyomino.org.uk>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      80e19606
    • Joseph Myers's avatar
      target/i386: set rip_offset for further SSE instructions · c6a82429
      Joseph Myers authored
      
      It turns out that my recent fix to set rip_offset when emulating some
      SSE4.1 instructions needs generalizing to cover a wider class of
      instructions.  Specifically, every instruction in the sse_op_table7
      table, coming from various instruction set extensions, has an 8-bit
      immediate operand that comes after any memory operand, and so needs
      rip_offset set for correctness if there is a memory operand that is
      rip-relative, and my patch only set it for a subset of those
      instructions.  This patch moves the rip_offset setting to cover the
      wider class of instructions, so fixing 9 further gcc testsuite
      failures in my GCC 6-based testing.  (I do not know whether there
      might be still further classes of instructions missing this setting.)
      
      Signed-off-by: default avatarJoseph Myers <joseph@codesourcery.com>
      
      Message-Id: <alpine.DEB.2.20.1708082350340.23380@digraph.polyomino.org.uk>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      c6a82429
    • Joseph Myers's avatar
      target/i386: fix pmovsx/pmovzx in-place operations · c6a56c8e
      Joseph Myers authored
      
      The SSE4.1 pmovsx* and pmovzx* instructions take packed 1-byte, 2-byte
      or 4-byte inputs and sign-extend or zero-extend them to a wider vector
      output.  The associated helpers for these instructions do the
      extension on each element in turn, starting with the lowest.  If the
      input and output are the same register, this means that all the input
      elements after the first have been overwritten before they are read.
      This patch makes the helpers extend starting with the highest element,
      not the lowest, to avoid such overwriting.  This fixes many GCC test
      failures (161 in the gcc testsuite in my GCC 6-based testing) when
      testing with a default CPU setting enabling those instructions.
      
      Signed-off-by: default avatarJoseph Myers <joseph@codesourcery.com>
      
      Message-Id: <alpine.DEB.2.20.1708082018390.23380@digraph.polyomino.org.uk>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      c6a56c8e
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/jnsnow/tags/ide-pull-request' into staging · 11e06ce1
      Peter Maydell authored
      
      # gpg: Signature made Tue 19 Sep 2017 01:10:40 BST
      # gpg:                using RSA key 0x7DEF8106AAFC390E
      # gpg: Good signature from "John Snow (John Huston) <jsnow@redhat.com>"
      # Primary key fingerprint: FAEB 9711 A12C F475 812F  18F2 88A9 064D 1835 61EB
      #      Subkey fingerprint: F9B7 ABDB BCAC DF95 BE76  CBD0 7DEF 8106 AAFC 390E
      
      * remotes/jnsnow/tags/ide-pull-request:
        hw/block/fdc: Convert to realize
        hw/ide: Convert DeviceClass init to realize
        AHCI: remove DPRINTF macro
        AHCI: pretty-print FIS to buffer instead of stderr
        AHCI: Rework IRQ constants
        AHCI: Replace DPRINTF with trace-events
        IDE: replace DEBUG_AIO with trace events
        ATAPI: Replace DEBUG_IDE_ATAPI with tracing events
        IDE: add tracing for data ports
        IDE: Add register hints to tracing
        IDE: replace DEBUG_IDE with tracing system
        hw/ide/microdrive: Mark the dscm1xxxx device with user_creatable = false
        ide: ahci: unparent children buses before freeing their memory
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      11e06ce1
  2. Sep 18, 2017
  3. Sep 17, 2017
Loading