Re: [PATCH] x86/Hyperv: Fix check of return value from snp_set_vmsa()
From: Wei Liu <wei.liu@kernel.org>
Date: 2025-03-14 17:41:58
Also in:
lkml, stable
From: Wei Liu <wei.liu@kernel.org>
Date: 2025-03-14 17:41:58
Also in:
lkml, stable
On Fri, Mar 14, 2025 at 09:41:30AM +0800, Tianyu Lan wrote:
On Fri, Mar 14, 2025 at 4:20 AM Michael Kelley [off-list ref] wrote:quoted
From: Tianyu Lan <redacted> Sent: Thursday, March 13, 2025 1:52 AMquoted
snp_set_vmsa() returns 0 as success result and so fix it. Cc: stable@vger.kernel.org Fixes: 44676bb9d566 ("x86/hyperv: Add smp support for SEV-SNP guest") Signed-off-by: Tianyu Lan <redacted> --- arch/x86/hyperv/ivm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)diff --git a/arch/x86/hyperv/ivm.c b/arch/x86/hyperv/ivm.c index ec7880271cf9..77bf05f06b9e 100644 --- a/arch/x86/hyperv/ivm.c +++ b/arch/x86/hyperv/ivm.c@@ -338,7 +338,7 @@ int hv_snp_boot_ap(u32 cpu, unsigned long start_ip) vmsa->sev_features = sev_status >> 2; ret = snp_set_vmsa(vmsa, true); - if (!ret) { + if (ret) { pr_err("RMPADJUST(%llx) failed: %llx\n", (u64)vmsa, ret); free_page((u64)vmsa); return ret; --2.25.1Yes, with this change the code is now consistent with other call sites for snp_set_vmsa() and for direct invocation of rmpadjust(). Reviewed-by: Michael Kelley <redacted>Thank you for your review, Michael!
Applied to hyperv-next. Thanks. Wei.