Re: [PATCH v1 1/8] x86/sev: Make SVSM calls preemption-safe
From: Borislav Petkov
Date: Mon Sep 21 2026 - 22:52:27 EST
On Thu, Sep 10, 2026 at 10:53:32AM +0200, Stefano Garzarella wrote:
> svsm_perform_call_protocol() is called also by svsm_pval_pages() and
> snp_issue_svsm_attest_req(). After this change call->caa is set
> unconditionally inside svsm_perform_call_protocol(), so the call->caa =
> svsm_get_caa() there becomes somewhat redundant.
Yeah, I believe Tom wanted here to be on the safe side and get the right caa,
even if we get moved to another CPU. And yeah, it is redundant but it is
a per-CPU access so meh, probably not that important.
But I guess a good cleanup ontop would be to remove all those svsm_get_caa()
calls from the callers and have that happen solely in
svsm_perform_call_protocol().
I guess Melody can do that ontop of this one after a proper audit of all call
sites and testing. Because the current fix should probably go to stable and we
would need the fix to be minimal.
> That said we can't just drop it though, so at most it could become a local
> variable. Probably not worth the churn, just wanted to point it out.
Yeah.
> That said, I agree that in those functions we don't have the issue since
> both of them are disabling irqs.
>
> Reviewed-by: Stefano Garzarella <sgarzare@xxxxxxxxxx>a
I'll add your tag to the latest version:
https://lore.kernel.org/r/a5bc0d4a2c462a0089109e145c21626b244b2ff0.1789345277.git.huibo.wang@xxxxxxx
Thx.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette