x86/hyperv: Set MTRR state when running as SEV-SNP Hyper-V guest
authorJuergen Gross <jgross@suse.com>
Tue, 2 May 2023 12:09:19 +0000 (14:09 +0200)
committerBorislav Petkov (AMD) <bp@alien8.de>
Thu, 1 Jun 2023 13:04:32 +0000 (15:04 +0200)
commitc957f1f3c498bcce85c04e92e60afbae1fd10cde
tree41acc9b90b0678be4e98a5329f97ee41d83cf196
parent29055dc74287467bd7a053d60b4afe753832960d
x86/hyperv: Set MTRR state when running as SEV-SNP Hyper-V guest

In order to avoid mappings using the UC- cache attribute, set the
MTRR state to use WB caching as the default.

This is needed in order to cope with the fact that PAT is enabled,
while MTRRs are not supported by the hypervisor.

Fixes: 90b926e68f50 ("x86/pat: Fix pat_x_mtrr_type() for MTRR disabled case")
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Tested-by: Michael Kelley <mikelley@microsoft.com>
Link: https://lore.kernel.org/r/20230502120931.20719-5-jgross@suse.com
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
arch/x86/hyperv/ivm.c