]> git.baikalelectronics.ru Git - kernel.git/commit
x86/kvm: Use __xfer_to_guest_mode_work_pending() in kvm_run_vcpu()
authorThomas Gleixner <tglx@linutronix.de>
Thu, 30 Jul 2020 07:19:01 +0000 (09:19 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 30 Jul 2020 10:31:47 +0000 (12:31 +0200)
commit2022b52252c85c06cae7b677b55cd0db59a61f50
tree7ad2c73e540f8149b26d85490028a831a8896136
parentdd56d7ba544a73e0b1490c80a558c27abdebb3d9
x86/kvm: Use __xfer_to_guest_mode_work_pending() in kvm_run_vcpu()

The comments explicitely explain that the work flags check and handling in
kvm_run_vcpu() is done with preemption and interrupts enabled as KVM
invokes the check again right before entering guest mode with interrupts
disabled which guarantees that the work flags are observed and handled
before VMENTER.

Nevertheless the flag pending check in kvm_run_vcpu() uses the helper
variant which requires interrupts to be disabled triggering an instant
lockdep splat. This was caught in testing before and then not fixed up in
the patch before applying. :(

Use the relaxed and intentionally racy __xfer_to_guest_mode_work_pending()
instead.

Fixes: dd56d7ba544a ("x86/kvm: Use generic xfer to guest work function")
Reported-by: Qian Cai <cai@lca.pw> writes:
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/87bljxa2sa.fsf@nanos.tec.linutronix.de
arch/x86/kvm/x86.c