Re: [PATCH v16 4/5] x86/sev: Perform RMP optimizations asynchronously

From: Borislav Petkov

Date: Fri Sep 18 2026 - 19:40:24 EST


On Fri, Sep 18, 2026 at 05:46:00PM -0500, Kalra, Ashish wrote:
> Looks good.

Thx.

> One comment here, i originally had pr_info_once() for printing this once during SNP init,
> if you change it to pr_info(), it will get printed again at every SNP guest teardown too,
> i am fine with it and actually it keeps the user aware that RMPOPT optimizations are
> being re-applied/re-enabled, but there may be just too many kernel messages dumped.

Yeah, I had the exact same internal conflict :)

I guess we should do the below instead. This tells us that all the necessary
stuff needed for RMP optimizations has been set up and we can assume that
those optimizations will happen from now on.

We can later add some more non-screaming reporting to user - ratelimited or
whatnot - which gives more info.

But let's do that when we cross that bridge and we decide that they're
actually necessary.

Thx.

--

diff --git a/arch/x86/virt/svm/sev.c b/arch/x86/virt/svm/sev.c
index afa5f78808fe..bd70c4d0b774 100644
--- a/arch/x86/virt/svm/sev.c
+++ b/arch/x86/virt/svm/sev.c
@@ -656,6 +656,8 @@ static int __init rmpopt_init(void)
if ((rmpopt_pa_end - rmpopt_pa_start) > SZ_2T)
rmpopt_pa_end = rmpopt_pa_start + SZ_2T;

+ pr_info("RMPOPT optimizations enabled\n");
+
rmpopt_soft_init = true;

return 0;
@@ -688,8 +690,6 @@ void snp_enable_rmpopt(void)

mod_delayed_work(rmpopt_wq, &rmpopt_delayed_work,
msecs_to_jiffies(RMPOPT_WORK_TIMEOUT));
-
- pr_info("RMPOPT optimizations enabled\n");
}
EXPORT_SYMBOL_FOR_MODULES(snp_enable_rmpopt, "ccp,kvm-amd");

--
Regards/Gruss,
Boris.

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