1. 18 9月, 2015 8 次提交
    • J
      ahci: remove dead reset code · f91a0aa3
      John Snow 提交于
      This check is dead due to an earlier conditional.
      AHCI does not currently support hotplugging, so
      checks to see if devices are present or not are useless.
      
      Remove it.
      Reported-by: NStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Message-id: 1441140641-17631-2-git-send-email-jsnow@redhat.com
      f91a0aa3
    • J
      atapi: abort transfers with 0 byte limits · 9ef2e93f
      John Snow 提交于
      We're supposed to abort on transfers like this, unless we fill
      Word 125 of our IDENTIFY data with a default transfer size, which
      we don't currently do.
      
      This is an ATA error, not a SCSI/ATAPI one.
      See ATA8-ACS3 sections 7.17.6.49 or 7.21.5.
      
      If we don't do this, QEMU will loop forever trying to transfer
      zero bytes, which isn't particularly useful.
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Message-id: 1442253685-23349-2-git-send-email-jsnow@redhat.com
      9ef2e93f
    • J
      ide: fix ATAPI command permissions · d9033e1d
      John Snow 提交于
      We're a little too lenient with what we'll let an ATAPI drive handle.
      Clamp down on the IDE command execution table to remove CD_OK permissions
      from commands that are not and have never been ATAPI commands.
      
      For ATAPI command validity, please see:
      - ATA4 Section 6.5 ("PACKET Command feature set")
      - ATA8/ACS Section 4.3 ("The PACKET feature set")
      - ACS3 Section 4.3 ("The PACKET feature set")
      
      ACS3 has a historical command validity table in Table B.4
      ("Historical Command Assignments") that can be referenced to find when
      a command was introduced, deprecated, obsoleted, etc.
      
      The only reference for ATAPI command validity is by checking that
      version's PACKET feature set section.
      
      ATAPI was introduced by T13 into ATA4, all commands retired prior to ATA4
      therefore are assumed to have never been ATAPI commands.
      
      Mandatory commands, as listed in ATA8-ACS3, are:
      
      - DEVICE RESET
      - EXECUTE DEVICE DIAGNOSTIC
      - IDENTIFY DEVICE
      - IDENTIFY PACKET DEVICE
      - NOP
      - PACKET
      - READ SECTOR(S)
      - SET FEATURES
      
      Optional commands as listed in ATA8-ACS3, are:
      
      - FLUSH CACHE
      - READ LOG DMA EXT
      - READ LOG EXT
      - WRITE LOG DMA EXT
      - WRITE LOG EXT
      
      All other commands are illegal to send to an ATAPI device and should
      be rejected by the device.
      
      CD_OK removal justifications:
      
      0x06 WIN_DSM              Defined in ACS2. Not valid for ATAPI.
      0x21 WIN_READ_ONCE        Retired in ATA5. Not ATAPI in ATA4.
      0x94 WIN_STANDBYNOW2      Retired in ATA4. Did not coexist with ATAPI.
      0x95 WIN_IDLEIMMEDIATE2   Retired in ATA4. Did not coexist with ATAPI.
      0x96 WIN_STANDBY2         Retired in ATA4. Did not coexist with ATAPI.
      0x97 WIN_SETIDLE2         Retired in ATA4. Did not coexist with ATAPI.
      0x98 WIN_CHECKPOWERMODE2  Retired in ATA4. Did not coexist with ATAPI.
      0x99 WIN_SLEEPNOW2        Retired in ATA4. Did not coexist with ATAPI.
      0xE0 WIN_STANDBYNOW1      Not part of ATAPI in ATA4, ACS or ACS3.
      0xE1 WIN_IDLEIMMDIATE     Not part of ATAPI in ATA4, ACS or ACS3.
      0xE2 WIN_STANDBY          Not part of ATAPI in ATA4, ACS or ACS3.
      0xE3 WIN_SETIDLE1         Not part of ATAPI in ATA4, ACS or ACS3.
      0xE4 WIN_CHECKPOWERMODE1  Not part of ATAPI in ATA4, ACS or ACS3.
      0xE5 WIN_SLEEPNOW1        Not part of ATAPI in ATA4, ACS or ACS3.
      0xF8 WIN_READ_NATIVE_MAX  Obsoleted in ACS3. Not ATAPI in ATA4 or ACS.
      
      This patch fixes a divide by zero fault that can be caused by sending
      the WIN_READ_NATIVE_MAX command to an ATAPI drive, which causes it to
      attempt to use zeroed CHS values to perform sector arithmetic.
      Reported-by: NQinghao Tang <luodalongde@gmail.com>
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Message-id: 1441816082-21031-1-git-send-email-jsnow@redhat.com
      CC: qemu-stable@nongnu.org
      d9033e1d
    • J
      ide-test: add cdrom dma test · 00ea63fd
      John Snow 提交于
      Now, test the DMA functionality of the ATAPI drive.
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Message-id: 1441926555-19471-5-git-send-email-jsnow@redhat.com
      00ea63fd
    • J
      ide-test: add cdrom pio test · f7ba8d7f
      John Snow 提交于
      Add a simple read test for ATAPI devices,
      using the PIO mechanism.
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Message-id: 1441926555-19471-4-git-send-email-jsnow@redhat.com
      f7ba8d7f
    • J
      qtest/ahci: export generate_pattern · ab4f7057
      John Snow 提交于
      Share the pattern function for ide and ahci test.
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Message-id: 1441926555-19471-3-git-send-email-jsnow@redhat.com
      ab4f7057
    • J
      qtest/ahci: use generate_pattern everywhere · d7531638
      John Snow 提交于
      Fix the pattern generation to actually be interesting,
      and make sure all buffers in the ahci-test actually use it.
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Message-id: 1441926555-19471-2-git-send-email-jsnow@redhat.com
      d7531638
    • J
      ide: unify io_buffer_offset increments · aaeda4a3
      John Snow 提交于
      IDEState's io_buffer_offset was originally added to keep track of offsets
      in AHCI rather exclusively, but it was added to IDEState instead of an
      AHCI-specific structure.
      
      AHCI fakes all PIO transfers using DMA and a scatter-gather list. When
      the core or atapi layers invoke HBA-specific mechanisms for transfers,
      they do not always know that it is being backed by DMA or a sglist, so
      this offset is not always updated by the HBA code everywhere.
      
      If we modify it in dma_buf_commit, however, any HBA that needs to use
      this offset to manage operating on only part of a sglist will have
      access to it.
      
      This will fix ATAPI PIO transfers performed through the AHCI HBA,
      which were previously not modifying this value appropriately.
      
      This will fix ATAPI PIO transfers larger than one sector.
      Reported-by: NHannes Reinecke <hare@suse.de>
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Tested-by: NLaszlo Ersek <lersek@redhat.com>
      Message-id: 1440546331-29087-2-git-send-email-jsnow@redhat.com
      CC: qemu-stable@nongnu.org
      aaeda4a3
  2. 17 9月, 2015 6 次提交
  3. 16 9月, 2015 26 次提交