[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 14/17] ahci: fix win7 hang on boot
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 14/17] ahci: fix win7 hang on boot |
Date: |
Tue, 29 Oct 2013 17:31:06 +0100 |
From: Alexander Graf <address@hidden>
When AHCI executes an asynchronous IDE command, it checked DRDY without
checking either DRQ or BSY. This sometimes caused interrupt to be sent
before command is actually completed.
This resulted in a race condition: if guest then managed to access the
device before command has completed, it would hang waiting for an
interrupt.
This was observed with windows 7 guests.
To fix, check for DRQ or BSY in additiona to DRDY, if set,
the command is asynchronous so delay the interrupt until
asynchronous done callback is invoked.
Reported-by: Michael S. Tsirkin <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Tested-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
hw/ide/ahci.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c
index a8be62c..fbea9e8 100644
--- a/hw/ide/ahci.c
+++ b/hw/ide/ahci.c
@@ -961,7 +961,8 @@ static int handle_cmd(AHCIState *s, int port, int slot)
/* We're ready to process the command in FIS byte 2. */
ide_exec_cmd(&s->dev[port].port, cmd_fis[2]);
- if (s->dev[port].port.ifs[0].status & READY_STAT) {
+ if ((s->dev[port].port.ifs[0].status &
(READY_STAT|DRQ_STAT|BUSY_STAT)) ==
+ READY_STAT) {
ahci_write_fis_d2h(&s->dev[port], cmd_fis);
}
}
--
1.8.1.4
- [Qemu-devel] [PULL 05/17] block/vpc: check that the image has not been truncated, (continued)
- [Qemu-devel] [PULL 05/17] block/vpc: check that the image has not been truncated, Kevin Wolf, 2013/10/29
- [Qemu-devel] [PULL 03/17] qcow2: Unset zero_beyond_eof in save_vmstate, Kevin Wolf, 2013/10/29
- [Qemu-devel] [PULL 06/17] qemu-iotests: Test for loading VM state from qcow2, Kevin Wolf, 2013/10/29
- [Qemu-devel] [PULL 07/17] qcow2: Flush image after creation, Kevin Wolf, 2013/10/29
- [Qemu-devel] [PULL 08/17] exec: Fix bounce buffer allocation in address_space_map(), Kevin Wolf, 2013/10/29
- [Qemu-devel] [PULL 09/17] ide-test: Check what happens with bus mastering disabled, Kevin Wolf, 2013/10/29
- [Qemu-devel] [PULL 10/17] tests: Multiboot mmap test case, Kevin Wolf, 2013/10/29
- [Qemu-devel] [PULL 11/17] block: Don't copy backing file name on error, Kevin Wolf, 2013/10/29
- [Qemu-devel] [PULL 12/17] sheepdog: explicitly set copies as type uint8_t, Kevin Wolf, 2013/10/29
- [Qemu-devel] [PULL 13/17] sheepdog: pass copy_policy in the request, Kevin Wolf, 2013/10/29
- [Qemu-devel] [PULL 14/17] ahci: fix win7 hang on boot,
Kevin Wolf <=
- [Qemu-devel] [PULL 15/17] block: Disable BDRV_O_COPY_ON_READ for the backing file, Kevin Wolf, 2013/10/29
- [Qemu-devel] [PULL 16/17] block: Avoid unecessary drv->bdrv_getlength() calls, Kevin Wolf, 2013/10/29
- [Qemu-devel] [PULL 17/17] qemu-iotests: Fix 051 reference output, Kevin Wolf, 2013/10/29