x86/Hyperv: Fix check of return value from snp_set_vmsa()
PATCH 1/1 x86/Hyperv: Fix check of return value from snp_set_vmsa()
From: Tianyu Lan <[email protected]>
snp_set_vmsa() returns 0 as success result and so fix it.
--- arch/x86/hyperv/ivm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/hyperv/ivm.c +1 -1
@@ -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;
Signature · 1 line
2.25.1
From: Tianyu Lan <[email protected]> Sent: Thursday, March 13, 2025 1:52 AM
Quoted 24 lines
snp_set_vmsa()returns 0 as success result and so fix it.Fixes 44676bb9d566 ("x86/hyperv: Add smp support for SEV-SNP guest")Signed-off-by Tianyu Lan <[email protected]>--- arch/x86/hyperv/ivm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/x86/hyperv/ivm.c +1
-2@@ -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; --
Quoted 2 lines
2.25.1
Yes, with this change the code is now consistent with other call sites for snp_set_vmsa() and for direct invocation of rmpadjust().
Quoted 32 lines · Michael Kelley
From: Tianyu Lan <[email protected]> Sent: Thursday, March 13, 2025 1:52 AM
Quoted 24 lines
snp_set_vmsa()returns 0 as success result and so fix it.Fixes 44676bb9d566 ("x86/hyperv: Add smp support for SEV-SNP guest")Signed-off-by Tianyu Lan <[email protected]>--- arch/x86/hyperv/ivm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/x86/hyperv/ivm.c +1
-2@@ -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; --Quoted 2 lines
2.25.1
Yes, with this change the code is now consistent with other call sites for
snp_set_vmsa()and for direct invocation ofrmpadjust().
Quoted 1 line
Reviewed-by Michael Kelley <[email protected]>
Thank you for your review, Michael!
Signature · 2 lines
Thanks Tianyu Lan
Quoted 33 lines · Tianyu Lan
Quoted 32 lines · Michael Kelley
From: Tianyu Lan <[email protected]> Sent: Thursday, March 13, 2025 1:52 AM
Quoted 24 lines
snp_set_vmsa()returns 0 as success result and so fix it.Fixes 44676bb9d566 ("x86/hyperv: Add smp support for SEV-SNP guest")Signed-off-by Tianyu Lan <[email protected]>--- arch/x86/hyperv/ivm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/x86/hyperv/ivm.c +1
-2@@ -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; --Quoted 2 lines
2.25.1
Yes, with this change the code is now consistent with other call sites for
snp_set_vmsa()and for direct invocation ofrmpadjust().
Quoted 3 lines
Quoted 1 line
Reviewed-by Michael Kelley <[email protected]>Thank you for your review, Michael!
Applied to hyperv-next. Thanks.
Wei.