]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob
ca35874aaf946d59b6951c1b03e758d1978aa040
[thirdparty/kernel/stable-queue.git] /
1 From 3ee9cebd0a5e7ea47eb35cec95eaa1a866af982d Mon Sep 17 00:00:00 2001
2 From: Tom Lendacky <thomas.lendacky@amd.com>
3 Date: Wed, 13 Aug 2025 10:26:59 -0500
4 Subject: x86/sev: Ensure SVSM reserved fields in a page validation entry are initialized to zero
5
6 From: Tom Lendacky <thomas.lendacky@amd.com>
7
8 commit 3ee9cebd0a5e7ea47eb35cec95eaa1a866af982d upstream.
9
10 In order to support future versions of the SVSM_CORE_PVALIDATE call, all
11 reserved fields within a PVALIDATE entry must be set to zero as an SVSM should
12 be ensuring all reserved fields are zero in order to support future usage of
13 reserved areas based on the protocol version.
14
15 Fixes: fcd042e86422 ("x86/sev: Perform PVALIDATE using the SVSM when not at VMPL0")
16 Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
17 Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
18 Reviewed-by: Joerg Roedel <joerg.roedel@amd.com>
19 Cc: <stable@kernel.org>
20 Link: https://lore.kernel.org/7cde412f8b057ea13a646fb166b1ca023f6a5031.1755098819.git.thomas.lendacky@amd.com
21 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 ---
23 arch/x86/boot/startup/sev-shared.c | 1 +
24 arch/x86/coco/sev/core.c | 2 ++
25 2 files changed, 3 insertions(+)
26
27 --- a/arch/x86/boot/startup/sev-shared.c
28 +++ b/arch/x86/boot/startup/sev-shared.c
29 @@ -785,6 +785,7 @@ static void __head svsm_pval_4k_page(uns
30 pc->entry[0].page_size = RMP_PG_SIZE_4K;
31 pc->entry[0].action = validate;
32 pc->entry[0].ignore_cf = 0;
33 + pc->entry[0].rsvd = 0;
34 pc->entry[0].pfn = paddr >> PAGE_SHIFT;
35
36 /* Protocol 0, Call ID 1 */
37 --- a/arch/x86/coco/sev/core.c
38 +++ b/arch/x86/coco/sev/core.c
39 @@ -227,6 +227,7 @@ static u64 svsm_build_ca_from_pfn_range(
40 pe->page_size = RMP_PG_SIZE_4K;
41 pe->action = action;
42 pe->ignore_cf = 0;
43 + pe->rsvd = 0;
44 pe->pfn = pfn;
45
46 pe++;
47 @@ -257,6 +258,7 @@ static int svsm_build_ca_from_psc_desc(s
48 pe->page_size = e->pagesize ? RMP_PG_SIZE_2M : RMP_PG_SIZE_4K;
49 pe->action = e->operation == SNP_PAGE_STATE_PRIVATE;
50 pe->ignore_cf = 0;
51 + pe->rsvd = 0;
52 pe->pfn = e->gfn;
53
54 pe++;