Hi guys,
First time poster here. I was wondering if this community can help me with a minor issue with qemu/kvm.
I’m running a macOS (Mojave) guest inside a QEMU/KVM Virtual Machine. Host is debian 10 buster, Ryzen 1700, 32GB RAM, X370 board etc. I’m passing through a USB Controller and a Radeon RX 560 (that, by the way, does not appear to suffer from the ominous reset bug) and everything works actually pretty damn well.
The one thing that doesn’t work, however, is CPU topology. Currently, I pass through 16 CPU sockets / 1 Core / 1 Thread. As soon as I set the number of cores or threads > 1 I get kernel panic when booting.
Question: Do I even need to bother? Cinebench R20 shows the same score as for a reference Ryzen 1700X. If no, fine. If yes, how can I properly set the CPU topology?
FWIW, setting the CPU topology works fine under windows. Furthermore, I use Haswell Fake CPU ID in Clover.
Any help or idea is greatly appreciated.
Thanks!
Here’s my VM’s xml:
<domain type='kvm' id='25' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'> <name>macos</name> <uuid>d06d502a-904a-4b34-847d-debf1a3d76c7</uuid> <memory unit='KiB'>25165824</memory> <currentMemory unit='KiB'>25165824</currentMemory> <vcpu placement='static'>16</vcpu> <resource> <partition>/machine</partition> </resource> <os> <type arch='x86_64' machine='pc-q35-3.1'>hvm</type> <loader readonly='yes' type='pflash'>/home/libvirt/osx/firmware/OVMF_CODE.fd</loader> <nvram>/home/libvirt/osx/firmware/macos_VARS.fd</nvram> </os> <features> <acpi/> <apic/> <vmport state='off'/> </features> <cpu mode='custom' match='exact' check='full'> <model fallback='forbid'>EPYC</model> <feature policy='disable' name='pclmuldq'/> <feature policy='disable' name='monitor'/> <feature policy='disable' name='fma'/> <feature policy='disable' name='pcid'/> <feature policy='require' name='x2apic'/> <feature policy='disable' name='movbe'/> <feature policy='disable' name='f16c'/> <feature policy='disable' name='rdrand'/> <feature policy='require' name='hypervisor'/> <feature policy='disable' name='arat'/> <feature policy='disable' name='fsgsbase'/> <feature policy='disable' name='bmi1'/> <feature policy='disable' name='smep'/> <feature policy='disable' name='bmi2'/> <feature policy='disable' name='rdseed'/> <feature policy='disable' name='adx'/> <feature policy='disable' name='smap'/> <feature policy='disable' name='clflushopt'/> <feature policy='disable' name='sha-ni'/> <feature policy='disable' name='xsavec'/> <feature policy='disable' name='xgetbv1'/> <feature policy='disable' name='mmxext'/> <feature policy='disable' name='fxsr_opt'/> <feature policy='disable' name='pdpe1gb'/> <feature policy='disable' name='rdtscp'/> <feature policy='disable' name='svm'/> <feature policy='disable' name='cr8legacy'/> <feature policy='disable' name='abm'/> <feature policy='disable' name='sse4a'/> <feature policy='disable' name='misalignsse'/> <feature policy='disable' name='3dnowprefetch'/> <feature policy='disable' name='osvw'/> <feature policy='require' name='invtsc'/> </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>destroy</on_crash> <pm> <suspend-to-mem enabled='no'/> <suspend-to-disk enabled='no'/> </pm> <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> <disk type='file' device='disk'> <driver name='qemu' type='qcow2'/> <source file='/home/libvirt/osx/ESP.qcow2'/> <backingStore/> <target dev='sda' bus='sata'/> <boot order='1'/> <alias name='sata0-0-0'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> <disk type='file' device='disk'> <driver name='qemu' type='raw'/> <source file='/home/libvirt/osx/BaseSystem.img'/> <backingStore/> <target dev='sdb' bus='sata'/> <alias name='sata0-0-1'/> <address type='drive' controller='0' bus='0' target='0' unit='1'/> </disk> <disk type='file' device='disk'> <driver name='qemu' type='raw'/> <source file='/home/libvirt/osx/osx.img'/> <backingStore/> <target dev='sdc' bus='sata'/> <alias name='sata0-0-2'/> <address type='drive' controller='0' bus='0' target='0' unit='2'/> </disk> <controller type='usb' index='0' model='ich9-ehci1'> <alias name='usb'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x1d' function='0x7'/> </controller> <controller type='usb' index='0' model='ich9-uhci1'> <alias name='usb'/> <master startport='0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x1d' function='0x0' multifunction='on'/> </controller> <controller type='usb' index='0' model='ich9-uhci2'> <alias name='usb'/> <master startport='2'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x1d' function='0x1'/> </controller> <controller type='usb' index='0' model='ich9-uhci3'> <alias name='usb'/> <master startport='4'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x1d' function='0x2'/> </controller> <controller type='sata' index='0'> <alias name='ide'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> </controller> <controller type='pci' index='0' model='pcie-root'> <alias name='pcie.0'/> </controller> <controller type='pci' index='1' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='1' port='0x8'/> <alias name='pci.1'/> <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'/> <alias name='pci.2'/> <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='0xa'/> <alias name='pci.3'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> </controller> <interface type='network'> <mac address='52:54:00:92:d4:7b'/> <source network='default' bridge='virbr0'/> <target dev='vnet0'/> <model type='e1000-82545em'/> <alias name='net0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </interface> <input type='mouse' bus='usb'> <alias name='input0'/> <address type='usb' bus='0' port='1'/> </input> <input type='keyboard' bus='usb'> <alias name='input1'/> <address type='usb' bus='0' port='2'/> </input> <input type='mouse' bus='ps2'> <alias name='input2'/> </input> <input type='keyboard' bus='ps2'> <alias name='input3'/> </input> <hostdev mode='subsystem' type='pci' managed='yes'> <driver name='vfio'/> <source> <address domain='0x0000' bus='0x08' slot='0x00' function='0x0'/> </source> <alias name='hostdev0'/> <rom bar='on' file='/root/radeon560.rom'/> <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='0x08' slot='0x00' function='0x1'/> </source> <alias name='hostdev1'/> <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/> </hostdev> <hostdev mode='subsystem' type='pci' managed='yes'> <driver name='vfio'/> <source> <address domain='0x0000' bus='0x09' slot='0x00' function='0x3'/> </source> <alias name='hostdev2'/> <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/> </hostdev> <memballoon model='none'/> </devices> <seclabel type='dynamic' model='dac' relabel='yes'> <label>+64055:+64055</label> <imagelabel>+64055:+64055</imagelabel> </seclabel> <qemu:commandline> <qemu:arg value='-cpu'/> <qemu:arg value='Penryn,kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,+pcid,+ssse3,+sse4.2,+popcnt,+avx2,+avx,+aes,+xsave,+xsaveopt,check'/> <qemu:arg value='-device'/> <qemu:arg value='isa-applesmc,osk=ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc'/> <qemu:arg value='-smbios'/> <qemu:arg value='type=2'/> </qemu:commandline> </domain>