Giter Site home page Giter Site logo

kvm-opencore's Introduction

KVM-Opencore

Opencore Configuration of KVM Hackintosh with tweaks.

We propose best practice for KVM users.

Status

  • OS: tested in Catalina 10.15.x
  • Opencore: 0.5.6
    • NVRAM: native
    • AppleHotKey: works
    • FileVault: un-tested
    • Boot-Audio: works with onboard audio passthrough
    • OVMF: you can use latest version other than the old way(patched one). see issues.
  • SMBIOS: iMacPro1,1
  • NIC: vmxnet3/e1000-82545em/passthrough
  • CPU:
    • Penryn: works, using patches to enable leaf7 support for better performance
    • Intel Host-Passthrough: works, but with patches and remove topology line
    • AMD Host-PassThrough: works, but with AMD-Vanilla patches
  • GPU Passthrough: works
    • HDMI/DP Audio: works
    • Metal Support: works
    • H264 Hardware Decoding: works
    • H265 Hardware Decoding: works
  • Handoff: works with specific Wifi/Bluetooth
  • USB(Passthrough): works
  • Power Manages
    • Sleep: works, see details below.
    • EC: faked one
    • USB Power: works even with USB3 passthrough
    • CPU AGPM: wo don't need CPU AGPM because hypervisor handled it well, this is for GPU AGPM
    • GPU AGPM: works

Usage

  1. Download the repository and put the EFI under your EFI disk

Manual

Libvirt XML

See more in libvirt.xml.

SMBios

Comparing with normal hackintosh setup, we have only limited choices here(because we don't have an iGPU).

  • iMacPro1,1(Prefer)
  • MacPro7,1

CPU

Models Selection

You have three options to choose: Penryn, Passthrough, Emulating Model.

Penryn

Penryn is the safest choice in Hackintosh VM, it is classic, similar with virtualized enviroment, and Apple wrote native code to support it. But we should do something to make it work more than that:

  1. You should passthrough some important cpuid features which don't included in Penryn Model, such as:
    • invtsc: latest MacOS won't boot without it
    • AVX: latest MacOS won't boot without it
    • FMA: metal support needs this
    • AVX2
    • BMI1
    • BMI2
    • kvm=on: QEMU use it to expose Hypervisor leaf node, which MacOS use it to determine the invtsc frequency from hypervisor node.
    • vmware-cpu-freq=on: no more need, QEMU enabled it by default.
  2. Add patch(from AMD-Vanilla) to support leaf7 cpuid features support
    • otherwise Apple won't use some important feature like AVX
    • can be check with sysctl -a|grep machdep.cpu.leaf7_features to see whether AVX/AVX2 is included.

Passthrough

Intel

If you are using most recent generation Intel CPU(newer than Penryn), then you can just passthrough your cpu type with mode='host-passthrough'.

AMD

You can passthrough amd process too, but with AMD-Vanilla patches like bare metal hackintosh.

Other Notes about CPU

Irregular Topology

If you wanna assign an irregular topology (like 3-cores/6-threads or 5-cores/5-threads), you should fake a topology, otherwise you will get a kernel panic. Details can be found here.

<!-- Example cpu topology defination with 3-cores/6-threads -->
<vcpu placement='static' current='6'>8</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'/>
    <!-- Fake two cores but disabled. -->
    <vcpu id='6' enabled='no' hotpluggable='yes'/>
    <vcpu id='7' enabled='no' hotpluggable='yes'/>
  </vcpus>
  <cputune>
    <vcpupin vcpu='0' cpuset='6'/>
    <vcpupin vcpu='1' cpuset='14'/>
    <vcpupin vcpu='2' cpuset='7'/>
    <vcpupin vcpu='3' cpuset='15'/>
    <vcpupin vcpu='4' cpuset='5'/>
    <vcpupin vcpu='5' cpuset='13'/>
  </cputune>
  <cpu mode='host-passthrough' check='none'>
    <topology sockets='1' cores='4' threads='2'/>
  </cpu>

Unknown CPU Name

If you find unknown cpu model in you system info, you can change it by specify the ProcessorType in SMBios Section of config.plist. Choices can be found in here.

Example, if you have or emulate a skylake-server processor, you can use 0x0F01(Xeon-W):

// <0F01> 08 cores  Intel Xeon W                   Intel Xeon W
// <0F01> 10 cores  Intel Xeon W                   Intel Xeon W
// <0F01> 14 cores  Intel Xeon W                   Intel Xeon W
// <0F01> 18 cores  Intel Xeon W                   Intel Xeon W

Notes, the cores should be matched too, or you can fake some disable cores to match the topology. Then you can specify 3841(0x0F01 in decimal) in ProcessorType section.

GPU

GPU passthrough is a good way to gain smooth experience in MacOS.If you do so, make sure you doing things right. You have to make sure you put the gfx and graphic audio in the same bus but different function, otherwise DP/HDMI audio, Metal Support, HW Accuration won't work.

<!-- Assume we have a graphic(gfx(0x2d/0x0) and audio(0x2d/0x1)) -->
<hostdev mode='subsystem' type='pci' managed='yes'>
    <driver name='vfio'/>
    <source>
        <address domain='0x0000' bus='0x2d' slot='0x00' function='0x0'/>
    </source>
<!-- we put gfx under bus 0x01 and function 0x0, also with multifunction on. -->
    <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0' multifunction='on'/>
</hostdev>
<hostdev mode='subsystem' type='pci' managed='yes'>
    <driver name='vfio'/>
    <source>
        <address domain='0x0000' bus='0x2d' slot='0x00' function='0x1'/>
    </source>
<!-- we put graphic audio under the same bus 0x01 with gfx but different function 0x1-->
    <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x1'/>
</hostdev>

If you did it right, then there is no much differeces between VM and normal setup procedure, just adding Lilu/WEG/AppleALC then the Metal/H264/H265 HW/HDMI Audio will work well in most case.

USB

We use EHC/UHC from qemu now(XHCI(nec/qemu) can't be recognized by MacOS now). USB port mapping(EHC) and USB Power injection(with fake EC ioreg) are already included in config.plist.

Known Problems/Help

see issues.

kvm-opencore's People

Contributors

leoyzen avatar tpruszin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kvm-opencore's Issues

QEMU command line

In case anyone is wondering what is the command line executed from the libvirt inside qemu-system-x86_64, this might help:

Those lines were exported by virsh domxml-to-native qemu-argv libvirt.xml

qemu-system-x86_64 
-name guest=Catalina,debug-threads=on -object secret,id=masterKey0,format=raw,file=$HOME/.config/libvirt/qemu/lib/domain--1-Catalina/master-key.aes 
-blockdev '{"driver":"file","filename":"/usr/share/qemu/ovmf-x64/OVMF_CODE-pure-efi.fd","node-name":"libvirt-pflash0-storage","auto-read-only":true,"discard":"unmap"}' 
-blockdev '{"node-name":"libvirt-pflash0-format","read-only":true,"driver":"raw","file":"libvirt-pflash0-storage"}' 
-blockdev '{"driver":"file","filename":"/etc/libvirt/qemu/nvram/4450a55c-1669-da0e-d0bd-3ab45fef0398_VARS-pure-efi.fd","node-name":"libvirt-pflash1-storage","auto-read-only":true,"discard":"unmap"}' 
-blockdev '{"node-name":"libvirt-pflash1-format","read-only":false,"driver":"raw","file":"libvirt-pflash1-storage"}' 
-machine pc-q35-4.2,accel=kvm,usb=off,dump-guest-core=off,mem-merge=off,pflash0=libvirt-pflash0-format,pflash1=libvirt-pflash1-format 
-m 8192 
-overcommit mem-lock=off 
-smp 1,maxcpus=8,sockets=8,cores=1,threads=1 
-object iothread,id=iothread1 
-uuid 4450a55c-1669-da0e-d0bd-3ab45fef0398 
-display none 
-no-user-config 
-nodefaults 
-chardev socket,id=charmonitor,path=$HOME/.config/libvirt/qemu/lib/domain--1-Catalina/monitor.sock,server,nowait 
-mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc,driftfix=slew 
-global kvm-pit.lost_tick_policy=delay 
-no-hpet 
-no-shutdown 
-boot strict=on 
-device pcie-root-port,port=0x8,chassis=1,id=pci.1,bus=pcie.0,multifunction=on,addr=0x1 
-device pcie-root-port,port=0x9,chassis=2,id=pci.2,bus=pcie.0,addr=0x1.0x1 
-device pcie-root-port,port=0xa,chassis=3,id=pci.3,bus=pcie.0,addr=0x1.0x2 
-device pcie-root-port,port=0xb,chassis=4,id=pci.4,bus=pcie.0,addr=0x1.0x3 
-device pcie-root-port,port=0xc,chassis=5,id=pci.5,bus=pcie.0,addr=0x1.0x4 
-device pcie-root-port,port=0xd,chassis=6,id=pci.6,bus=pcie.0,addr=0x1.0x5 
-device pcie-root-port,port=0xe,chassis=7,id=pci.7,bus=pcie.0,addr=0x1.0x6 
-device ich9-usb-ehci1,id=usb,bus=pcie.0,addr=0x7.0x7 
-device ich9-usb-uhci1,masterbus=usb.0,firstport=0,bus=pcie.0,multifunction=on,addr=0x7 
-device ich9-usb-uhci2,masterbus=usb.0,firstport=2,bus=pcie.0,addr=0x7.0x1 
-device ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pcie.0,addr=0x7.0x2 
-device virtio-serial-pci,id=virtio-serial0,bus=pci.2,addr=0x0 
-blockdev '{"driver":"file","filename":"/mnt/user/domains/Catalina/opencore.beta.qcow2","aio":"threads","node-name":"libvirt-2-storage","cache":{"direct":false,"no-flush":false},"auto-read-only":true,"discard":"unmap"}' 
-blockdev '{"node-name":"libvirt-2-format","read-only":false,"cache":{"direct":false,"no-flush":false},"driver":"qcow2","file":"libvirt-2-storage","backing":null}' 
-device ide-hd,bus=ide.4,drive=libvirt-2-format,id=sata0-0-4,bootindex=1,write-cache=on -blockdev '{"driver":"file","filename":"/mnt/user/domains/Catalina/system.beta.qcow2","aio":"threads","node-name":"libvirt-1-storage","cache":{"direct":false,"no-flush":false},"auto-read-only":true,"discard":"unmap"}' 
-blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"direct":false,"no-flush":false},"driver":"qcow2","file":"libvirt-1-storage","backing":null}' 
-device ide-hd,bus=ide.0,drive=libvirt-1-format,id=sata0-0-0,write-cache=on -chardev pty,id=charserial0 
-device isa-serial,chardev=charserial0,id=serial0 -chardev socket,id=charchannel0,path=$HOME/.config/libvirt/qemu/channel/target/domain--1-Catalina/org.qemu.guest_agent.0,server,nowait -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 
-device usb-tablet,id=input0,bus=usb.0,port=1 
-device usb-kbd,id=input2,bus=usb.0,port=3 
-cpu Penryn,vendor=GenuineIntel,+hypervisor,+invtsc,kvm=on,+fma,+avx,+avx2,+aes,+ssse3,+sse4_2,+popcnt,+sse4a,+bmi1,+bmi2 
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny 
-msg timestamp=on

I've just changed 4 things:

  • Removed the internet passtrough below. Somehow, transforming a XML to qemu-args tries to execute the command as well. So trying to run it without sudo retrieves error: Unable to create tap device vnet%d: Operation not permitted
    <interface type='bridge'>
      <mac address='52:54:00:3e:21:a2'/>
      <source bridge='br0.100'/>
      <model type='e1000-82545em'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </interface>
  • Remove the CPU topology . It was giving me error: unsupported configuration: CPU topology doesn't match maximum vcpu count.
  <vcpu placement='static' current='6'>8</vcpu>
  <iothreads>1</iothreads>
  <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'/>
    <!-- If you wanna passthrough all 8-cores, enable 6/7 two vcpus -->
    <vcpu id='6' enabled='no' hotpluggable='yes' order='7'/>
    <vcpu id='7' enabled='no' hotpluggable='yes' order='8'/>
  </vcpus>
  <cputune>
    <vcpupin vcpu='0' cpuset='0'/>
    <vcpupin vcpu='1' cpuset='6'/>
    <vcpupin vcpu='2' cpuset='1'/>
    <vcpupin vcpu='3' cpuset='7'/>
    <vcpupin vcpu='4' cpuset='2'/>
    <vcpupin vcpu='5' cpuset='8'/>
    <iothreadpin iothread='1' cpuset='3,9'/>
  </cputune>
  • Removed the direct path to the emulator (since I can assume that the user is going to execute this on the right qemu-system-x86_64.
<emulator>/usr/local/sbin/qemu</emulator>
  • Changed my path that was exported with the command to $HOME

Does AMD ryzen have Nested virtualization sopport?

Sorry for using Chinese.
您好,我是从远景论坛找到这里的,感想您为OC的Hackintouch做出的贡献。
大家都知道如果Ryzen使用Clover来安装MacOS,那么由于指令集的缺失(Penryn),嵌套虚拟化是无法使用的,因此基于AMD的Mac虚拟机无法使用PD、docker等软件。
近期看到您的KVM-OC项目,也了解到OC可以模拟更新的CPU模型,请问到目前为止,使用OC能否实现嵌套虚拟化?
谢谢~

Creating the qcow2 image

Not really an issue, I just can't find a way to convert the EFI folder to a qcow2 image. I am using macOS and so far I can only convert and use DMG and IMG files.

hotplug a sata/virtio disk to macOS

I want to hotplug a new disk to macOS, and I test sata and virtio hotplug, but it not works.
On qemu side the new disk is already attached with monitor info block shows.
But on guest macOS side do not find the hotplug new disk.
Does anyone know about this issue, is it related to OpenCore?

Version Lists:

pve7 with QEMU6.0.0
thenickdude‘s KVM-Opencore V13, OpenCore is 0.7.0
macOS 12.1

Virtio HDD Passthrough Support?

I can't get my hdd passed through with /dev/disk/by-id/ to boot with OC when set as virtio rather than sata in virtmanager. tried 0.5.6 through 0.5.9 building new EFI partition disks, different ovmf's, a .qcow2 version of my install booting from a storage pool, apfs.efi, to no avail. My ideal setup with all virtio is working with clover. Attached are my macOS-test.xml and OC config.plist
EFI.tar.gz

Sidecar/Apple watch unlock not work when using iMacPro1,1

As far as I know, sidecar need iGPU or T2-chip, but we don't have either.
The workaroud is switch SMBios to iMac18,3 or iMac19,1, then add shiki-id=Mac-7BA5B2D9E42DDD94 shikigva=40 to boot-args.But may have other problems (I don't test it yet).

X64 exception before boot menu with CPU host on Ryzen/QEMU/WSL2

First opened as acidanthera/bugtracker#1105, but was told here might be better.

When using host CPU passthrough with QEMU, I get a X64 exception before the boot menu.
When using Penryn, I can get to the boot menu.

Please find the EFI rootfs attached: rootfs.zip

Configuration:

  • OpenCore 0.6.0 Debug
  • QEMU 4.2.0 + KVM
  • WSL2 with Linux 4.19.121-microsoft-standard #1 SMP Fri Jun 19 21:06:10 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
  • Ryzen 3950x

QEMU command line:

qemu-system-x86_64 \
		-cpu host,kvm=on,vmware-cpuid-freq=on,rdtscp,check,+invtsc,+hypervisor \
		-serial stdio \
		"-accel" "kvm" \
		"-machine" "pc-q35-2.11" \
		"-m" 4096 \
		"-smp" "cpus=4" \
		"-usb" \
		"-device" "usb-kbd" \
		"-device" "usb-tablet" \
		-smbios type=2 \
		-drive if=pflash,format=raw,readonly,file=./OVMF/OVMF_CODE.fd \
		-drive if=pflash,format=raw,file=./OVMF/OVMF_VARS.fd \
		"-device" "ide-hd,bus=ide.1,drive=bootloader" \
		"-drive" "id=bootloader,if=none,format=raw,file=./opencore.img"

Note that QEMU complains that Ryzen doesn't support invtsc but adding/removing it doesn't change anything.

BS: Starting OpenCore...
BS: Booter path - \EFI\BOOT\BOOTX64.EFI
OCFS: Trying to locate filesystem on 7ED04898 7ECE5E98
OCFS: Filesystem DP is \EFI\BOOT\BOOTX64.EFI
BS: Trying to start loaded OpenCore image...
BS: Failed to locate bootstrap protocol - Not Found
BS: Trying to load OpenCore image...
BS: Read OpenCore image of 626432 bytes
BS: Loaded OpenCore image at 7ECE4C18 handle
OC: Starting OpenCore...
OC: Booter path - <nil>
OC: Booted from bootstrap
OC: ReRun executed!
OCST: Missing vault data, ignoring...
OC: OcMiscEarlyInit...
OC: Loaded configuration of 39375 bytes
OC: Watchdog status is 0
!!!! X64 Exception Type - 0D(#GP - General Protection)  CPU Apic ID - 00000000 !!!!
ExceptionData - 0000000000000000
RIP  - 000000007DE52D75, CS  - 0000000000000038, RFLAGS - 0000000000010246
RAX  - 0000000000000008, RCX - 00000000C0010064, RDX - 000000007DEDE9D8
RBX  - 0000000000000000, RSP - 000000007FEE3910, RBP - 000000007FEE3910
RSI  - 000000007FEE39D8, RDI - 0000000000000000
R8   - 0000000000000007, R9  - 000000007FEE39D8, R10 - 00000000000005F2
R11  - 0000000000000001, R12 - 000000007DEDEAA0, R13 - 000000007DEDE9D8
R14  - 0000000000000000, R15 - 000000007DEDEA2C
DS   - 0000000000000030, ES  - 0000000000000030, FS  - 0000000000000030
GS   - 0000000000000030, SS  - 0000000000000030
CR0  - 0000000080010033, CR2 - 0000000000000000, CR3 - 000000007FC01000
CR4  - 0000000000000668, CR8 - 0000000000000000
DR0  - 0000000000000000, DR1 - 0000000000000000, DR2 - 0000000000000000
DR3  - 0000000000000000, DR6 - 00000000FFFF0FF0, DR7 - 0000000000000400
GDTR - 000000007FBEE698 0000000000000047, LDTR - 0000000000000000
IDTR - 000000007F2A2018 0000000000000FFF,   TR - 0000000000000000
FXSAVE_STATE - 000000007FEE3570
!!!! Find image based on IP(0x7DE52D75) /Users/travis/build/acidanthera/OpenCorePkg/UDK/Build/OpenCorePkg/DEBUG_XCODE5/X64/OpenCorePkg/Platform/OpenCore/OpenCore/DEBUG/OpenCore.dll (ImageBase=000000007DE48000, EntryPoint=000000007DEA44C9) !!!!

Thank you

RX 580 frame rate drops in Ryzen 1600

Hi Guys,
I have recently installed macOs with Opencore 0.6.0.

System config:
Ryzen 1600 + Gigabyte GA-AB350N-Gaming WIFI (rev. 1.0) + RX 580
Everyting works well except the graphics card.
The cinebench score I get is 2595.

The only issue is with Unigine Heaven and Valley. The get only 31 FPS avg. Whereas the same machine dual boot on windows gives me 80-90 fps.

Could you please let me know what am I missing?
Uploaded the config.plist file. Please help!!
AB350_config_plist.txt

AMD host-passthrough

For AMD CPU host-passthrough, is this all you have to do?

  1. Swap out Kernel > patches section in config.plist with AMD-Vanilla patches.
  2. Change libvirt CPU to host-passthrough.

Do you need to change any of the following...

  1. qemu:commandline in libvirt xml? (I notice the commented line re: host-passthrough, but not sure if this is outdated).
  2. Any of the AMD motherboard/chipset specific tweaks as described in the OC guide? (I am guessing not, since we use OVMF firmware).
  3. Anything else?

Thanks for the work, your setup is working great for me so far with Penryn emulation and GPU passthrough.

ESXI

Would you consider putting together a guide on how to make this work on ESXI with full gpu passthrough?

This package right now doesn't work on esxi - black screen. Gpu passthrough with supported gpu otherwise doesn't get hw acceleration.

Boot Failing, OpenCore 0.6.1

Hi,

I realize that your configuration and config.plist are for 0.5.6 (right?), but I assume the intention is to somewhat keep up with OpenCore (given bug fixes, new features, etc.)? I tried the current config.plist with 0.6.1, and it fails to boot. Not fully unexpected, guessing there is some incompatible setting. Is there a good way to capture debug / log information, to work through this?

But also, is there a "minimum" config.plist, that can be used across different OpenCore versions? Not fully optimized of course, but enough to "crawl before walk" 😄. I thought I had seen one a while back, all that is required to boot and keep iServices happy, but I could surely be wrong. I (think I) have the needed basic information (from my old laptop with a dead screen), but very likely some kvm setting is causing the non-boot issue (in 0.6.1).

Thanks!

topology panic when using cpu generation newer than Penryn

If you passthrough your cpu model and defined topology, you will see a kernel panic in MacOS.
The problem is divided to two part:
Fisrt is bootloader support(see disscusion here). This fixed in latest opencore.
The next is Apple MacOS support.
Apple use an undocumented Intel msr 0x35(see xen pr) to indentify topology when CPU Model newer than Penryn(Apple get the cpu topology from acpi when using Penryn, that's why Penryn works).
The xnu code related:

if (0 != (info_p->cpuid_features & CPUID_FEATURE_VMM) &&
	    PE_parse_boot_argn("-nomsr35h", NULL, 0)) {
		info_p->core_count = 1;
		info_p->thread_count = 1;
		cpuid_set_cache_info(info_p);
	} else {
		switch (info_p->cpuid_cpufamily) {
		case CPUFAMILY_INTEL_PENRYN:
			cpuid_set_cache_info(info_p);
			info_p->core_count   = info_p->cpuid_cores_per_package;
			info_p->thread_count = info_p->cpuid_logical_per_package;
			break;
		case CPUFAMILY_INTEL_WESTMERE: {
			uint64_t msr = rdmsr64(MSR_CORE_THREAD_COUNT);
			if (0 == msr) {
				/* Provide a non-zero default for some VMMs */
				msr = (1 << 16) | 1;
			}
			info_p->core_count   = bitfield32((uint32_t)msr, 19, 16);
			info_p->thread_count = bitfield32((uint32_t)msr, 15, 0);
			cpuid_set_cache_info(info_p);
			break;
		}
		default: {
			uint64_t msr = rdmsr64(MSR_CORE_THREAD_COUNT);
			if (0 == msr) {
				/* Provide a non-zero default for some VMMs */
				msr = (1 << 16) | 1;
			}
			info_p->core_count   = bitfield32((uint32_t)msr, 31, 16);
			info_p->thread_count = bitfield32((uint32_t)msr, 15, 0);
			cpuid_set_cache_info(info_p);
			break;
		}
		}
	}

Of course not only the VM user faces the problem, but also AMD Vanilla users. So we definately can use the way of AMD Vanilla did(using patches), but we need some survey which patches works.

Stock OVMF is unable to start OpenCore

I'm trying to set up KVM-OSX on Arch Linux, but the stock OVMF from the edk2-ovmf package does not work:

image

I've tried to use both the OpenCore.qcow2 from the repository and a newly built one using the script, but neither worked.

Please let me know if more information (e.g. EDK2 debugging logs) is needed.

DP/HDMI audio not work when using GPU passthrough.

Many peoples feedback that theirs DP/HDMI would not work when using GPU passthrough. It is a common mistake that newbies would made but there is little discussion in the net.
You must put the graphic and graphic audio in the the bus but different function when passthrough them.

<!-- Assume we have a graphic(gfx(0x2d/0x0) and audio(0x2d/0x1)) -->
<hostdev mode='subsystem' type='pci' managed='yes'>
    <driver name='vfio'/>
    <source>
        <address domain='0x0000' bus='0x2d' slot='0x00' function='0x0'/>
    </source>
<!-- we put gfx under bus 0x01 and function 0x0, also with multifunction on. -->
    <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0' multifunction='on'/>
</hostdev>
<hostdev mode='subsystem' type='pci' managed='yes'>
    <driver name='vfio'/>
    <source>
        <address domain='0x0000' bus='0x2d' slot='0x00' function='0x1'/>
    </source>
<!-- we put graphic audio under the same bus 0x01 with gfx but different function 0x1-->
    <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x1'/>
</hostdev>

[DEBUG][HELP] Boot hangs somewhere in XNU/Kernel Handoff just before [ PCI configurations begin ]

OS: Proxmox
CPU: Ryzen 7 5825u
GPU: RX550 passthrough
VM OS: MAC Catalina 10.15

General setup followed:https://www.nicksherlock.com/2021/10/installing-macos-12-monterey-on-proxmox-7/

Setup:
GPU adapter from NVME to full PCI slot, provides PCI3.0 x4 actual speed
Problem:
Boot (system is already installed) hangs somewhere in XNU/Kernel Handoff just before [ PCI configurations begin ].... it just freezes, the system boots in the background, and I can init a Nomachine connection to the VM but I have no desktop initialised (most likely due to the fact that there is no GPU present in the system).

Debugs/Results:
GPU passthrough works and system is usable on old full (full desktop with proper PCI slots) system Ryzen 9.
GPU passthrough works mini-Ryzen-7-5825u with windows VM with nvidia and amd cards. (3D accel tested fine)
Mac Boot system freezes the same with nvidia 1080 card (for debug, I know it is not compatible)
Adding a standard display, system boots with amd card attached but there is no sign of the card in the system at all, just the standard display.
Activating Debug in open core, and comparing the logs of a boot with standard display and one that freezes render no differences
Adding npci=0x2000 or npci=0x3000 does not change anything
Same setup fresh new VM 10.15 same hang
Tried Monterey install image, same hang
Booting windows VM (detaching the GPU totally from linux and initialising it) and then booting OSX VM same hang

7127bce3-6153-4f98-b289-8c575b94a628
ebba6af9-1dfd-412a-ace0-b4971568964f

Any help is hugely appreciated. Thanks

CLOSING THIS AS I FOUND THE ISSUE.

After a lot of attempts and changes to modules and params, vendor-reset, grub, blacklists, etc... the issue was that pc-q35-5.0 works ok and the latest does not so qemu broke something at q35-6.1

Unplugging USB device freezes MacOS

I have passed through a USB hub (acts as a switch) where I connect my keyboard and mouse to switch between my PC and my VM. VM completely freezes when I press ‘switch’ (keyboard and mouse are disconnected). The first time switching doesn't make it freeze, but 2nd time, yes.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.