[9.0.0] qemu breaks mac os vm
Host environment
- Operating system: Manjaro kernel 5.15.158-1
- Architecture: x86_64
- QEMU flavor: qemu-system-x86_64
- QEMU version: 9.0.0-1
Emulated/Virtualized environment
- Operating system: Mac OS Monterey 12.7.4
- Architecture: x86_64
Description of problem
Mac OS Monterey vm not able to boot after upgrading qemu to v. 9.0.0; no issue with qemu 8.2.2. This vm is booted with opencore latest version. The vm is not able to boot, apple logo is displayed on the screen for a bit, then the vm shutdowns, this is quite strange. I can't see anything useful in the logs. Changing machine type from q35-9.0 back to 8.2 doesn't solve the issue. The vm is booted via libvirt (latest version) and it's not a quite "base" vm, it has multiple passthroughs and other things. Before testing into details and starting to run base vms to see if it boots,maybe someone can see something wrong or maybe someone has the same issue. Reverting back to qemu 8.2.2 fixes all the issues and the vm is able to boot again. No issues with a windows 11 vm and with a kali vm. I can say that it's not a DSDT issue (a problem I was having in the past was related with DSTD), because injecting the DSDT of the vm started from v 8.2.2 doesn't boot it.
This is the xml of the vm:
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
<name>Monterey</name>
<memory unit='KiB'>33554432</memory>
<currentMemory unit='KiB'>33554432</currentMemory>
<memoryBacking>
<nosharepages/>
</memoryBacking>
<vcpu placement='static' current='28'>32</vcpu>
<vcpus>
<vcpu id='0' enabled='yes' hotpluggable='no' order='1'/>
<vcpu id='1' enabled='yes' hotpluggable='yes' order='2'/>
<vcpu id='2' enabled='yes' hotpluggable='yes' order='3'/>
<vcpu id='3' enabled='yes' hotpluggable='yes' order='4'/>
<vcpu id='4' enabled='yes' hotpluggable='yes' order='5'/>
<vcpu id='5' enabled='yes' hotpluggable='yes' order='6'/>
<vcpu id='6' enabled='yes' hotpluggable='yes' order='7'/>
<vcpu id='7' enabled='yes' hotpluggable='yes' order='8'/>
<vcpu id='8' enabled='yes' hotpluggable='yes' order='9'/>
<vcpu id='9' enabled='yes' hotpluggable='yes' order='10'/>
<vcpu id='10' enabled='yes' hotpluggable='yes' order='11'/>
<vcpu id='11' enabled='yes' hotpluggable='yes' order='12'/>
<vcpu id='12' enabled='yes' hotpluggable='yes' order='13'/>
<vcpu id='13' enabled='yes' hotpluggable='yes' order='14'/>
<vcpu id='14' enabled='yes' hotpluggable='yes' order='15'/>
<vcpu id='15' enabled='yes' hotpluggable='yes' order='16'/>
<vcpu id='16' enabled='yes' hotpluggable='yes' order='17'/>
<vcpu id='17' enabled='yes' hotpluggable='yes' order='18'/>
<vcpu id='18' enabled='yes' hotpluggable='yes' order='19'/>
<vcpu id='19' enabled='yes' hotpluggable='yes' order='20'/>
<vcpu id='20' enabled='yes' hotpluggable='yes' order='21'/>
<vcpu id='21' enabled='yes' hotpluggable='yes' order='22'/>
<vcpu id='22' enabled='yes' hotpluggable='yes' order='23'/>
<vcpu id='23' enabled='yes' hotpluggable='yes' order='24'/>
<vcpu id='24' enabled='yes' hotpluggable='yes' order='25'/>
<vcpu id='25' enabled='yes' hotpluggable='yes' order='26'/>
<vcpu id='26' enabled='yes' hotpluggable='yes' order='27'/>
<vcpu id='27' enabled='yes' hotpluggable='yes' order='28'/>
<vcpu id='28' enabled='no' hotpluggable='yes'/>
<vcpu id='29' enabled='no' hotpluggable='yes'/>
<vcpu id='30' enabled='no' hotpluggable='yes'/>
<vcpu id='31' enabled='no' hotpluggable='yes'/>
</vcpus>
<iothreads>2</iothreads>
<iothreadids>
<iothread id='1'/>
<iothread id='2'/>
</iothreadids>
<cputune>
<vcpupin vcpu='0' cpuset='1'/>
<vcpupin vcpu='1' cpuset='2'/>
<vcpupin vcpu='2' cpuset='3'/>
<vcpupin vcpu='3' cpuset='4'/>
<vcpupin vcpu='4' cpuset='5'/>
<vcpupin vcpu='5' cpuset='6'/>
<vcpupin vcpu='6' cpuset='7'/>
<vcpupin vcpu='7' cpuset='9'/>
<vcpupin vcpu='8' cpuset='10'/>
<vcpupin vcpu='9' cpuset='11'/>
<vcpupin vcpu='10' cpuset='12'/>
<vcpupin vcpu='11' cpuset='13'/>
<vcpupin vcpu='12' cpuset='14'/>
<vcpupin vcpu='13' cpuset='15'/>
<vcpupin vcpu='14' cpuset='17'/>
<vcpupin vcpu='15' cpuset='18'/>
<vcpupin vcpu='16' cpuset='19'/>
<vcpupin vcpu='17' cpuset='20'/>
<vcpupin vcpu='18' cpuset='21'/>
<vcpupin vcpu='19' cpuset='22'/>
<vcpupin vcpu='20' cpuset='23'/>
<vcpupin vcpu='21' cpuset='25'/>
<vcpupin vcpu='22' cpuset='26'/>
<vcpupin vcpu='23' cpuset='27'/>
<vcpupin vcpu='24' cpuset='28'/>
<vcpupin vcpu='25' cpuset='29'/>
<vcpupin vcpu='26' cpuset='30'/>
<vcpupin vcpu='27' cpuset='31'/>
<emulatorpin cpuset='0,8,16,24'/>
</cputune>
<os>
<type arch='x86_64' machine='pc-q35-8.2'>hvm</type>
<loader readonly='yes' type='pflash'>/opt/macos/AUDK_CODE.fd</loader>
<nvram>/opt/macos/AUDK_VARS.fd</nvram>
<boot dev='hd'/>
</os>
<features>
<acpi/>
<apic/>
</features>
<cpu mode='host-passthrough' check='none' migratable='on'>
<topology sockets='2' dies='1' clusters='1' cores='8' threads='2'/>
</cpu>
<clock offset='utc'>
<timer name='rtc' tickpolicy='catchup'/>
<timer name='pit' tickpolicy='delay'/>
<timer name='hpet' present='no'/>
</clock>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<emulator>/usr/bin/qemu-system-x86_64</emulator>
<controller type='pci' index='0' model='pcie-root'/>
<controller type='pci' index='1' model='pcie-root-port'>
<model name='pcie-root-port'/>
<target chassis='1' port='0x8' hotplug='off'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0' multifunction='on'/>
</controller>
<controller type='pci' index='2' model='pcie-root-port'>
<model name='pcie-root-port'/>
<target chassis='2' port='0x9' hotplug='off'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
</controller>
<controller type='pci' index='3' model='pcie-root-port'>
<model name='pcie-root-port'/>
<target chassis='3' port='0xc' hotplug='off'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
</controller>
<controller type='pci' index='4' model='pcie-root-port'>
<model name='pcie-root-port'/>
<target chassis='4' port='0x13' hotplug='off'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x3'/>
</controller>
<controller type='virtio-serial' index='0'>
<address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>
</controller>
<controller type='usb' index='0' model='ich9-ehci1'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x1'/>
</controller>
<controller type='usb' index='0' model='ich9-uhci1'>
<master startport='0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0' multifunction='on'/>
</controller>
<controller type='sata' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/>
</controller>
<interface type='bridge'>
<mac address='c8:2a:14:66:2c:a1'/>
<source bridge='br0'/>
<model type='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</interface>
<interface type='bridge'>
<mac address='c8:2a:14:31:32:e2'/>
<source bridge='br1'/>
<model type='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
<serial type='pty'>
<target type='isa-serial' port='0'>
<model name='isa-serial'/>
</target>
</serial>
<console type='pty'>
<target type='serial' port='0'/>
</console>
<channel type='unix'>
<target type='virtio' name='org.qemu.guest_agent.0'/>
<address type='virtio-serial' controller='0' bus='0' port='1'/>
</channel>
<input type='keyboard' bus='ps2'/>
<input type='mouse' bus='ps2'/>
<audio id='1' type='none'/>
<hostdev mode='subsystem' type='pci' managed='yes'>
<driver name='vfio'/>
<source>
<address domain='0x0000' bus='0x06' slot='0x00' function='0x0'/>
</source>
<rom file='/opt/gpu-bios/6900xt.rom'/>
<address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0' multifunction='on'/>
</hostdev>
<hostdev mode='subsystem' type='pci' managed='yes'>
<driver name='vfio'/>
<source>
<address domain='0x0000' bus='0x06' slot='0x00' function='0x1'/>
</source>
<address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x1'/>
</hostdev>
<hostdev mode='subsystem' type='pci' managed='yes'>
<driver name='vfio'/>
<source>
<address domain='0x0000' bus='0x00' slot='0x1b' function='0x0'/>
</source>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</hostdev>
<hostdev mode='subsystem' type='pci' managed='yes'>
<driver name='vfio'/>
<source>
<address domain='0x0000' bus='0x0c' slot='0x00' function='0x0'/>
</source>
<address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
</hostdev>
<hostdev mode='subsystem' type='pci' managed='yes'>
<driver name='vfio'/>
<source>
<address domain='0x0000' bus='0x84' slot='0x00' function='0x0'/>
</source>
<address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
</hostdev>
<hostdev mode='subsystem' type='usb' managed='no'>
<source>
<vendor id='0x046d'/>
<product id='0x0892'/>
</source>
<address type='usb' bus='0' port='2'/>
</hostdev>
<hostdev mode='subsystem' type='usb' managed='no'>
<source>
<vendor id='0x148f'/>
<product id='0x3070'/>
</source>
<address type='usb' bus='0' port='1'/>
</hostdev>
<watchdog model='itco' action='reset'/>
<memballoon model='none'/>
</devices>
<qemu:commandline>
<qemu:arg value='-smbios'/>
<qemu:arg value='type=2'/>
<qemu:arg value='-global'/>
<qemu:arg value='ICH9-LPC.acpi-pci-hotplug-with-bridge-support=off'/>
<qemu:arg value='-global'/>
<qemu:arg value='pcie-root-port.x-speed=8'/>
<qemu:arg value='-global'/>
<qemu:arg value='pcie-root-port.x-width=16'/>
<qemu:arg value='-cpu'/>
<qemu:arg value='host,+hypervisor,migratable=no,-erms,kvm=on,+invtsc,+topoext,+avx,+aes,+xsave,+xsaveopt,+ssse3,+sse4_2,+popcnt,+arat,+pclmuldq,+pdpe1gb,+rdtscp,+vme,+umip,check'/>
</qemu:commandline>
</domain>
06:00.0/1 --> gpu 00:1b.0 --> audio 0c:00.0 --> sata controller 84:00.0 --> usb controller 0x046d 0x0892 --> usb webcam 0x148f 0x3070 --> usb wifi