]> Git Repo - linux.git/commit
x86/cpu: KVM: Add common defines for architectural memory types (PAT, MTRRs, etc.)
authorSean Christopherson <[email protected]>
Wed, 5 Jun 2024 23:19:09 +0000 (16:19 -0700)
committerSean Christopherson <[email protected]>
Thu, 22 Aug 2024 18:25:46 +0000 (11:25 -0700)
commite7e80b66fb242a63cdfc3d3534cff62a5e293185
tree40dae073b263f92a0cfb2090123dce5c35fe4361
parent47ac09b91befbb6a235ab620c32af719f8208399
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 <[email protected]>
Acked-by: Kai Huang <[email protected]>
Reviewed-by: Xiaoyao Li <[email protected]>
Reviewed-by: Kai Huang <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Sean Christopherson <[email protected]>
arch/x86/include/asm/msr-index.h
arch/x86/include/asm/vmx.h
arch/x86/kernel/cpu/mtrr/mtrr.c
arch/x86/kvm/vmx/nested.c
arch/x86/kvm/vmx/vmx.c
arch/x86/mm/pat/memtype.c
This page took 0.061416 seconds and 4 git commands to generate.