]> www.infradead.org Git - users/dwmw2/linux.git/commit
x86/kvm: Override default caching mode for SEV-SNP and TDX
authorKirill A. Shutemov <kirill.shutemov@linux.intel.com>
Tue, 15 Oct 2024 09:58:17 +0000 (12:58 +0300)
committerPaolo Bonzini <pbonzini@redhat.com>
Sun, 20 Oct 2024 11:07:02 +0000 (07:07 -0400)
commit8e690b817e38769dc2fa0e7473e5a5dc1fc25795
treebbe51d126b176306c2f51dba5520354cea20a058
parentbc07eea2f3b330127242df2e0ec2d6cd16b4f2e8
x86/kvm: Override default caching mode for SEV-SNP and TDX

AMD SEV-SNP and Intel TDX have limited access to MTRR: either it is not
advertised in CPUID or it cannot be programmed (on TDX, due to #VE on
CR0.CD clear).

This results in guests using uncached mappings where it shouldn't and
pmd/pud_set_huge() failures due to non-uniform memory type reported by
mtrr_type_lookup().

Override MTRR state, making it WB by default as the kernel does for
Hyper-V guests.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Suggested-by: Binbin Wu <binbin.wu@intel.com>
Cc: Juergen Gross <jgross@suse.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Message-ID: <20241015095818.357915-1-kirill.shutemov@linux.intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kernel/kvm.c