qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] aaeda4: ide: unify io_buffer_offset increment


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] aaeda4: ide: unify io_buffer_offset increments
Date: Fri, 18 Sep 2015 11:00:07 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: aaeda4a3c9e4d1d25c65ce8ca98e2de06daf1eec
      
https://github.com/qemu/qemu/commit/aaeda4a3c9e4d1d25c65ce8ca98e2de06daf1eec
  Author: John Snow <address@hidden>
  Date:   2015-09-17 (Thu, 17 Sep 2015)

  Changed paths:
    M hw/ide/ahci.c
    M hw/ide/core.c
    M hw/ide/internal.h

  Log Message:
  -----------
  ide: unify io_buffer_offset increments

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: Hannes Reinecke <address@hidden>
Signed-off-by: John Snow <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Tested-by: Laszlo Ersek <address@hidden>
Message-id: address@hidden
CC: address@hidden


  Commit: d7531638db73396c9e89ade086bbeab6023656f9
      
https://github.com/qemu/qemu/commit/d7531638db73396c9e89ade086bbeab6023656f9
  Author: John Snow <address@hidden>
  Date:   2015-09-18 (Fri, 18 Sep 2015)

  Changed paths:
    M tests/ahci-test.c

  Log Message:
  -----------
  qtest/ahci: use generate_pattern everywhere

Fix the pattern generation to actually be interesting,
and make sure all buffers in the ahci-test actually use it.

Signed-off-by: John Snow <address@hidden>
Message-id: address@hidden


  Commit: ab4f705751c39d59e5039a145cf4703320e4207e
      
https://github.com/qemu/qemu/commit/ab4f705751c39d59e5039a145cf4703320e4207e
  Author: John Snow <address@hidden>
  Date:   2015-09-18 (Fri, 18 Sep 2015)

  Changed paths:
    M tests/ahci-test.c
    M tests/libqos/libqos.c
    M tests/libqos/libqos.h

  Log Message:
  -----------
  qtest/ahci: export generate_pattern

Share the pattern function for ide and ahci test.

Signed-off-by: John Snow <address@hidden>
Message-id: address@hidden


  Commit: f7ba8d7fb6a7f22f8ecf99f61a35079accaba5c4
      
https://github.com/qemu/qemu/commit/f7ba8d7fb6a7f22f8ecf99f61a35079accaba5c4
  Author: John Snow <address@hidden>
  Date:   2015-09-18 (Fri, 18 Sep 2015)

  Changed paths:
    M tests/ide-test.c

  Log Message:
  -----------
  ide-test: add cdrom pio test

Add a simple read test for ATAPI devices,
using the PIO mechanism.

Signed-off-by: John Snow <address@hidden>
Message-id: address@hidden


  Commit: 00ea63fd18d0b7e0248e476c5150a04a06e79a3b
      
https://github.com/qemu/qemu/commit/00ea63fd18d0b7e0248e476c5150a04a06e79a3b
  Author: John Snow <address@hidden>
  Date:   2015-09-18 (Fri, 18 Sep 2015)

  Changed paths:
    M tests/ide-test.c

  Log Message:
  -----------
  ide-test: add cdrom dma test

Now, test the DMA functionality of the ATAPI drive.

Signed-off-by: John Snow <address@hidden>
Message-id: address@hidden


  Commit: d9033e1d3aa666c5071580617a57bd853c5d794a
      
https://github.com/qemu/qemu/commit/d9033e1d3aa666c5071580617a57bd853c5d794a
  Author: John Snow <address@hidden>
  Date:   2015-09-18 (Fri, 18 Sep 2015)

  Changed paths:
    M hw/ide/core.c

  Log Message:
  -----------
  ide: fix ATAPI command permissions

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: Qinghao Tang <address@hidden>
Signed-off-by: John Snow <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Message-id: address@hidden
CC: address@hidden


  Commit: 9ef2e93f9b1888c7d0deb4a105149138e6ad2e98
      
https://github.com/qemu/qemu/commit/9ef2e93f9b1888c7d0deb4a105149138e6ad2e98
  Author: John Snow <address@hidden>
  Date:   2015-09-18 (Fri, 18 Sep 2015)

  Changed paths:
    M hw/ide/atapi.c
    M hw/ide/core.c
    M hw/ide/internal.h

  Log Message:
  -----------
  atapi: abort transfers with 0 byte limits

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: John Snow <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Message-id: address@hidden


  Commit: f91a0aa3743c8bdf0dc0f646606a3dc8bb2c7df8
      
https://github.com/qemu/qemu/commit/f91a0aa3743c8bdf0dc0f646606a3dc8bb2c7df8
  Author: John Snow <address@hidden>
  Date:   2015-09-18 (Fri, 18 Sep 2015)

  Changed paths:
    M hw/ide/ahci.c

  Log Message:
  -----------
  ahci: remove dead reset code

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: Stefan Hajnoczi <address@hidden>
Signed-off-by: John Snow <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Message-id: address@hidden


  Commit: 33a983cb2821600f4ed5720919434256e8371ec2
      
https://github.com/qemu/qemu/commit/33a983cb2821600f4ed5720919434256e8371ec2
  Author: John Snow <address@hidden>
  Date:   2015-09-18 (Fri, 18 Sep 2015)

  Changed paths:
    M hw/ide/ahci.c

  Log Message:
  -----------
  ahci: fix signature generation

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: John Snow <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Message-id: address@hidden


  Commit: 28ee82557cdbf3d9023b58f7229b0d0fd1a3d776
      
https://github.com/qemu/qemu/commit/28ee82557cdbf3d9023b58f7229b0d0fd1a3d776
  Author: John Snow <address@hidden>
  Date:   2015-09-18 (Fri, 18 Sep 2015)

  Changed paths:
    M hw/ide/ahci.c

  Log Message:
  -----------
  ahci: remove cmd_fis argument from write_fis_d2h

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: John Snow <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Message-id: address@hidden


  Commit: e47f9eb148fc3b9a67d318951ebceb834205f94c
      
https://github.com/qemu/qemu/commit/e47f9eb148fc3b9a67d318951ebceb834205f94c
  Author: John Snow <address@hidden>
  Date:   2015-09-18 (Fri, 18 Sep 2015)

  Changed paths:
    M hw/ide/ahci.c

  Log Message:
  -----------
  ahci: clean up initial d2h semantics

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: John Snow <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Message-id: address@hidden


  Commit: a53efe9c47c9a441b307c5cec64d08d9647ab6a4
      
https://github.com/qemu/qemu/commit/a53efe9c47c9a441b307c5cec64d08d9647ab6a4
  Author: Peter Maydell <address@hidden>
  Date:   2015-09-18 (Fri, 18 Sep 2015)

  Changed paths:
    M hw/ide/ahci.c
    M hw/ide/atapi.c
    M hw/ide/core.c
    M hw/ide/internal.h
    M tests/ahci-test.c
    M tests/ide-test.c
    M tests/libqos/libqos.c
    M tests/libqos/libqos.h

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/jnsnow/tags/ide-pull-request' into 
staging

# gpg: Signature made Fri 18 Sep 2015 15:59:02 BST using RSA key ID AAFC390E
# gpg: Good signature from "John Snow (John Huston) <address@hidden>"

* 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: Peter Maydell <address@hidden>


  Commit: b12a84ce3c27e42c8f51c436aa196938d5cc2c71
      
https://github.com/qemu/qemu/commit/b12a84ce3c27e42c8f51c436aa196938d5cc2c71
  Author: Rainer Müller <address@hidden>
  Date:   2015-09-18 (Fri, 18 Sep 2015)

  Changed paths:
    M ui/cocoa.m

  Log Message:
  -----------
  cocoa: Suppress Cocoa window with -display

Do not open a Cocoa window when another display is selected that will be
initialized later. The Cocoa display cannot be selected with -display,
so there is no need to check its argument.

Signed-off-by: Rainer Müller <address@hidden>
Reviewed-by: Andreas Färber <address@hidden>
Message-id: address@hidden
Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/ffa4822c015d...b12a84ce3c27

reply via email to

[Prev in Thread] Current Thread [Next in Thread]