Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cache size detection using cpuid #34484

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/coreclr/src/vm/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1604,7 +1604,7 @@ static size_t GetCacheSizeFromCpuId()

DWORD maxCpuId = getcpuid(0, buffer);

if (memcmp(buffer + 4, "GenuineIntel", 12) == 0)
if (memcmp(buffer + 4, "Genu" "ntel" "ineI" /* intentionally swapped */, 12) == 0)
{
/*
//The following lines are commented because the OS API on Windows 2003 SP1 is not returning the Cache Relation information on x86.
Expand Down Expand Up @@ -1648,7 +1648,7 @@ static size_t GetCacheSizeFromCpuId()
}
}
}
else if (memcmp(buffer + 4, "AuthenticAMD", 12) == 0)
else if (memcmp(buffer + 4, "Auth" "cAMD" "enti" /* intentionally swapped */, 12) == 0)
{
if (getcpuid(0x80000000, buffer) >= 0x80000006)
{
Expand Down