diff --git a/Changelog.md b/Changelog.md index 9eb00d2faa08d86b83b83f09e1954ff7892da51c..ebb46c316a7303a579ed0bd0232c2ec1de43ecb8 100644 --- a/Changelog.md +++ b/Changelog.md @@ -21,6 +21,7 @@ OpenCore Changelog - Added partial hotkey support to OpenCanopy (e.g. Ctrl+Enter) - Added builtin text renderer compatibility with Shell page mode - Fixed `FadtEnableReset` with too small FACP tables +- Fixed CPU detection crash with QEMU 5.0 and KVM accelerator #### v0.5.8 - Fixed invalid CPU object reference in SSDT-PLUG diff --git a/Library/OcCpuLib/OcCpuLib.c b/Library/OcCpuLib/OcCpuLib.c index 8489acb554baa944bfab7d33d936f39e3057c637..d98c7de883198026607ab4509607d276950f3617 100755 --- a/Library/OcCpuLib/OcCpuLib.c +++ b/Library/OcCpuLib/OcCpuLib.c @@ -300,9 +300,15 @@ ScanIntelProcessor ( return; } - if (Cpu->Model >= CPU_MODEL_SANDYBRIDGE) { + // + // Some virtual machines like QEMU 5.0 with KVM will fail to read this value. + // REF: https://github.com/acidanthera/bugtracker/issues/914 + // + if (Cpu->Model >= CPU_MODEL_SANDYBRIDGE && !Cpu->Hypervisor) { PkgCstConfigControl.Uint64 = AsmReadMsr64 (MSR_SANDY_BRIDGE_PKG_CST_CONFIG_CONTROL); Cpu->CstConfigLock = PkgCstConfigControl.Bits.CFGLock == 1; + } else { + Cpu->CstConfigLock = FALSE; } //