Skip to content

Commit

Permalink
OcCpuLib: Fix crash when gathering system report on virtualised CPUs
Browse files Browse the repository at this point in the history
  • Loading branch information
vit9696 committed May 7, 2023
1 parent 47a3da4 commit d25ec52
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions Library/OcCpuLib/OcCpuLib.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d25ec52

Please sign in to comment.