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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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;





[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux