On Mon, Sep 19, 2011 at 12:36:44PM +0300, Michael S. Tsirkin wrote:
On Mon, Sep 19, 2011 at 02:53:47PM +0800, Amos Kong wrote:
Only func 0 is registered to guest driver (we can only found func 0 in slot->funcs list of driver), the other functions could not be cleaned when hot-removing the whole slot. This patch adds device per function in ACPI DSDT tables.
Have tested with linux/winxp/win7, hot-adding/hot-remving, single/multiple function device, they are all fine.
Signed-off-by: Amos Kong akong@redhat.com
On top of my previous patch, the below saves another 6K by moving the method to the correct scope. The code for hotplug handling also gets better organized this way which is nice.
Signed-off-by: Michael S. Tsirkin mst@redhat.com
We naturally should cleanup the old macro, it's unused now, even though this doe snot save space :)
diff --git a/src/acpi-dsdt.dsl b/src/acpi-dsdt.dsl index 36467ea..646f146 100644 --- a/src/acpi-dsdt.dsl +++ b/src/acpi-dsdt.dsl @@ -523,7 +523,7 @@ DefinitionBlock ( Notify(S##nr##5, 1) \ Notify(S##nr##6, 1) \ Notify(S##nr##7, 1) \ - } \ + } \ If (And(PCID, ShiftLeft(1, nr))) { \ Notify(S##nr##0, 3) \ Notify(S##nr##1, 3) \ @@ -910,28 +910,6 @@ DefinitionBlock ( Return(0x01) }
-#define gen_pci_hotplug(nr) \ - If (And(_SB.PCI0.PCIU, ShiftLeft(1, nr))) { \ - Notify(_SB.PCI0.S##nr##0, 1) \ - Notify(_SB.PCI0.S##nr##1, 1) \ - Notify(_SB.PCI0.S##nr##2, 1) \ - Notify(_SB.PCI0.S##nr##3, 1) \ - Notify(_SB.PCI0.S##nr##4, 1) \ - Notify(_SB.PCI0.S##nr##5, 1) \ - Notify(_SB.PCI0.S##nr##6, 1) \ - Notify(_SB.PCI0.S##nr##7, 1) \ - } \ - If (And(_SB.PCI0.PCID, ShiftLeft(1, nr))) { \ - Notify(_SB.PCI0.S##nr##0, 3) \ - Notify(_SB.PCI0.S##nr##1, 3) \ - Notify(_SB.PCI0.S##nr##2, 3) \ - Notify(_SB.PCI0.S##nr##3, 3) \ - Notify(_SB.PCI0.S##nr##4, 3) \ - Notify(_SB.PCI0.S##nr##5, 3) \ - Notify(_SB.PCI0.S##nr##6, 3) \ - Notify(_SB.PCI0.S##nr##7, 3) \ - } - Method(_L01) { _SB.PCI0.HPLG() Return (0x01)