From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 89C0EC31E45 for ; Thu, 13 Jun 2019 17:03:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5CD4E2063F for ; Thu, 13 Jun 2019 17:03:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="tauNLy6b" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730341AbfFMRDo (ORCPT ); Thu, 13 Jun 2019 13:03:44 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:56098 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729782AbfFMRDe (ORCPT ); Thu, 13 Jun 2019 13:03:34 -0400 Received: by mail-wm1-f67.google.com with SMTP id a15so10963508wmj.5; Thu, 13 Jun 2019 10:03:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=7m3hMtDG7gra4X2zWk3roSWCEEO5EloSfs0dzfM9Apo=; b=tauNLy6bXrdunw+dGY7UPzi569AXF/L59P1VXZL5xSxv7d3DhA+KdWe49kz5kSjdw+ Xj85YtiFbt884q5VSpfMECTWrgrZkAjpTzmhXmIYdrpGcgZthDuybh1SvrfQOyWS0RHh XrekiJjrLprAQbw1aEIH01BaVXGrv5C4GT3t7CVeajy5ou+68XCPGxVfHou4GbHVt+nm pUljNiF5uHfg55WvWtF86bvhGpv7WGaLXsCagILMsFt1Yq51nwyxfpy/xKlMATgHQq3H I4UrmC1pAQCvTK1zGniWI0XtigXmXUf10Hd+a+/yAgpygT5CXA71SPlLnDvxtO+JReWW Zivg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=7m3hMtDG7gra4X2zWk3roSWCEEO5EloSfs0dzfM9Apo=; b=adFEVZ7FyNBRr8CLd0NHCrsT+ecG2bgvPzwBnY29iWClJ/KNJkOm/wsjdS+cA7VgpC iWhZlFSLDIMte4FlBvvyHm8PYTfxpNiOv1JYumPn81ji3uW2ZyC+l/o+lG0oJ6FwOQ7b HpoHbJ1TxnpYiMrURCbD6a6ZPWjQ3z/1At5Ld62FrFNDc0/G6suGsnk5TgVfFW5/ZRay EwF1fPLxH3QJjtlbL7hDMpRIIvfEa+jBQ81LUB8LZ86Bac+gPNhhyybBjfcgxaen8666 R/A+FP+CUxheBRBHdpPihLw0Mkc2PsuHZYOfkbz+fersscrdvE+mjizV3vn90meByQCZ oLyQ== X-Gm-Message-State: APjAAAUM1q+PQjhYXe5Qh7Q3h3ztKjh2wH+j8jvk9GpQ+4lBIVoOfblT PbzMozCjcMvD5ixVF4NdmNGIPdX1 X-Google-Smtp-Source: APXvYqxu4kCzKA7T0Wtw/Hp+cpnGxPexT97EFPhWjhA/Q4yqMKDXbO1bwBc5hd5Ea1Yk2JQ4PZyZyA== X-Received: by 2002:a1c:7310:: with SMTP id d16mr4447800wmb.107.1560445413046; Thu, 13 Jun 2019 10:03:33 -0700 (PDT) Received: from 640k.localdomain ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id a10sm341856wrx.17.2019.06.13.10.03.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Jun 2019 10:03:32 -0700 (PDT) From: Paolo Bonzini To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: Sean Christopherson , vkuznets@redhat.com Subject: [PATCH 02/43] kvm: nVMX: small cleanup in handle_exception Date: Thu, 13 Jun 2019 19:02:48 +0200 Message-Id: <1560445409-17363-3-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1560445409-17363-1-git-send-email-pbonzini@redhat.com> References: <1560445409-17363-1-git-send-email-pbonzini@redhat.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The reason for skipping handling of NMI and #MC in handle_exception is the same, namely they are handled earlier by vmx_complete_atomic_exit. Calling the machine check handler (which just returns 1) is misleading, don't do it. Signed-off-by: Paolo Bonzini --- arch/x86/kvm/vmx/vmx.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c index 1b3ca0582a0c..da6c829bad9f 100644 --- a/arch/x86/kvm/vmx/vmx.c +++ b/arch/x86/kvm/vmx/vmx.c @@ -4455,11 +4455,8 @@ static int handle_exception(struct kvm_vcpu *vcpu) vect_info = vmx->idt_vectoring_info; intr_info = vmx->exit_intr_info; - if (is_machine_check(intr_info)) - return handle_machine_check(vcpu); - - if (is_nmi(intr_info)) - return 1; /* already handled by vmx_vcpu_run() */ + if (is_machine_check(intr_info) || is_nmi(intr_info)) + return 1; /* already handled by vmx_complete_atomic_exit */ if (is_invalid_opcode(intr_info)) return handle_ud(vcpu); -- 1.8.3.1