[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250810203643.GLaJkC2wtmxtvrPbeT@fat_crate.local>
Date: Sun, 10 Aug 2025 22:36:43 +0200
From: Borislav Petkov <bp@...en8.de>
To: Ard Biesheuvel <ardb+git@...gle.com>
Cc: linux-kernel@...r.kernel.org, linux-efi@...r.kernel.org, x86@...nel.org,
Ard Biesheuvel <ardb@...nel.org>, Ingo Molnar <mingo@...nel.org>,
Kevin Loughlin <kevinloughlin@...gle.com>,
Tom Lendacky <thomas.lendacky@....com>,
Josh Poimboeuf <jpoimboe@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Nikunj A Dadhania <nikunj@....com>
Subject: Re: [PATCH v6 08/22] x86/sev: Pass SVSM calling area down to early
page state change API
On Tue, Jul 22, 2025 at 09:27:17AM +0200, Ard Biesheuvel wrote:
> From: Ard Biesheuvel <ardb@...nel.org>
>
> The early page state change API is mostly only used very early, when
> only the boot time SVSM calling area is in use. However, this API is
> also called by the kexec finishing code, which runs very late, and
> potentially from a different CPU (which uses a different calling area).
>
> To avoid pulling the per-CPU SVSM calling area pointers and related SEV
> state into the startup code, refactor the page state change API so the
> SVSM calling area virtual and physical addresses can be provided by the
> caller.
>
> No functional change intended.
>
> Signed-off-by: Ard Biesheuvel <ardb@...nel.org>
> ---
> arch/x86/boot/compressed/sev.c | 12 +++++++++---
> arch/x86/boot/startup/sev-shared.c | 17 +++++++++--------
> arch/x86/boot/startup/sev-startup.c | 11 +++++++----
> arch/x86/coco/sev/core.c | 3 ++-
> arch/x86/include/asm/sev-internal.h | 3 ++-
> 5 files changed, 29 insertions(+), 17 deletions(-)
>
> diff --git a/arch/x86/boot/compressed/sev.c b/arch/x86/boot/compressed/sev.c
> index f714235d3222..18b0ccf517eb 100644
> --- a/arch/x86/boot/compressed/sev.c
> +++ b/arch/x86/boot/compressed/sev.c
> @@ -65,7 +65,9 @@ void snp_set_page_private(unsigned long paddr)
> if (!sev_snp_enabled())
> return;
>
> - __page_state_change(paddr, paddr, SNP_PAGE_STATE_PRIVATE);
> + __page_state_change(paddr, paddr, SNP_PAGE_STATE_PRIVATE,
> + (struct svsm_ca *)boot_svsm_caa_pa,
> + boot_svsm_caa_pa);
All those functions should probably get a
struct psc_desc *d;
where all those members are set to the current arguments so that we don't
marshall so many arguments back'n'forth.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
Powered by blists - more mailing lists