diff mbox series

[01/12] KVM: x86: Remove guest mode check from kvm_check_nested_events

Message ID 20210520230339.267445-2-jmattson@google.com (mailing list archive)
State New, archived
Headers show
Series KVM: nVMX: Fix vmcs02 PID use-after-free issue | expand

Commit Message

Jim Mattson May 20, 2021, 11:03 p.m. UTC
A survey of the callsites reveals that they all ensure the vCPU is in
guest mode before calling kvm_check_nested_events. Remove this dead
code so that the only negative value this function returns (at the
moment) is -EBUSY.

Signed-off-by: Jim Mattson <jmattson@google.com>
 arch/x86/kvm/x86.c | 3 ---
 1 file changed, 3 deletions(-)
diff mbox series


diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index bbc4e04e67ad..d517460db413 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -8532,9 +8532,6 @@  static void update_cr8_intercept(struct kvm_vcpu *vcpu)
 int kvm_check_nested_events(struct kvm_vcpu *vcpu)
-	if (WARN_ON_ONCE(!is_guest_mode(vcpu)))
-		return -EIO;
 	if (kvm_check_request(KVM_REQ_TRIPLE_FAULT, vcpu)) {
 		return 1;