Re: [PATCH v2 04/10] x86/snp: Create a function to clear/zero the RMP

From: Borislav Petkov

Date: Fri Mar 13 2026 - 12:21:58 EST


On Mon, Mar 09, 2026 at 12:00:46PM -0600, Tycho Andersen wrote:
> From: Tom Lendacky <thomas.lendacky@xxxxxxx>
>
> In prep for delayed SNP initialization and disablement on shutdown, create
> a function, snp_clear_rmp(), that clears the RMP bookkeeping area and the
> RMP entries.
>
> Signed-off-by: Tom Lendacky <thomas.lendacky@xxxxxxx>
> Signed-off-by: Tycho Andersen (AMD) <tycho@xxxxxxxxxx>
> ---
> arch/x86/virt/svm/sev.c | 41 +++++++++++++++++++++++++++--------------
> 1 file changed, 27 insertions(+), 14 deletions(-)
>
> diff --git a/arch/x86/virt/svm/sev.c b/arch/x86/virt/svm/sev.c
> index e35fac0a8a3d..f41b92e40014 100644
> --- a/arch/x86/virt/svm/sev.c
> +++ b/arch/x86/virt/svm/sev.c
> @@ -242,6 +242,32 @@ void __init snp_fixup_e820_tables(void)
> }
> }
>
> +static void snp_clear_rmp(void)

No need for "snp_" prefix on static functions.

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette