Patch "selftests: kvm: move declaration at the beginning of main()" has been added to the 6.1-stable tree

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

 



This is a note to let you know that I've just added the patch titled

    selftests: kvm: move declaration at the beginning of main()

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     selftests-kvm-move-declaration-at-the-beginning-of-m.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit fb6b943ac8df6a9a1ad1957000b01c7057d71d5e
Author: Paolo Bonzini <pbonzini@xxxxxxxxxx>
Date:   Sun Jan 22 04:04:50 2023 -0500

    selftests: kvm: move declaration at the beginning of main()
    
    [ Upstream commit 50aa870ba2f7735f556e52d15f61cd0f359c4c0b ]
    
    Placing a declaration of evt_reset is pedantically invalid
    according to the C standard.  While GCC does not really care
    and only warns with -Wpedantic, clang ignores the declaration
    altogether with an error:
    
    x86_64/xen_shinfo_test.c:965:2: error: expected expression
            struct kvm_xen_hvm_attr evt_reset = {
            ^
    x86_64/xen_shinfo_test.c:969:38: error: use of undeclared identifier evt_reset
            vm_ioctl(vm, KVM_XEN_HVM_SET_ATTR, &evt_reset);
                                                ^
    
    Reported-by: Yu Zhang <yu.c.zhang@xxxxxxxxxxxxxxx>
    Reported-by: Sean Christopherson <seanjc@xxxxxxxxxx>
    Fixes: a79b53aaaab5 ("KVM: x86: fix deadlock for KVM_XEN_EVTCHN_RESET", 2022-12-28)
    Signed-off-by: Paolo Bonzini <pbonzini@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/tools/testing/selftests/kvm/x86_64/xen_shinfo_test.c b/tools/testing/selftests/kvm/x86_64/xen_shinfo_test.c
index 8383457e66990..0668ec542cccd 100644
--- a/tools/testing/selftests/kvm/x86_64/xen_shinfo_test.c
+++ b/tools/testing/selftests/kvm/x86_64/xen_shinfo_test.c
@@ -428,6 +428,7 @@ static void *juggle_shinfo_state(void *arg)
 int main(int argc, char *argv[])
 {
 	struct timespec min_ts, max_ts, vm_ts;
+	struct kvm_xen_hvm_attr evt_reset;
 	struct kvm_vm *vm;
 	pthread_t thread;
 	bool verbose;
@@ -942,10 +943,8 @@ int main(int argc, char *argv[])
 	}
 
  done:
-	struct kvm_xen_hvm_attr evt_reset = {
-		.type = KVM_XEN_ATTR_TYPE_EVTCHN,
-		.u.evtchn.flags = KVM_XEN_EVTCHN_RESET,
-	};
+	evt_reset.type = KVM_XEN_ATTR_TYPE_EVTCHN;
+	evt_reset.u.evtchn.flags = KVM_XEN_EVTCHN_RESET;
 	vm_ioctl(vm, KVM_XEN_HVM_SET_ATTR, &evt_reset);
 
 	alarm(0);



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux