From: Linus Torvalds Date: Mon, 28 Aug 2023 22:28:54 +0000 (-0700) Subject: Merge tag 'x86_sev_for_v6.6_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git... X-Git-Tag: v6.6.17~4129 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f31f663fa943c88683777bb8481d2d5d74e426d0;p=platform%2Fkernel%2Flinux-rpi.git Merge tag 'x86_sev_for_v6.6_rc1' of git://git./linux/kernel/git/tip/tip Pull x86 SEV updates from Borislav Petkov: - Handle the case where the beginning virtual address of the address range whose SEV encryption status needs to change, is not page aligned so that callers which round up the number of pages to be decrypted, would mark a trailing page as decrypted and thus cause corruption during live migration. - Return an error from the #VC handler on AMD SEV-* guests when the debug registers swapping is enabled as a DR7 access should not happen then - that register is guest/host switched. * tag 'x86_sev_for_v6.6_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/sev: Make enc_dec_hypercall() accept a size instead of npages x86/sev: Do not handle #VC for DR7 read/write --- f31f663fa943c88683777bb8481d2d5d74e426d0 diff --cc arch/x86/boot/compressed/sev.c index 199155b8,e83e710..dc8c876 --- a/arch/x86/boot/compressed/sev.c +++ b/arch/x86/boot/compressed/sev.c @@@ -365,16 -365,8 +365,16 @@@ static void enforce_vmpl0(void * by the guest kernel. As and when a new feature is implemented in the * guest kernel, a corresponding bit should be added to the mask. */ - #define SNP_FEATURES_PRESENT (0) + #define SNP_FEATURES_PRESENT MSR_AMD64_SNP_DEBUG_SWAP +u64 snp_get_unsupported_features(u64 status) +{ + if (!(status & MSR_AMD64_SEV_SNP_ENABLED)) + return 0; + + return status & SNP_FEATURES_IMPL_REQ & ~SNP_FEATURES_PRESENT; +} + void snp_check_features(void) { u64 unsupported;