1
linux/arch/x86/kernel/cpu/mtrr
Sean Christopherson e7e80b66fb x86/cpu: KVM: Add common defines for architectural memory types (PAT, MTRRs, etc.)
Add defines for the architectural memory types that can be shoved into
various MSRs and registers, e.g. MTRRs, PAT, VMX capabilities MSRs, EPTPs,
etc.  While most MSRs/registers support only a subset of all memory types,
the values themselves are architectural and identical across all users.

Leave the goofy MTRR_TYPE_* definitions as-is since they are in a uapi
header, but add compile-time assertions to connect the dots (and sanity
check that the msr-index.h values didn't get fat-fingered).

Keep the VMX_EPTP_MT_* defines so that it's slightly more obvious that the
EPTP holds a single memory type in 3 of its 64 bits; those bits just
happen to be 2:0, i.e. don't need to be shifted.

Opportunistically use X86_MEMTYPE_WB instead of an open coded '6' in
setup_vmcs_config().

No functional change intended.

Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Kai Huang <kai.huang@intel.com>
Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com>
Reviewed-by: Kai Huang <kai.huang@intel.com>
Link: https://lore.kernel.org/r/20240605231918.2915961-2-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
2024-08-22 11:25:46 -07:00
..
amd.c
centaur.c
cleanup.c x86/mtrr: Unify debugging printing 2023-06-01 15:04:33 +02:00
cyrix.c
generic.c x86/CPU/AMD: Track SNP host status with cc_platform_*() 2024-04-04 10:40:30 +02:00
if.c
legacy.c
Makefile
mtrr.c x86/cpu: KVM: Add common defines for architectural memory types (PAT, MTRRs, etc.) 2024-08-22 11:25:46 -07:00
mtrr.h x86/mtrr: Unify debugging printing 2023-06-01 15:04:33 +02:00