]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
x86/sev: Ensure SVSM reserved fields in a page validation entry are initialized to...
authorTom Lendacky <thomas.lendacky@amd.com>
Wed, 13 Aug 2025 15:26:59 +0000 (10:26 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Aug 2025 14:31:03 +0000 (16:31 +0200)
commit 3ee9cebd0a5e7ea47eb35cec95eaa1a866af982d upstream.

In order to support future versions of the SVSM_CORE_PVALIDATE call, all
reserved fields within a PVALIDATE entry must be set to zero as an SVSM should
be ensuring all reserved fields are zero in order to support future usage of
reserved areas based on the protocol version.

Fixes: fcd042e86422 ("x86/sev: Perform PVALIDATE using the SVSM when not at VMPL0")
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Joerg Roedel <joerg.roedel@amd.com>
Cc: <stable@kernel.org>
Link: https://lore.kernel.org/7cde412f8b057ea13a646fb166b1ca023f6a5031.1755098819.git.thomas.lendacky@amd.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/coco/sev/shared.c

index f5936da235c71352d0a70912ec2b66bc45fd4827..16b799f37d6cb49e6ccb029a84fe8ad870c0d9b8 100644 (file)
@@ -1285,6 +1285,7 @@ static void svsm_pval_4k_page(unsigned long paddr, bool validate)
        pc->entry[0].page_size = RMP_PG_SIZE_4K;
        pc->entry[0].action    = validate;
        pc->entry[0].ignore_cf = 0;
+       pc->entry[0].rsvd      = 0;
        pc->entry[0].pfn       = paddr >> PAGE_SHIFT;
 
        /* Protocol 0, Call ID 1 */
@@ -1373,6 +1374,7 @@ static u64 svsm_build_ca_from_pfn_range(u64 pfn, u64 pfn_end, bool action,
                pe->page_size = RMP_PG_SIZE_4K;
                pe->action    = action;
                pe->ignore_cf = 0;
+               pe->rsvd      = 0;
                pe->pfn       = pfn;
 
                pe++;
@@ -1403,6 +1405,7 @@ static int svsm_build_ca_from_psc_desc(struct snp_psc_desc *desc, unsigned int d
                pe->page_size = e->pagesize ? RMP_PG_SIZE_2M : RMP_PG_SIZE_4K;
                pe->action    = e->operation == SNP_PAGE_STATE_PRIVATE;
                pe->ignore_cf = 0;
+               pe->rsvd      = 0;
                pe->pfn       = e->gfn;
 
                pe++;