Skip to content

Commit

Permalink
by pass x86 validate only and don't bother with patching cpu fsb and …
Browse files Browse the repository at this point in the history
…other info
  • Loading branch information
Peter Pham authored and Peter Pham committed Nov 15, 2021
1 parent f2bc242 commit 83727c5
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Library/OcAppleKernelLib/CpuidPatches.c
Expand Up @@ -952,7 +952,7 @@ mProvideCurrentCpuInfoTopologyValidationPatch = {
// Offset of value in below patch.
#define CURRENT_CPU_INFO_CORE_COUNT_OFFSET 1

STATIC
/*STATIC
UINT8
mProvideCurrentCpuInfoZeroMsrThreadCoreCountFind[] = {
// mov ecx, 0x10001
Expand All @@ -965,7 +965,9 @@ mProvideCurrentCpuInfoZeroMsrThreadCoreCountReplace[] = {
// mov ecx, core/thread count
0xB9, 0x00, 0x00, 0x00, 0x00
};
*/

/*
STATIC
PATCHER_GENERIC_PATCH
mProvideCurrentCpuInfoZeroMsrThreadCoreCountPatch = {
Expand Down Expand Up @@ -1050,6 +1052,7 @@ UINT8* PatchMovVar (
return Location;
}
*/

EFI_STATUS
PatchProvideCurrentCpuInfo (
Expand All @@ -1061,7 +1064,7 @@ PatchProvideCurrentCpuInfo (
EFI_STATUS Status;

UINT8 *Start;
MACH_SECTION_ANY *DataSection;
/*MACH_SECTION_ANY *DataSection;
MACH_SECTION_ANY *TextSection;
INT32 Delta;
Expand Down Expand Up @@ -1092,12 +1095,13 @@ PatchProvideCurrentCpuInfo (
UINT64 tscGranularityValue;
UINT32 msrCoreThreadCount;
*/

ASSERT (Patcher != NULL);

Start = ((UINT8 *) MachoGetMachHeader (&Patcher->MachContext));

//
/* //
// 10.6 and below has variables in __DATA/__data instead of __DATA/__common
//
if (OcMatchDarwinVersion (KernelVersion, KERNEL_VERSION_LION_MIN, 0)) {
Expand Down Expand Up @@ -1235,6 +1239,7 @@ PatchProvideCurrentCpuInfo (
} else {
DEBUG ((DEBUG_INFO, "OCAK: Skipping CPU MSR 0x35 default value patch on %u\n", KernelVersion));
}
*/

//
// Disable _x86_validate_topology on 10.13 and above.
Expand Down

0 comments on commit 83727c5

Please sign in to comment.