Skip to contentSkip to conversation

x86/mtrr: mask out keyid bits from variable mtrr mask register

RFC PATCH Thomas Gleixner 1 participant 1 message Nov 25, 2021 1 message not in the archive KVM

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): draft-87fsrkmy2c.ffs@tglx

#1 lore raw
Quoted 2 lines · Thomas Gleixner

Review

Quoted 2 lines
(quoted diff) +1 -0
+			if (boot_cpu_has(X86_FEATURE_TME)) {

cpu_feature_enabled() as Borislav pointed out several times already.

Quoted 11 lines
Quoted 11 lines
(quoted diff) +8 -0
+				u64 tme_activate;
+
+				rdmsrl(MSR_IA32_TME_ACTIVATE, tme_activate);
+				if (TME_ACTIVATE_LOCKED(tme_activate) &&
+				    TME_ACTIVATE_ENABLED(tme_activate)) {
+					phys_addr -= TME_ACTIVATE_KEYID_BITS(tme_activate);
+				}
+			}
 			size_or_mask = SIZE_OR_MASK_BITS(phys_addr);
 			size_and_mask = ~size_or_mask & 0xfffff00000ULL;
 		} else if (boot_cpu_data.x86_vendor == X86_VENDOR_CENTAUR &&