]> git.proxmox.com Git - pve-qemu-kvm.git/blame - debian/patches/ahci-properly-reset-pxcmd.patch
add qemu-img convert -C option (skip target volume creation)
[pve-qemu-kvm.git] / debian / patches / ahci-properly-reset-pxcmd.patch
CommitLineData
49bf4938
DM
1While testing q35, I found that windows 7 (specifically, windows 7 ultimate
2with sp1 x64), wouldn't install because it can't find the cdrom or disk drive.
3The failure message is: 'A required cd/dvd device driver is missing. If you
4have a driver floppy disk, CD, DVD, or USB flash drive, please insert it now.'
5This can also be reproduced on piix by adding an ahci controller, and
6observing that windows 7 does not see any devices behind it.
7
8The problem is that when windows issues a HBA reset, qemu does not reset the
9individual ports' PxCMD register. Windows 7 then reads back the PxCMD register
10and presumably assumes that the ahci controller has already been initialized.
11Windows then never sets up the PxIE register to enable interrupts, and thus it
12never gets irqs back when it sends ata device inquiry commands.
13
14I believe this change brings qemu into ahci 1.3 specification compliance.
15
16Section 10.4.3 HBA Reset:
17
18"
19When GHC.HR is set to '1', GHC.AE, GHC.IE, the IS register, and all port
20register fields (except PxFB/PxFBU/PxCLB/PxCLBU) that are not HwInit in the
21HBA's register memory space are reset.
22"
23
24I've also re-tested Fedora 16 and 17 to verify that they continue to work with
25this change.
26
27Signed-off-by: Jason Baron <address@hidden>
28---
29 hw/ide/ahci.c | 1 +
30 1 files changed, 1 insertions(+), 0 deletions(-)
31
2802c577
DM
32Index: new/hw/ide/ahci.c
33===================================================================
34--- new.orig/hw/ide/ahci.c 2012-09-24 07:15:28.000000000 +0200
35+++ new/hw/ide/ahci.c 2012-09-24 07:15:29.000000000 +0200
36@@ -1199,6 +1199,7 @@
49bf4938
DM
37 pr->irq_stat = 0;
38 pr->irq_mask = 0;
39 pr->scr_ctl = 0;
40+ pr->cmd = 0;
41 ahci_reset_port(s, i);
42 }
43 }