[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <96cf4b4929f489f291b3ae8385bb3527cbdf9400.camel@intel.com>
Date: Fri, 17 May 2024 20:41:26 +0000
From: "Edgecombe, Rick P" <rick.p.edgecombe@...el.com>
To: "pbonzini@...hat.com" <pbonzini@...hat.com>, "michael.roth@....com"
<michael.roth@....com>
CC: "aik@....com" <aik@....com>, "kvm@...r.kernel.org" <kvm@...r.kernel.org>,
"ashish.kalra@....com" <ashish.kalra@....com>, "thomas.lendacky@....com"
<thomas.lendacky@....com>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>, "seanjc@...gle.com" <seanjc@...gle.com>,
"brijesh.singh@....com" <brijesh.singh@....com>
Subject: Re: [PULL 17/19] KVM: SEV: Provide support for SNP_GUEST_REQUEST NAE
event
On Fri, 2024-05-10 at 16:10 -0500, Michael Roth wrote:
> +
> +static int __snp_handle_guest_req(struct kvm *kvm, gpa_t req_gpa, gpa_t
> resp_gpa,
> + sev_ret_code *fw_err)
> +{
> + struct sev_data_snp_guest_request data = {0};
> + struct kvm_sev_info *sev;
> + int ret;
> +
> + if (!sev_snp_guest(kvm))
> + return -EINVAL;
> +
> + sev = &to_kvm_svm(kvm)->sev_info;
> +
> + ret = snp_setup_guest_buf(kvm, &data, req_gpa, resp_gpa);
> + if (ret)
> + return ret;
> +
> + ret = sev_issue_cmd(kvm, SEV_CMD_SNP_GUEST_REQUEST, &data, fw_err);
> + if (ret)
> + return ret;
> +
> + ret = snp_cleanup_guest_buf(&data);
> + if (ret)
> + return ret;
> +
> + return 0;
> +}
I get a build error in kvm-coco-queue with W=1:
arch/x86/kvm/svm/sev.c: In function ‘__snp_handle_guest_req’:
arch/x86/kvm/svm/sev.c:3968:30: error: variable ‘sev’ set but not used [-
Werror=unused-but-set-variable]
3968 | struct kvm_sev_info *sev;
| ^~~
cc1: all warnings being treated as errors
To fix it:
diff --git a/arch/x86/kvm/svm/sev.c b/arch/x86/kvm/svm/sev.c
index 57c2c8025547..6beaa6d42de9 100644
--- a/arch/x86/kvm/svm/sev.c
+++ b/arch/x86/kvm/svm/sev.c
@@ -3965,14 +3965,11 @@ static int __snp_handle_guest_req(struct kvm *kvm, gpa_t
req_gpa, gpa_t resp_gpa
sev_ret_code *fw_err)
{
struct sev_data_snp_guest_request data = {0};
- struct kvm_sev_info *sev;
int ret;
if (!sev_snp_guest(kvm))
return -EINVAL;
- sev = &to_kvm_svm(kvm)->sev_info;
-
ret = snp_setup_guest_buf(kvm, &data, req_gpa, resp_gpa);
if (ret)
return ret;
Powered by blists - more mailing lists