bisecting fixing commit since 144c79ef33536b4ecb4951e07dbc1f2b7fa99d32 building syzkaller on 09fbf400324c9aea14031e516d36e905b629b639 testing commit 144c79ef33536b4ecb4951e07dbc1f2b7fa99d32 with gcc (GCC) 10.2.1 20210217 kernel signature: 591e2487f2803c55fedb6b121f8499cf161f00a62fec96d0564236b99eb47d8c run #0: crashed: possible deadlock in io_sq_thread_finish run #1: crashed: KASAN: use-after-free Read in io_sq_thread run #2: crashed: possible deadlock in io_sq_thread_finish run #3: crashed: possible deadlock in io_sq_thread_finish run #4: crashed: KFENCE: use-after-free in io_sq_thread run #5: crashed: possible deadlock in io_sq_thread_finish run #6: crashed: possible deadlock in io_sq_thread_finish run #7: crashed: possible deadlock in io_sq_thread_finish run #8: crashed: KASAN: use-after-free Read in io_sq_thread run #9: crashed: KASAN: use-after-free Read in io_sq_thread run #10: crashed: KASAN: use-after-free Read in io_sq_thread run #11: crashed: possible deadlock in io_sq_thread_finish run #12: crashed: possible deadlock in io_sq_thread_finish run #13: crashed: KASAN: use-after-free Read in io_sq_thread run #14: crashed: possible deadlock in io_sq_thread_finish run #15: crashed: KASAN: use-after-free Read in io_sq_thread run #16: crashed: possible deadlock in io_sq_thread_finish run #17: crashed: possible deadlock in io_sq_thread_finish run #18: boot failed: WARNING in kvm_wait run #19: boot failed: WARNING in kvm_wait testing current HEAD 454859c552da78b0f587205d308401922b56863e testing commit 454859c552da78b0f587205d308401922b56863e with gcc (GCC) 10.2.1 20210217 kernel signature: 80b9502335e41f6ee82882417b96e6771d15f9dd1c60f085f9ff2023ff693f30 all runs: OK # git bisect start 454859c552da78b0f587205d308401922b56863e 144c79ef33536b4ecb4951e07dbc1f2b7fa99d32 Bisecting: 769 revisions left to test after this (roughly 10 steps) [0ada2dad8bf39857f25e6ecbf68bb1664ca1ee5b] Merge tag 'io_uring-5.12-2021-03-19' of git://git.kernel.dk/linux-block testing commit 0ada2dad8bf39857f25e6ecbf68bb1664ca1ee5b with gcc (GCC) 10.2.1 20210217 kernel signature: 6c1f66d9c3a41db669103d4937363f2de257510c0268bca1fa39e8c1f1556682 all runs: OK # git bisect bad 0ada2dad8bf39857f25e6ecbf68bb1664ca1ee5b Bisecting: 394 revisions left to test after this (roughly 9 steps) [9278be92f22979a026a68206e226722138c9443d] Merge tag 'io_uring-5.12-2021-03-12' of git://git.kernel.dk/linux-block testing commit 9278be92f22979a026a68206e226722138c9443d with gcc (GCC) 10.2.1 20210217 kernel signature: fbb773900daa8a2b2b104745de59a31e82894d2108caa5eecc8896bfc49dfa9b run #0: crashed: WARNING in kvm_wait run #1: crashed: WARNING in kvm_wait run #2: crashed: WARNING in kvm_wait run #3: crashed: WARNING in kvm_wait run #4: crashed: WARNING in kvm_wait run #5: crashed: WARNING in kvm_wait run #6: crashed: WARNING in kvm_wait run #7: OK run #8: OK run #9: OK # git bisect good 9278be92f22979a026a68206e226722138c9443d Bisecting: 195 revisions left to test after this (roughly 8 steps) [75013c6c52d80b2255ba273eedac013d58754b02] Merge tag 'perf_urgent_for_v5.12-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip testing commit 75013c6c52d80b2255ba273eedac013d58754b02 with gcc (GCC) 10.2.1 20210217 kernel signature: 60785947980d69924f2dd519d0180f5c26c5310745e1d28a4a09fda0f3f95e58 run #0: crashed: WARNING in kvm_wait run #1: crashed: WARNING in kvm_wait run #2: crashed: WARNING in kvm_wait run #3: crashed: WARNING in kvm_wait run #4: crashed: WARNING in kvm_wait run #5: crashed: WARNING in kvm_wait run #6: crashed: WARNING in kvm_wait run #7: crashed: WARNING in kvm_wait run #8: boot failed: WARNING in kvm_wait run #9: boot failed: WARNING in kvm_wait # git bisect good 75013c6c52d80b2255ba273eedac013d58754b02 Bisecting: 100 revisions left to test after this (roughly 7 steps) [8b12a62a4e3ed4ae99c715034f557eb391d6b196] Merge tag 'drm-fixes-2021-03-19' of git://anongit.freedesktop.org/drm/drm testing commit 8b12a62a4e3ed4ae99c715034f557eb391d6b196 with gcc (GCC) 10.2.1 20210217 kernel signature: e75c3173f764e2fde7057aba021ebdab0d6f5e77b3985f0aeaad239a5541f228 all runs: crashed: WARNING in kvm_wait # git bisect good 8b12a62a4e3ed4ae99c715034f557eb391d6b196 Bisecting: 50 revisions left to test after this (roughly 6 steps) [50b1affc891cbc103a2334ce909a026e25f4c84d] ALSA: usb-audio: Fix unintentional sign extension issue testing commit 50b1affc891cbc103a2334ce909a026e25f4c84d with gcc (GCC) 10.2.1 20210217 kernel signature: a559cc60f6f24abeb03756021f8c32fec21737d4782dacedd966e5853b1cfa7d run #0: crashed: KASAN: use-after-free Read in io_sq_thread run #1: crashed: possible deadlock in io_sq_thread_finish run #2: crashed: possible deadlock in io_sq_thread_finish run #3: crashed: KASAN: use-after-free Read in io_sq_thread run #4: crashed: possible deadlock in io_sq_thread_finish run #5: crashed: KASAN: use-after-free Read in io_sq_thread run #6: crashed: possible deadlock in io_sq_thread_finish run #7: crashed: KASAN: use-after-free Read in io_sq_thread run #8: crashed: possible deadlock in io_sq_thread_finish run #9: crashed: possible deadlock in io_sq_thread_finish # git bisect good 50b1affc891cbc103a2334ce909a026e25f4c84d Bisecting: 31 revisions left to test after this (roughly 5 steps) [3149860dc717e8dd339d89d17ebe615cb09e158b] Merge tag 'gpio-fixes-for-v5.12-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux testing commit 3149860dc717e8dd339d89d17ebe615cb09e158b with gcc (GCC) 10.2.1 20210217 kernel signature: 850a4458798feafce0ef076e1536d0ecf1671aabf1b991a131fb19dbc92400fb run #0: crashed: WARNING in kvm_wait run #1: crashed: WARNING in kvm_wait run #2: crashed: WARNING in kvm_wait run #3: crashed: WARNING in kvm_wait run #4: crashed: WARNING in kvm_wait run #5: crashed: WARNING in kvm_wait run #6: crashed: WARNING in kvm_wait run #7: crashed: WARNING in kvm_wait run #8: crashed: WARNING in kvm_wait run #9: OK # git bisect good 3149860dc717e8dd339d89d17ebe615cb09e158b Bisecting: 15 revisions left to test after this (roughly 4 steps) [9ce3746d64132a561bceab6421715e7c04e85074] documentation/kvm: additional explanations on KVM_SET_BOOT_CPU_ID testing commit 9ce3746d64132a561bceab6421715e7c04e85074 with gcc (GCC) 10.2.1 20210217 kernel signature: fd2bd213b6532b5f666e4466991d4a7988d8bedd4d8d924a120d35272c1c61d2 all runs: OK # git bisect bad 9ce3746d64132a561bceab6421715e7c04e85074 Bisecting: 7 revisions left to test after this (roughly 3 steps) [0469f2f7ab4c6a6cae4b74c4f981c4da6d909411] KVM: x86: hyper-v: Don't touch TSC page values when guest opted for re-enlightenment testing commit 0469f2f7ab4c6a6cae4b74c4f981c4da6d909411 with gcc (GCC) 10.2.1 20210217 kernel signature: 06cb1ef1f191923ae2a9876ed86eab5cfd46b15651f37d88988fdffeacd084c8 run #0: crashed: WARNING in kvm_wait run #1: crashed: WARNING in kvm_wait run #2: crashed: WARNING in kvm_wait run #3: crashed: WARNING in kvm_wait run #4: crashed: WARNING in kvm_wait run #5: crashed: WARNING in kvm_wait run #6: boot failed: WARNING in kvm_wait run #7: OK run #8: OK run #9: OK # git bisect good 0469f2f7ab4c6a6cae4b74c4f981c4da6d909411 Bisecting: 3 revisions left to test after this (roughly 2 steps) [3df2252436c08028a549e27ed7f097974e21d17b] selftests: kvm: add set_boot_cpu_id test testing commit 3df2252436c08028a549e27ed7f097974e21d17b with gcc (GCC) 10.2.1 20210217 kernel signature: 06cb1ef1f191923ae2a9876ed86eab5cfd46b15651f37d88988fdffeacd084c8 run #0: crashed: WARNING in kvm_wait run #1: crashed: WARNING in kvm_wait run #2: crashed: WARNING in kvm_wait run #3: crashed: WARNING in kvm_wait run #4: crashed: WARNING in kvm_wait run #5: crashed: WARNING in kvm_wait run #6: crashed: WARNING in kvm_wait run #7: OK run #8: OK run #9: OK # git bisect good 3df2252436c08028a549e27ed7f097974e21d17b Bisecting: 1 revision left to test after this (roughly 1 step) [c2162e13d6e2f43e5001a356196871642de070ba] KVM: X86: Fix missing local pCPU when executing wbinvd on all dirty pCPUs testing commit c2162e13d6e2f43e5001a356196871642de070ba with gcc (GCC) 10.2.1 20210217 kernel signature: 77ac3997a835cad272a13e0674336cccc46e5b5000daa58ebaa80a755da99da3 run #0: crashed: WARNING in kvm_wait run #1: crashed: WARNING in kvm_wait run #2: crashed: WARNING in kvm_wait run #3: crashed: WARNING in kvm_wait run #4: crashed: WARNING in kvm_wait run #5: crashed: WARNING in kvm_wait run #6: crashed: WARNING in kvm_wait run #7: OK run #8: OK run #9: OK # git bisect good c2162e13d6e2f43e5001a356196871642de070ba Bisecting: 0 revisions left to test after this (roughly 0 steps) [f4e61f0c9add3b00bd5f2df3c814d688849b8707] x86/kvm: Fix broken irq restoration in kvm_wait testing commit f4e61f0c9add3b00bd5f2df3c814d688849b8707 with gcc (GCC) 10.2.1 20210217 kernel signature: fd2bd213b6532b5f666e4466991d4a7988d8bedd4d8d924a120d35272c1c61d2 all runs: OK # git bisect bad f4e61f0c9add3b00bd5f2df3c814d688849b8707 f4e61f0c9add3b00bd5f2df3c814d688849b8707 is the first bad commit commit f4e61f0c9add3b00bd5f2df3c814d688849b8707 Author: Wanpeng Li Date: Mon Mar 15 14:55:28 2021 +0800 x86/kvm: Fix broken irq restoration in kvm_wait After commit 997acaf6b4b59c (lockdep: report broken irq restoration), the guest splatting below during boot: raw_local_irq_restore() called with IRQs enabled WARNING: CPU: 1 PID: 169 at kernel/locking/irqflag-debug.c:10 warn_bogus_irq_restore+0x26/0x30 Modules linked in: hid_generic usbhid hid CPU: 1 PID: 169 Comm: systemd-udevd Not tainted 5.11.0+ #25 RIP: 0010:warn_bogus_irq_restore+0x26/0x30 Call Trace: kvm_wait+0x76/0x90 __pv_queued_spin_lock_slowpath+0x285/0x2e0 do_raw_spin_lock+0xc9/0xd0 _raw_spin_lock+0x59/0x70 lockref_get_not_dead+0xf/0x50 __legitimize_path+0x31/0x60 legitimize_root+0x37/0x50 try_to_unlazy_next+0x7f/0x1d0 lookup_fast+0xb0/0x170 path_openat+0x165/0x9b0 do_filp_open+0x99/0x110 do_sys_openat2+0x1f1/0x2e0 do_sys_open+0x5c/0x80 __x64_sys_open+0x21/0x30 do_syscall_64+0x32/0x50 entry_SYSCALL_64_after_hwframe+0x44/0xae The new consistency checking, expects local_irq_save() and local_irq_restore() to be paired and sanely nested, and therefore expects local_irq_restore() to be called with irqs disabled. The irqflags handling in kvm_wait() which ends up doing: local_irq_save(flags); safe_halt(); local_irq_restore(flags); instead triggers it. This patch fixes it by using local_irq_disable()/enable() directly. Cc: Thomas Gleixner Reported-by: Dmitry Vyukov Signed-off-by: Wanpeng Li Message-Id: <1615791328-2735-1-git-send-email-wanpengli@tencent.com> Signed-off-by: Paolo Bonzini arch/x86/kernel/kvm.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) culprit signature: fd2bd213b6532b5f666e4466991d4a7988d8bedd4d8d924a120d35272c1c61d2 parent signature: 77ac3997a835cad272a13e0674336cccc46e5b5000daa58ebaa80a755da99da3 revisions tested: 13, total time: 3h43m42.553793918s (build: 1h28m55.524846368s, test: 2h13m23.385306939s) first good commit: f4e61f0c9add3b00bd5f2df3c814d688849b8707 x86/kvm: Fix broken irq restoration in kvm_wait recipients (to): ["linux-kernel@vger.kernel.org" "pbonzini@redhat.com" "wanpengli@tencent.com"] recipients (cc): ["bp@alien8.de" "hpa@zytor.com" "jmattson@google.com" "joro@8bytes.org" "kvm@vger.kernel.org" "mingo@redhat.com" "pbonzini@redhat.com" "seanjc@google.com" "tglx@linutronix.de" "vkuznets@redhat.com" "wanpengli@tencent.com" "x86@kernel.org"]