Cache QoS: fix for seting MSR

This commit is contained in:
SChernykh 2020-07-13 20:30:44 +02:00
parent c83429c55c
commit 72c385c870
2 changed files with 10 additions and 2 deletions

View file

@ -221,7 +221,10 @@ static bool wrmsr(const MsrItems& preset, const std::vector<CpuThread>& threads,
else {
// Disable L3 cache for Class Of Service 1
if (!wrmsr_on_cpu(0xC91, cpu, 0, MsrItem::kNoMask)) {
return false;
// Some CPUs don't let set it to all zeros
if (!wrmsr_on_cpu(0xC91, cpu, 1, MsrItem::kNoMask)) {
return false;
}
}
// Assign Class Of Service 1 to current CPU core

View file

@ -324,7 +324,12 @@ static bool wrmsr(const MsrItems &preset, const std::vector<CpuThread>& threads,
}
else {
// Disable L3 cache for Class Of Service 1
success &= wrmsr(driver, 0xC91, 0, MsrItem::kNoMask);
if (!wrmsr(driver, 0xC91, 0, MsrItem::kNoMask)) {
// Some CPUs don't let set it to all zeros
if (!wrmsr(driver, 0xC91, 1, MsrItem::kNoMask)) {
success = false;
}
}
// Assign Class Of Service 1 to current CPU core
success &= wrmsr(driver, 0xC8F, 1ULL << 32, MsrItem::kNoMask);