From patchwork Wed Aug 23 10:23:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Wanpeng Li X-Patchwork-Id: 9917083 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 08444603FF for ; Wed, 23 Aug 2017 10:24:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EF4B7288D4 for ; Wed, 23 Aug 2017 10:24:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E263B28932; Wed, 23 Aug 2017 10:24:26 +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 ABB0F288D8 for ; Wed, 23 Aug 2017 10:24:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753712AbdHWKX1 (ORCPT ); Wed, 23 Aug 2017 06:23:27 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:37104 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753668AbdHWKX0 (ORCPT ); Wed, 23 Aug 2017 06:23:26 -0400 Received: by mail-pg0-f67.google.com with SMTP id 83so1162817pgb.4; Wed, 23 Aug 2017 03:23:25 -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=Roos4wjsk+b8cdFUsLtNpJ555MxsFWzwJD/Pak29oIA=; b=RUhvIH+Yzp8KhCkb7Ixj7ZATjik6JDvXmlL1FwUNk4SxIlytxuGR3yB7qyvGMqBQ9o EgMR9CdVDt2K6RtSCAhYh/KtBhYlBahZZVDt5MloNoe8KuR43jnBeP2yZ/h/Gf6FmYuA gCHB95S2WPkXiDH5fU4YYPJr6rZFnQqAQI9Y+LUsepxjN7JrjcZiCghJ0cx8RARRv6tR SRo2IuUk2ibFCnk5IR+2VOchb9nS6Vp3VpDzGm9/Ynvx+z9CuHPXZUVsmRN/Uxi0mQSZ MVn0aWyRe0FfAGWK5IGJjuhVSMCrpTCJQiXlrxArUULYmmXVShd/ucMinG+2SK/9yWl3 aTFg== 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=Roos4wjsk+b8cdFUsLtNpJ555MxsFWzwJD/Pak29oIA=; b=HBENjehWlwQpy8THZZ6I5GNxTSp+m35rKT/bJ7BoNJmEVCxGhtWo61MGW06mZNheA3 Y4WKt8UHsKEqtL61EANQ9mSYmAxxEoqhbwkR7aDp/W3SnBBwww9Q8Hkx6srU7l/2gOr/ n8PeRi/A7lDuneHspN+z05N+xr9fwKOBb5tbrkivhWmLmWuJbI1wxxcQXdzn5OfnxsQj /idfd2oYNBbysW3B4Yoz3uVVWPBSNK3nq3naCNzH9VXRInlLa9jbNEycH40d8O3cDk4y rFw42bK6V1R5fgn7QNIQ51PyBeB5NQDEd60fNxM2KH7m/aDazT5CFNJ2Bx4n/yU2s3xK cOiA== X-Gm-Message-State: AHYfb5hedTLqTwUIWkybiMFxWk0WqGJuVXo1KSYTNSS9tLhpzeHG/IoP QoT2yjqKdFrd+8PJ X-Received: by 10.84.238.2 with SMTP id u2mr2385316plk.169.1503483805477; Wed, 23 Aug 2017 03:23:25 -0700 (PDT) Received: from localhost ([203.205.141.123]) by smtp.gmail.com with ESMTPSA id 74sm3085367pfk.58.2017.08.23.03.23.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Aug 2017 03:23:24 -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 v2 1/2] KVM: VMX: use kvm_event_needs_reinjection Date: Wed, 23 Aug 2017 03:23:21 -0700 Message-Id: <1503483802-4420-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 c2e7c4b..a56e7f3 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -10931,9 +10931,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)) &&