OcCpuLib: Fix crash when gathering system report on virtualised CPUs

closes acidanthera/bugtracker#2270
This commit is contained in:
vit9696 2023-05-07 17:47:06 +03:00
parent 47a3da4822
commit d25ec52b22
2 changed files with 9 additions and 0 deletions

View File

@ -17,6 +17,7 @@ OpenCore Changelog
- Updated build process to provide stable and bleeding-edge versions of `EnableGop`
- Implemented minor improvements in `PickerMode` `Apple`
- Improved filtering algorithm for `LogModules` option
- Fixed crash when gathering system report on virtualised CPUs
#### v0.9.1
- Fixed long comment printing for ACPI patches, thx @corpnewt

View File

@ -999,6 +999,14 @@ OcCpuGetMsrReport (
return;
}
//
// Hypervisors virtualise MSRs so the values are either not present
// and cause a crash or are irrelevant as they report placeholders.
//
if (CpuInfo->Hypervisor) {
return;
}
if (CpuInfo->CpuGeneration >= OcCpuGenerationNehalem) {
//
// MSR_PLATFORM_INFO