* [PATCH] x86/sev: Ensure SVSM reserved fields are initialized to zero
@ 2025-08-13 15:26 Tom Lendacky
2025-08-15 6:59 ` Joerg Roedel
2025-08-18 6:16 ` [sos-linux-ext-patches] " Nikunj A. Dadhania
0 siblings, 2 replies; 4+ messages in thread
From: Tom Lendacky @ 2025-08-13 15:26 UTC (permalink / raw)
To: linux-kernel, x86
Cc: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen,
Michael Roth, Joerg Roedel
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>
---
arch/x86/boot/startup/sev-shared.c | 1 +
arch/x86/coco/sev/core.c | 2 ++
2 files changed, 3 insertions(+)
diff --git a/arch/x86/boot/startup/sev-shared.c b/arch/x86/boot/startup/sev-shared.c
index ac7dfd21ddd4..a34cd19796f9 100644
--- a/arch/x86/boot/startup/sev-shared.c
+++ b/arch/x86/boot/startup/sev-shared.c
@@ -785,6 +785,7 @@ static void __head 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 */
diff --git a/arch/x86/coco/sev/core.c b/arch/x86/coco/sev/core.c
index 400a6ab75d45..14ef5908fb27 100644
--- a/arch/x86/coco/sev/core.c
+++ b/arch/x86/coco/sev/core.c
@@ -227,6 +227,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++;
@@ -257,6 +258,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++;
base-commit: 4c699535a3d483562354432a945a035f15dfceeb
--
2.46.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] x86/sev: Ensure SVSM reserved fields are initialized to zero
2025-08-13 15:26 [PATCH] x86/sev: Ensure SVSM reserved fields are initialized to zero Tom Lendacky
@ 2025-08-15 6:59 ` Joerg Roedel
2025-08-18 6:16 ` [sos-linux-ext-patches] " Nikunj A. Dadhania
1 sibling, 0 replies; 4+ messages in thread
From: Joerg Roedel @ 2025-08-15 6:59 UTC (permalink / raw)
To: Tom Lendacky
Cc: linux-kernel, x86, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
Dave Hansen, Michael Roth
On Wed, Aug 13, 2025 at 10:26:59AM -0500, Tom Lendacky wrote:
> 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>
Reviewed-by: Joerg Roedel <joerg.roedel@amd.com>
> ---
> arch/x86/boot/startup/sev-shared.c | 1 +
> arch/x86/coco/sev/core.c | 2 ++
> 2 files changed, 3 insertions(+)
>
> diff --git a/arch/x86/boot/startup/sev-shared.c b/arch/x86/boot/startup/sev-shared.c
> index ac7dfd21ddd4..a34cd19796f9 100644
> --- a/arch/x86/boot/startup/sev-shared.c
> +++ b/arch/x86/boot/startup/sev-shared.c
> @@ -785,6 +785,7 @@ static void __head 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 */
> diff --git a/arch/x86/coco/sev/core.c b/arch/x86/coco/sev/core.c
> index 400a6ab75d45..14ef5908fb27 100644
> --- a/arch/x86/coco/sev/core.c
> +++ b/arch/x86/coco/sev/core.c
> @@ -227,6 +227,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++;
> @@ -257,6 +258,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++;
>
> base-commit: 4c699535a3d483562354432a945a035f15dfceeb
> --
> 2.46.2
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [sos-linux-ext-patches] [PATCH] x86/sev: Ensure SVSM reserved fields are initialized to zero
2025-08-13 15:26 [PATCH] x86/sev: Ensure SVSM reserved fields are initialized to zero Tom Lendacky
2025-08-15 6:59 ` Joerg Roedel
@ 2025-08-18 6:16 ` Nikunj A. Dadhania
2025-08-18 13:47 ` Tom Lendacky
1 sibling, 1 reply; 4+ messages in thread
From: Nikunj A. Dadhania @ 2025-08-18 6:16 UTC (permalink / raw)
To: Tom Lendacky, linux-kernel, x86
Cc: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen,
Michael Roth, Joerg Roedel
On 8/13/2025 8:56 PM, Tom Lendacky wrote:
> 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
Does "an SVSM" mean here an implementation like Coconut SVSM ?
> 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>
> ---
> arch/x86/boot/startup/sev-shared.c | 1 +
> arch/x86/coco/sev/core.c | 2 ++
> 2 files changed, 3 insertions(+)
>
> diff --git a/arch/x86/boot/startup/sev-shared.c b/arch/x86/boot/startup/sev-shared.c
> index ac7dfd21ddd4..a34cd19796f9 100644
> --- a/arch/x86/boot/startup/sev-shared.c
> +++ b/arch/x86/boot/startup/sev-shared.c
> @@ -785,6 +785,7 @@ static void __head 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 */
> diff --git a/arch/x86/coco/sev/core.c b/arch/x86/coco/sev/core.c
> index 400a6ab75d45..14ef5908fb27 100644
> --- a/arch/x86/coco/sev/core.c
> +++ b/arch/x86/coco/sev/core.c
> @@ -227,6 +227,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++;
> @@ -257,6 +258,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++;
>
> base-commit: 4c699535a3d483562354432a945a035f15dfceeb
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [sos-linux-ext-patches] [PATCH] x86/sev: Ensure SVSM reserved fields are initialized to zero
2025-08-18 6:16 ` [sos-linux-ext-patches] " Nikunj A. Dadhania
@ 2025-08-18 13:47 ` Tom Lendacky
0 siblings, 0 replies; 4+ messages in thread
From: Tom Lendacky @ 2025-08-18 13:47 UTC (permalink / raw)
To: Nikunj A. Dadhania, linux-kernel, x86
Cc: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen,
Michael Roth, Joerg Roedel
On 8/18/25 01:16, Nikunj A. Dadhania wrote:
> On 8/13/2025 8:56 PM, Tom Lendacky wrote:
>
>> 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
>
> Does "an SVSM" mean here an implementation like Coconut SVSM ?
Yes.
Thanks,
Tom
>
>> 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>
>> ---
>> arch/x86/boot/startup/sev-shared.c | 1 +
>> arch/x86/coco/sev/core.c | 2 ++
>> 2 files changed, 3 insertions(+)
>>
>> diff --git a/arch/x86/boot/startup/sev-shared.c b/arch/x86/boot/startup/sev-shared.c
>> index ac7dfd21ddd4..a34cd19796f9 100644
>> --- a/arch/x86/boot/startup/sev-shared.c
>> +++ b/arch/x86/boot/startup/sev-shared.c
>> @@ -785,6 +785,7 @@ static void __head 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 */
>> diff --git a/arch/x86/coco/sev/core.c b/arch/x86/coco/sev/core.c
>> index 400a6ab75d45..14ef5908fb27 100644
>> --- a/arch/x86/coco/sev/core.c
>> +++ b/arch/x86/coco/sev/core.c
>> @@ -227,6 +227,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++;
>> @@ -257,6 +258,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++;
>>
>> base-commit: 4c699535a3d483562354432a945a035f15dfceeb
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-08-18 13:47 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-13 15:26 [PATCH] x86/sev: Ensure SVSM reserved fields are initialized to zero Tom Lendacky
2025-08-15 6:59 ` Joerg Roedel
2025-08-18 6:16 ` [sos-linux-ext-patches] " Nikunj A. Dadhania
2025-08-18 13:47 ` Tom Lendacky
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.