]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
x86/hyperv: Fix check of return value from snp_set_vmsa()
authorTianyu Lan <tiala@microsoft.com>
Thu, 13 Mar 2025 08:52:17 +0000 (04:52 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Apr 2025 12:37:41 +0000 (14:37 +0200)
commit e792d843aa3c9d039074cdce728d5803262e57a7 upstream.

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 <tiala@microsoft.com>
Reviewed-by: Michael Kelley <mhklinux@outlook.com>
Link: https://lore.kernel.org/r/20250313085217.45483-1-ltykernel@gmail.com
Signed-off-by: Wei Liu <wei.liu@kernel.org>
Message-ID: <20250313085217.45483-1-ltykernel@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/hyperv/ivm.c

index e50e43d1d4c87c6078fa66e875779b609366b340..87eabfcc1d1c2989bb202aec3bcf74aeb849a513 100644 (file)
@@ -338,7 +338,7 @@ int hv_snp_boot_ap(int 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;