From patchwork Thu Aug 24 04:21:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Wanpeng Li X-Patchwork-Id: 9918977 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BC87560353 for ; Thu, 24 Aug 2017 04:23:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AC14D28B36 for ; Thu, 24 Aug 2017 04:23:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 93B7E28B38; Thu, 24 Aug 2017 04:23:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DA3B828B2D for ; Thu, 24 Aug 2017 04:23:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751114AbdHXEVw (ORCPT ); Thu, 24 Aug 2017 00:21:52 -0400 Received: from mail-pg0-f66.google.com ([74.125.83.66]:38858 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750806AbdHXEVv (ORCPT ); Thu, 24 Aug 2017 00:21:51 -0400 Received: by mail-pg0-f66.google.com with SMTP id u9so2099709pgn.5; Wed, 23 Aug 2017 21:21:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=EIIw2/O5NzFCFFSuEroycLxKFFkKOiyNdAXoskFOLjg=; b=WpH22B6AfF4krI7UZMmIWgaUQHjFqyI0NRFfksw5RGwLHNerrB9JTZPf6SPPXh4X6S loAbfwcRTAFEBnI5Y0SKYjm0y9qC+ogJ73VnmH52QFV+EBVIR7SimHA+H64mun41uOOm 4kHn7V75mHl2ebWNiXqxZc6Z+Wb5phZQFh/fWtbvRehr3T9MJXrWElbCVQn1GlMns5OU 9TDgwolDweekvJPgPK1zbFmMMyWOD01LtD46ZGvNif4lY8xZ4823lJhAIicANcm1vACN Vac9MEJPxQSNkVRAd+jEAFhJe1vBPmqc7M3+/ARWX4QuJPKdmQh8MOh6k+DQTLv0VaZe Ao9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=EIIw2/O5NzFCFFSuEroycLxKFFkKOiyNdAXoskFOLjg=; b=GJ8YBa8f/BaiLjmZOasaPZCI6/OH4OWUdtGsVGxmvt0XY0UTR3mmqg87Mjmrid5uzw gAkVEdEfYsvSRcAUVZ5U74BqfJC73FCvTst6HMC64flNvgJfy5JibKhnAdqFjNA+y2IQ Dn8jHHagLGB6t/6sr/b4VCaXSSarbwWNL61lO1Af5JozregFvnxUxAKLe2XEZSK7hGtA +f1P2Vj0ojxcCAFIOuU0Naj5YA3MeGPfE3cC+sYsHMU36vJep+czzJuhYQbZQwSnwvWo f3yo7djDFfaG+yCRVG88L6ThS5tDtpzXMOohKRrvAA+nZhe2SNYsCG7ZDkO4+dQFYJnD 8jjw== X-Gm-Message-State: AHYfb5iiOu8xbYlEZdykV/+cLr/aTLLNTy7hG1kGM31VX9cviVDKigSL jK8MwGsqeOjc/im1 X-Received: by 10.99.96.84 with SMTP id u81mr5103182pgb.345.1503548510746; Wed, 23 Aug 2017 21:21:50 -0700 (PDT) Received: from localhost ([203.205.141.123]) by smtp.gmail.com with ESMTPSA id i90sm5075920pfi.106.2017.08.23.21.21.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Aug 2017 21:21:50 -0700 (PDT) From: Wanpeng Li X-Google-Original-From: Wanpeng Li To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , Wanpeng Li Subject: [PATCH v3 1/4] KVM: VMX: use kvm_event_needs_reinjection Date: Wed, 23 Aug 2017 21:21:43 -0700 Message-Id: <1503548506-4457-1-git-send-email-wanpeng.li@hotmail.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Wanpeng Li Use kvm_event_needs_reinjection() encapsulation. Cc: Paolo Bonzini Cc: Radim Krčmář Signed-off-by: Wanpeng Li --- arch/x86/kvm/vmx.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index dd710d3..c5f43ab 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -10988,9 +10988,7 @@ static int vmx_check_nested_events(struct kvm_vcpu *vcpu, bool external_intr) { struct vcpu_vmx *vmx = to_vmx(vcpu); - if (vcpu->arch.exception.pending || - vcpu->arch.nmi_injected || - vcpu->arch.interrupt.pending) + if (kvm_event_needs_reinjection(vcpu)) return -EBUSY; if (nested_cpu_has_preemption_timer(get_vmcs12(vcpu)) &&