qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PULL 1/5] acpi-build: append description for non-hotpl


From: Michael S. Tsirkin
Subject: Re: [Qemu-devel] [PULL 1/5] acpi-build: append description for non-hotplug
Date: Wed, 19 Feb 2014 15:50:22 +0200

On Mon, Feb 17, 2014 at 09:51:39AM -0500, Gabriel L. Somlo wrote:
> Michael,
> 
> On Mon, Feb 17, 2014 at 04:25:26PM +0200, Michael S. Tsirkin wrote:
> > As reported in
> > http://article.gmane.org/gmane.comp.emulators.qemu/253987
> > Mac OSX actually requires describing all occupied slots
> > in ACPI - even if hotplug isn't enabled.
> > 
> > I didn't expect this so I dropped description of all
> > non hotpluggable slots from ACPI.
> > As a result: before
> > commit 99fd437dee468609de8218f0eb3b16621fb6a9c9 (enable
> > hotplug for pci bridges), PCI cards show up in the "device tree" of OS X
> > (System Information). E.g., on MountainLion users have:
> > 
> > ...
> > 
> > Ethernet still works, but it's not showing up on the PCI bus, and it
> > no longer thinks it's plugged in to slot #2, as it used to before the
> > change.
> > 
> > To fix, append description for all occupied non hotpluggable PCI slots.
> > 
> > One need to be careful when doing this: VGA and ISA device were already
> > described, so we need to drop description from DSDT.
> > 
> > Reported-by: Gabriel L. Somlo <address@hidden>
> > Signed-off-by: Michael S. Tsirkin <address@hidden>
> > ---
> > ...
> 
> With this latest version of your patch, I crash during OS X boot with
> "unable to find driver for this 
> platform:\"ACPI\".\n"@/SourceCache/xnu/xnu-2050.48.12/iokit/Kernel/IOPlatformExpert.cpp:1514"
> 
> Your original patch (slightly doctored since it no longer applies cleanly
> to the current qemu git master) is included below, and still works for me.
> 
> Thanks,
> --Gabriel

Any chance below helps on top?
Another alternative is that DSDT referencing
SSDT does not work for apple.
I hope it's not that, that would be annoying...

commit 12b48c660b8316b1e8ff633eb9f3f34bd4b78284
Author: Michael S. Tsirkin <address@hidden>
Date:   Wed Feb 19 15:47:03 2014 +0200

    acpi-build: drop _SUN for non hotpluggable slots
    
    Not needed there, let's not add it.
    
    Signed-off-by: Michael S. Tsirkin <address@hidden>

diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 5b0bb5a..226e59e 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -644,19 +644,16 @@ static inline char acpi_get_hex(uint32_t val)
 #define ACPI_PCIHP_AML (ssdp_pcihp_aml + *ssdt_pcihp_start)
 
 #define ACPI_PCINOHP_OFFSET_HEX (*ssdt_pcinohp_name - *ssdt_pcinohp_start + 1)
-#define ACPI_PCINOHP_OFFSET_ID (*ssdt_pcinohp_id - *ssdt_pcinohp_start)
 #define ACPI_PCINOHP_OFFSET_ADR (*ssdt_pcinohp_adr - *ssdt_pcinohp_start)
 #define ACPI_PCINOHP_SIZEOF (*ssdt_pcinohp_end - *ssdt_pcinohp_start)
 #define ACPI_PCINOHP_AML (ssdp_pcihp_aml + *ssdt_pcinohp_start)
 
 #define ACPI_PCIVGA_OFFSET_HEX (*ssdt_pcivga_name - *ssdt_pcivga_start + 1)
-#define ACPI_PCIVGA_OFFSET_ID (*ssdt_pcivga_id - *ssdt_pcivga_start)
 #define ACPI_PCIVGA_OFFSET_ADR (*ssdt_pcivga_adr - *ssdt_pcivga_start)
 #define ACPI_PCIVGA_SIZEOF (*ssdt_pcivga_end - *ssdt_pcivga_start)
 #define ACPI_PCIVGA_AML (ssdp_pcihp_aml + *ssdt_pcivga_start)
 
 #define ACPI_PCIQXL_OFFSET_HEX (*ssdt_pciqxl_name - *ssdt_pciqxl_start + 1)
-#define ACPI_PCIQXL_OFFSET_ID (*ssdt_pciqxl_id - *ssdt_pciqxl_start)
 #define ACPI_PCIQXL_OFFSET_ADR (*ssdt_pciqxl_adr - *ssdt_pciqxl_start)
 #define ACPI_PCIQXL_SIZEOF (*ssdt_pciqxl_end - *ssdt_pciqxl_start)
 #define ACPI_PCIQXL_AML (ssdp_pcihp_aml + *ssdt_pciqxl_start)
@@ -701,7 +698,6 @@ static void patch_pcinohp(int slot, uint8_t *ssdt_ptr)
 
     ssdt_ptr[ACPI_PCINOHP_OFFSET_HEX] = acpi_get_hex(devfn >> 4);
     ssdt_ptr[ACPI_PCINOHP_OFFSET_HEX + 1] = acpi_get_hex(devfn);
-    ssdt_ptr[ACPI_PCINOHP_OFFSET_ID] = slot;
     ssdt_ptr[ACPI_PCINOHP_OFFSET_ADR + 2] = slot;
 }
 
@@ -711,7 +707,6 @@ static void patch_pcivga(int slot, uint8_t *ssdt_ptr)
 
     ssdt_ptr[ACPI_PCIVGA_OFFSET_HEX] = acpi_get_hex(devfn >> 4);
     ssdt_ptr[ACPI_PCIVGA_OFFSET_HEX + 1] = acpi_get_hex(devfn);
-    ssdt_ptr[ACPI_PCIVGA_OFFSET_ID] = slot;
     ssdt_ptr[ACPI_PCIVGA_OFFSET_ADR + 2] = slot;
 }
 
@@ -721,7 +716,6 @@ static void patch_pciqxl(int slot, uint8_t *ssdt_ptr)
 
     ssdt_ptr[ACPI_PCIQXL_OFFSET_HEX] = acpi_get_hex(devfn >> 4);
     ssdt_ptr[ACPI_PCIQXL_OFFSET_HEX + 1] = acpi_get_hex(devfn);
-    ssdt_ptr[ACPI_PCIQXL_OFFSET_ID] = slot;
     ssdt_ptr[ACPI_PCIQXL_OFFSET_ADR + 2] = slot;
 }
 
diff --git a/hw/i386/ssdt-pcihp.dsl b/hw/i386/ssdt-pcihp.dsl
index 69a0228..ac91c05 100644
--- a/hw/i386/ssdt-pcihp.dsl
+++ b/hw/i386/ssdt-pcihp.dsl
@@ -53,8 +53,6 @@ DefinitionBlock ("ssdt-pcihp.aml", "SSDT", 0x01, "BXPC", 
"BXSSDTPCIHP", 0x1)
         // Extract the offsets of the device name, address dword and the slot
         // name byte - we fill them in for each device.
         Device(SBB) {
-            ACPI_EXTRACT_NAME_BYTE_CONST ssdt_pcinohp_id
-            Name(_SUN, 0xAA)
             ACPI_EXTRACT_NAME_DWORD_CONST ssdt_pcinohp_adr
             Name(_ADR, 0xAA0000)
         }
@@ -66,8 +64,6 @@ DefinitionBlock ("ssdt-pcihp.aml", "SSDT", 0x01, "BXPC", 
"BXSSDTPCIHP", 0x1)
         // Extract the offsets of the device name, address dword and the slot
         // name byte - we fill them in for each device.
         Device(SCC) {
-            ACPI_EXTRACT_NAME_BYTE_CONST ssdt_pcivga_id
-            Name(_SUN, 0xAA)
             ACPI_EXTRACT_NAME_DWORD_CONST ssdt_pcivga_adr
             Name(_ADR, 0xAA0000)
             Method(_S1D, 0, NotSerialized) {
@@ -88,8 +84,6 @@ DefinitionBlock ("ssdt-pcihp.aml", "SSDT", 0x01, "BXPC", 
"BXSSDTPCIHP", 0x1)
         // Extract the offsets of the device name, address dword and the slot
         // name byte - we fill them in for each device.
         Device(SDD) {
-            ACPI_EXTRACT_NAME_BYTE_CONST ssdt_pciqxl_id
-            Name(_SUN, 0xAA)
             ACPI_EXTRACT_NAME_DWORD_CONST ssdt_pciqxl_adr
             Name(_ADR, 0xAA0000)
             Method(_S1D, 0, NotSerialized) {



reply via email to

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