qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] OSX guest support review


From: Gabriel L. Somlo
Subject: Re: [Qemu-devel] OSX guest support review
Date: Tue, 28 Jan 2014 11:45:37 -0500
User-agent: Mutt/1.5.21 (2010-09-15)

On Tue, Jan 28, 2014 at 12:51:40AM +0100, Alexander Graf wrote:
> On 27.01.2014, at 23:51, Gabriel L. Somlo <address@hidden> wrote:
> >    - on Mavericks, the e1000 pci card doesn't work. In "System
> >      Information", under "Hardware", I get nothing under "Ethernet
> >      Cards", and "ethernet controller, pci slot 2, driver_installed=No"
> >      under "PCI Cards". On MountainLion and earlier, "Driver Installed"
> >      used to be "Yes", and the card used to show up under Ethernet Cards
> >      as well, using the AppleIntel8254XEthernet.kext. This kext is
> >      present on Mavericks as well, but doesn't seem to work there.
> 
> Does ioreg give any hints?

Nothing interesting as far as my semi-trained eye could tell, but I've
included a trimmed-down excerpt from both MountainLion (where it works)
and from Mavericks (where it doesn't) at the very end of this email.

> > PS. For *all* OS X versions mentioned above, I'm patching kvm to treat
> >  monitor and mwait as NOP, and also the mysterious "ioapic polarity"
> 
> You only need to mark the mwait'ed pages as trapping and wake up the other 
> cpu when it hits ;). "only".

I already have a patch doing just that, which works reliably on UP,
and sometimes even on "-smp 2" :) But that's a post for the KVM list,
as soon as I re-acquaint myself with the parts of KVM I'm touching
(see www.contrib.andrew.cmu.edu/~somlo/OSXKVM/kvm-mwait-emu-20131213.patch
if you're curious). Just emulating monitor/mwait as NOP works 100% of
the time (and is 100% correct, at the expense of being 100% wasteful
of host CPU cycles). But it allows me to focus on the other moving parts
for now :)

> >  patch without which OS X hangs at boot with "still waiting for root
> >  device". I'll dig at this one a bit too, over the next couple of
> 
> IIRC the problem is that in our DSDT we declare the PCI interrupts as high 
> triggered while PCI is defined to be low triggered. Linux and Windows adhere 
> to PCI more than ACPI, but OSX seems to configure the IOAPIC accordingly and 
> doesn't see the interrupt because of that.

I remember you telling me a bit of that back when I first started.

Do you belive there's a chance we can work around this by just tweaking
ACPI on the QEMU side, and thus eliminate the need for a KVM patch ?

Thanks much,
--Gabriel



PS. And now the ioreg output, starting with the working one
from MountainLion:

+-o Root  <class IORegistryEntry, id 0x100000100, retain 11>
  | {
  |   "IOKitBuildVersion" = "Darwin Kernel Version 12.5.0: Sun Sep 29 13:33:47 
PDT 2013; root:xnu-2050.48.12~1/RELEASE_X86_64"
  |   ...
  | }
  | 
  +-o iMac8,1  <class IOPlatformExpertDevice, id 0x100000109, registered, 
matched, active, busy 0 (10540 ms), retain 40>
    | { ... }
    | 
    +-o AppleACPIPlatformExpert  <class AppleACPIPlatformExpert, id 
0x10000010a, registered, matched, active, busy 0 (8802 ms), retain 33>
    | | { ... }
    | | 
...
    | |     
    | +-o address@hidden  <class IOACPIPlatformDevice, id 0x100000125, 
registered, matched, active, busy 0 (5040 ms), retain 83>
    | | | { ... }
    | | | 
    | | +-o AppleACPIPCI  <class AppleACPIPCI, id 0x100000181, registered, 
matched, active, busy 0 (4992 ms), retain 27>
    | |   | { ... }
    | |   |
...
    | |   |       
    | |   +-o address@hidden  <class IOPCIDevice, id 0x100000163, registered, 
matched, active, busy 0 (513 ms), retain 13>
    | |   | | {
    | |   | |   "assigned-addresses" = 
<10100082000000000000bcfe0000000000000200141000810000000000c00000000000004000000030100082000000000000b8fe0000000000000400>
    | |   | |   "IOInterruptSpecifiers" = (<1600000007000000>)
    | |   | |   "IODeviceMemory" = 
(({"address"=4273733632,"length"=131072}),"IOSubMemoryDescriptor is not 
serializable",({"address"=4273471488,"length"=262144}))
    | |   | |   "class-code" = <00000200>
    | |   | |   "IOPowerManagement" = 
{"ChildrenPowerState"=2,"CurrentPowerState"=2,"ChildProxyPowerState"=2,"MaxPowerState"=2}
    | |   | |   "subsystem-vendor-id" = <f41a0000>
    | |   | |   "acpi-device" = "IOACPIPlatformDevice is not serializable"
    | |   | |   "IOInterruptControllers" = ("io-apic-0")
    | |   | |   "name" = <"ethernet">
    | |   | |   "vendor-id" = <86800000>
    | |   | |   "device-id" = <0e100000>
    | |   | |   "IOPCIResourced" = Yes
    | |   | |   "EEPROM Version" = "3.0"
    | |   | |   "compatible" = 
<"pci1af4,1100","pci8086,100e","pciclass,020000","S02">
    | |   | |   "EEPROM Checksum Valid" = Yes
    | |   | |   "acpi-path" = "IOACPIPlane:/_SB/address@hidden/address@hidden"
    | |   | |   "subsystem-id" = <00110000>
    | |   | |   "revision-id" = <03000000>
    | |   | |   "pcidebug" = "0:2:0"
    | |   | |   "IOName" = "ethernet"
    | |   | |   "AAPL,slot-name" = <"PCI Slot 2">
    | |   | |   "reg" = <...>
    | |   | |   "acpi-wake-type" = 2
    | |   | | }
    | |   | | 
    | |   | +-o AppleIntel8254XEthernet  <class AppleIntel8254XEthernet, id 
0x1000001a6, !registered, !matched, active, busy 0 (1 ms), retain 7>
    | |   |   | {
    | |   |   |   "IOClass" = "AppleIntel8254XEthernet"
    | |   |   |   "IOActiveMedium" = "00100030"
    | |   |   |   "EN Number" = 0
    | |   |   |   "IOMinPacketSize" = 64
    | |   |   |   "IOPowerManagement" = 
{"MaxPowerState"=1,"CurrentPowerState"=1}
    | |   |   |   "IOProviderClass" = "IOPCIDevice"
    | |   |   |   "IOLinkStatus" = 3
    | |   |   |   "IOVendor" = "Intel"
    | |   |   |   "IOPacketFilters" = 
{"IONetworkFilterGroup"=275,"IOEthernetWakeOnLANFilterGroup"=0}
    | |   |   |   "Driver Parameters" = {...}
    | |   |   |   "IODefaultMedium" = "00000020"
    | |   |   |   "IOProbeScore" = 10000
    | |   |   |   "IOMediumDictionary" = {...}
    | |   |   |   "IOPCIPrimaryMatch" = "0x10008086&0x0000ffff"
    | |   |   |   "IOMACAddress" = <525400123456>
    | |   |   |   "IOMatchCategory" = "IODefaultMatchCategory"
    | |   |   |   "CFBundleIdentifier" = 
"com.apple.driver.AppleIntel8254XEthernet"
    | |   |   |   "IOMaxPacketSize" = 9018
    | |   |   |   "IOModel" = "82540EM"
    | |   |   |   "IOSelectedMedium" = "00000020"
    | |   |   |   "IOLinkSpeed" = 1000000000
    | |   |   |   "IOFeatures" = 26
    | |   |   |   "IOPCIClassMatch" = "0x02000000&0xffff0000"
    | |   |   | }
    | |   |   | 
    | |   |   +-o en0  <class IOEthernetInterface, id 0x1000001db, registered, 
matched, active, busy 0 (1 ms), retain 10>
    | |   |     | {
    | |   |     |   "IOLocation" = ""
    | |   |     |   "IORequiredPacketFilters" = 
{"IONetworkFilterGroup"=19,"IOEthernetWakeOnLANFilterGroup"=0}
    | |   |     |   "IOInterfaceFlags" = 34915
    | |   |     |   "IOMaxTransferUnit" = 1500
    | |   |     |   "IOMediaAddressLength" = 6
    | |   |     |   "IOInterfaceType" = 6
    | |   |     |   "BSD Name" = "en0"
    | |   |     |   "IOMulticastAddressList" = 
<01005e0000fb3333000000fb01005e0000010180c20000033333d8f74c843333000000013333ff123456>
    | |   |     |   "IOInterfaceState" = 3
    | |   |     |   "IOMediaHeaderLength" = 14
    | |   |     |   "IOActivePacketFilters" = 
{"IONetworkFilterGroup"=19,"IOEthernetWakeOnLANFilterGroup"=0}
    | |   |     |   "IOInterfaceExtraFlags" = 2112
    | |   |     |   "IOPrimaryInterface" = No
    | |   |     |   "IOControllerEnabled" = Yes
    | |   |     |   "IOInterfaceUnit" = 0
    | |   |     |   "IOInterfaceNamePrefix" = "en"
    | |   |     |   "IOBuiltin" = No
    | |   |     |   "IONetworkData" = {...}
    | |   |     | }
    | |   |     | 
    | |   |     +-o IONetworkStack  <class IONetworkStack, id 0x1000001b6, 
registered, matched, active, busy 0 (0 ms), retain 8>
    | |   |       | {
    | |   |       |   "IOProbeScore" = 0
    | |   |       |   "CFBundleIdentifier" = 
"com.apple.iokit.IONetworkingFamily"
    | |   |       |   "IOProviderClass" = "IOResources"
    | |   |       |   "IOClass" = "IONetworkStack"
    | |   |       |   "IOMatchCategory" = "IONetworkStack"
    | |   |       |   "IOUserClientClass" = "IONetworkStackUserClient"
    | |   |       |   "IOResourceMatch" = "IOBSD"
    | |   |       | }
    | |   |       | 
    | |   |       +-o IONetworkStackUserClient  <class 
IONetworkStackUserClient, id 0x100000204, !registered, !matched, active, busy 
0, retain 5>
    | |   |           {
    | |   |             "IOUserClientCreator" = "pid 17, configd"
    | |   |           }
    | |   |           
...

and the non-working one from Mavericks:


+-o Root  <class IORegistryEntry, id 0x100000100, retain 11>
  | {
  |   "IOKitBuildVersion" = "Darwin Kernel Version 13.0.0: Thu Sep 19 22:22:27 
PDT 2013; root:xnu-2422.1.72~6/RELEASE_X86_64"
  |   ...
  | }
  | 
  +-o iMac8,1  <class IOPlatformExpertDevice, id 0x100000109, registered, 
matched, active, busy 0 (26101 ms), retain 41>
    | { ... }
    | 
    +-o AppleACPIPlatformExpert  <class AppleACPIPlatformExpert, id 
0x10000010a, registered, matched, active, busy 0 (26081 ms), retain 33>
    | | { ... }
    | | 
...
    | |     
    | +-o address@hidden  <class IOACPIPlatformDevice, id 0x100000127, 
registered, matched, active, busy 0 (15627 ms), retain 83>
    | | | { ... }
    | | | 
    | | +-o AppleACPIPCI  <class AppleACPIPCI, id 0x100000183, registered, 
matched, active, busy 0 (15573 ms), retain 27>
    | |   | { ... }
    | |   | 
...
    | |   |       
    | |   +-o address@hidden  <class IOPCIDevice, id 0x100000165, registered, 
matched, active, busy 0 (8 ms), retain 10>
    | |   |   {
    | |   |     "assigned-addresses" = 
<10100082000000000000bcfe0000000000000200141000810000000000c000000000000040000000>
    | |   |     "IOInterruptSpecifiers" = (<1600000007000000>)
    | |   |     "IODeviceMemory" = 
(({"address"=4273733632,"length"=131072}),"IOSubMemoryDescriptor is not 
serializable")
    | |   |     "class-code" = <00000200>
    | |   |     "IOPowerManagement" = 
{"MaxPowerState"=3,"ChildProxyPowerState"=2,"CurrentPowerState"=2}
    | |   |     "subsystem-vendor-id" = <f41a0000>
    | |   |     "acpi-device" = "IOACPIPlatformDevice is not serializable"
    | |   |     "IOInterruptControllers" = ("io-apic-0")
    | |   |     "name" = <"ethernet">
    | |   |     "vendor-id" = <86800000>
    | |   |     "device-id" = <0e100000>
    | |   |     "IOPCIResourced" = Yes
    | |   |     "compatible" = 
<"pci1af4,1100","pci8086,100e","pciclass,020000","S02">
    | |   |     "acpi-path" = "IOACPIPlane:/_SB/address@hidden/address@hidden"
    | |   |     "subsystem-id" = <00110000>
    | |   |     "revision-id" = <03000000>
    | |   |     "pcidebug" = "0:2:0"
    | |   |     "IOName" = "ethernet"
    | |   |     "AAPL,slot-name" = <"PCI Slot 2">
    | |   |     "reg" = <...>
    | |   |     "acpi-wake-type" = 2
    | |   |   }
    | |   |   
...



reply via email to

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