History

x86/sev: Ensure SVSM reserved fields in a page validation entry are initialized to zero

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.

Tom Lendacky committed 1 year ago

Commit 3ee9ceb1 parent c08ba632 files · +3 −0Browse files

Unified · Split

2 files
  1. arch/x86/boot/startup/sev-shared.c +1 −0
  2. arch/x86/coco/sev/core.c +2 −0
arch/x86/boot/startup/sev-shared.c+1−0
@@ -785,6 +785,7 @@ static void __head svsm_pval_4k_page(unsigned long paddr, bool validate) · 784 unmodified lines
785 pc->entry[0].page_size = RMP_PG_SIZE_4K;785 pc->entry[0].page_size = RMP_PG_SIZE_4K;
786 pc->entry[0].action = validate;786 pc->entry[0].action = validate;
787 pc->entry[0].ignore_cf = 0;787 pc->entry[0].ignore_cf = 0;
788 pc->entry[0].rsvd = 0;
788 pc->entry[0].pfn = paddr >> PAGE_SHIFT;789 pc->entry[0].pfn = paddr >> PAGE_SHIFT;
789 790
790 /* Protocol 0, Call ID 1 */791 /* Protocol 0, Call ID 1 */
arch/x86/coco/sev/core.c+2−0
@@ -227,6 +227,7 @@ static u64 svsm_build_ca_from_pfn_range(u64 pfn, u64 pfn_end, bool action, · 226 unmodified lines
227 pe->page_size = RMP_PG_SIZE_4K;227 pe->page_size = RMP_PG_SIZE_4K;
228 pe->action = action;228 pe->action = action;
229 pe->ignore_cf = 0;229 pe->ignore_cf = 0;
230 pe->rsvd = 0;
230 pe->pfn = pfn;231 pe->pfn = pfn;
231 232
232 pe++;233 pe++;
@@ -257,6 +258,7 @@ static int svsm_build_ca_from_psc_desc(struct snp_psc_desc *desc, unsigned int d · 24 unmodified lines
257 pe->page_size = e->pagesize ? RMP_PG_SIZE_2M : RMP_PG_SIZE_4K;258 pe->page_size = e->pagesize ? RMP_PG_SIZE_2M : RMP_PG_SIZE_4K;
258 pe->action = e->operation == SNP_PAGE_STATE_PRIVATE;259 pe->action = e->operation == SNP_PAGE_STATE_PRIVATE;
259 pe->ignore_cf = 0;260 pe->ignore_cf = 0;
261 pe->rsvd = 0;
260 pe->pfn = e->gfn;262 pe->pfn = e->gfn;
261 263
262 pe++;264 pe++;