Re: [PULL 17/19] KVM: SEV: Provide support for SNP_GUEST_REQUEST NAE event

From: Paolo Bonzini
Date: Fri May 17 2024 - 18:01:22 EST


On 5/17/24 22:41, Edgecombe, Rick P wrote:
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;

I'll post a fully updated version tomorrow with all the pending fixes. Or today depending on the timezone.

Paolo