1. 21 9月, 2015 7 次提交
  2. 19 9月, 2015 23 次提交
  3. 18 9月, 2015 10 次提交
    • P
      Merge remote-tracking branch 'remotes/jnsnow/tags/ide-pull-request' into staging · a53efe9c
      Peter Maydell 提交于
      # gpg: Signature made Fri 18 Sep 2015 15:59:02 BST using RSA key ID AAFC390E
      # gpg: Good signature from "John Snow (John Huston) <jsnow@redhat.com>"
      
      * remotes/jnsnow/tags/ide-pull-request:
        ahci: clean up initial d2h semantics
        ahci: remove cmd_fis argument from write_fis_d2h
        ahci: fix signature generation
        ahci: remove dead reset code
        atapi: abort transfers with 0 byte limits
        ide: fix ATAPI command permissions
        ide-test: add cdrom dma test
        ide-test: add cdrom pio test
        qtest/ahci: export generate_pattern
        qtest/ahci: use generate_pattern everywhere
        ide: unify io_buffer_offset increments
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      a53efe9c
    • J
      ahci: clean up initial d2h semantics · e47f9eb1
      John Snow 提交于
      with write_fis_d2h and signature generation tidied up,
      let's adjust the initial d2h semantics to make more sense.
      
      The initial d2h is considered delivered if there is guest
      memory to save it to.
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Message-id: 1441140641-17631-5-git-send-email-jsnow@redhat.com
      e47f9eb1
    • J
      ahci: remove cmd_fis argument from write_fis_d2h · 28ee8255
      John Snow 提交于
      It's no longer used. We used to generate a D2H FIS based
      upon the command FIS that prompted the update, but in reality,
      the D2H FIS is generated purely from register state.
      
      cmd_fis is vestigial, so get rid of it.
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Message-id: 1441140641-17631-4-git-send-email-jsnow@redhat.com
      28ee8255
    • J
      ahci: fix signature generation · 33a983cb
      John Snow 提交于
      The initial register device-to-host FIS no longer needs to specially
      set certain fields, as these can be handled generically by setting those
      fields explicitly with the signatures we want at port reset time.
      
      (1) Signatures are decomposed into their four component registers and
          set upon (AHCI) port reset.
      (2) the signature cache register is no longer set manually per-each
          device type, but instead just once during ahci_init_d2h.
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Message-id: 1441140641-17631-3-git-send-email-jsnow@redhat.com
      33a983cb
    • 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