Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp683920pxk; Wed, 23 Sep 2020 13:15:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzvVVmoO1YE9Gk0F5ZpZUTLEnZF1Q513ZHExh6Qj/R6h9/5f8r8KqIYJJlcUDVXGkR6t84F X-Received: by 2002:a50:8523:: with SMTP id 32mr1123097edr.282.1600892123415; Wed, 23 Sep 2020 13:15:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600892123; cv=none; d=google.com; s=arc-20160816; b=BHiHF4LWhhmnA5wfludDdnZRnO2ak8AHQZ1nchwqBn+byZycNphL6TbLFYYyV9ruS4 /4TL26z/c0a88BPG8rcJDVLLFgguNpDcWbUof0ufx+J+CMuLJMGAhN17LCls36hUj/k/ fMQBDKUNIGuDiy4elNU3IqDkVZcyx8CENcBD64WYnNCKp60f7GYbl9QqjIY1u3wbj707 A5oYZNtZRIiko1HDHfrh4N43EUZVnI7V9IXxuJJ8FJ8FReJA83u8DygZgEC4+7b1P0sG oje17HBgE7kWArzFKM1W78YVpFTA90/rAJ5szXOu67feCJ3zYAE+2wXmNoG2iRPzRgyp dqZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :ironport-sdr:ironport-sdr; bh=xTMy7/yvMh/RyrdlV45JlSMoXJ4mS5QWOWRVowo0/q4=; b=njYe2NAcqolf4vn3msx2RtbBduptdIP6tIibeicVsFo2imH3lim/nOatU+TEjZioaW 1ceD3bFlZgEZdG4X/9IAJlwm9PQkP/wgyeXUJNZl0L3SxzbLOJlU6ev9uuftlcaDe6LV +OoTPDrH4ci1FSfKooR7BOdA6uy51T+FKfNs1EOC27/ZKtIe7qKrX4aLPQ1idp/k4xvS vdWEz5ooDv+uAYfzV9XKD672OJhN85TSgx6VC8zb2cKgI4WBk8HJWP8OO52/Il4YaelW egfIacxnIyYEMO+JrJCcdVUGT9vQXeZ2ucjVFiPFD0mI3KoFBK4z1RorQZb/yydYzVqP TEMg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l18si622472ejr.492.2020.09.23.13.15.00; Wed, 23 Sep 2020 13:15:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726734AbgIWUNx (ORCPT + 99 others); Wed, 23 Sep 2020 16:13:53 -0400 Received: from mga17.intel.com ([192.55.52.151]:27768 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726687AbgIWUNv (ORCPT ); Wed, 23 Sep 2020 16:13:51 -0400 IronPort-SDR: p+TXUlaKsndBTPniUCquuBFiyLrYjZ3Y236qyxFkWSdItuWXhd+mtMH39fksnUjd5X0X+Tui2P DlCL+o1mibeQ== X-IronPort-AV: E=McAfee;i="6000,8403,9753"; a="141018739" X-IronPort-AV: E=Sophos;i="5.77,293,1596524400"; d="scan'208";a="141018739" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Sep 2020 13:13:51 -0700 IronPort-SDR: itQnvj8DiFtRSDGe6OrdD3HXv/HF/aTqM/mnVxhxJhIo1ER+sFwxqlZlM2eLu7WB1OJxJ9+10l 1VsM3kYVCK3Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,293,1596524400"; d="scan'208";a="349004954" Received: from sjchrist-coffee.jf.intel.com ([10.54.74.160]) by orsmga007.jf.intel.com with ESMTP; 23 Sep 2020 13:13:50 -0700 From: Sean Christopherson To: Paolo Bonzini Cc: Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 7/7] KVM: nVMX: Read EXIT_QUAL and INTR_INFO only when needed for nested exit Date: Wed, 23 Sep 2020 13:13:49 -0700 Message-Id: <20200923201349.16097-8-sean.j.christopherson@intel.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200923201349.16097-1-sean.j.christopherson@intel.com> References: <20200923201349.16097-1-sean.j.christopherson@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Read vmcs.EXIT_QUALIFICATION and vmcs.VM_EXIT_INTR_INFO only if the VM-Exit is being reflected to L1 now that they are no longer passed directly to the kvm_nested_vmexit tracepoint. No functional change intended. Signed-off-by: Sean Christopherson --- arch/x86/kvm/vmx/nested.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c index 39828823adfe..4c4cac48e432 100644 --- a/arch/x86/kvm/vmx/nested.c +++ b/arch/x86/kvm/vmx/nested.c @@ -5918,9 +5918,6 @@ bool nested_vmx_reflect_vmexit(struct kvm_vcpu *vcpu) goto reflect_vmexit; } - exit_intr_info = vmx_get_intr_info(vcpu); - exit_qual = vmx_get_exit_qual(vcpu); - trace_kvm_nested_vmexit(exit_reason, vcpu, KVM_ISA_VMX); /* If L0 (KVM) wants the exit, it trumps L1's desires. */ @@ -5937,12 +5934,14 @@ bool nested_vmx_reflect_vmexit(struct kvm_vcpu *vcpu) * need to be synthesized by querying the in-kernel LAPIC, but external * interrupts are never reflected to L1 so it's a non-issue. */ + exit_intr_info = vmx_get_intr_info(vcpu); if (is_exception_with_error_code(exit_intr_info)) { struct vmcs12 *vmcs12 = get_vmcs12(vcpu); vmcs12->vm_exit_intr_error_code = vmcs_read32(VM_EXIT_INTR_ERROR_CODE); } + exit_qual = vmx_get_exit_qual(vcpu); reflect_vmexit: nested_vmx_vmexit(vcpu, exit_reason, exit_intr_info, exit_qual); -- 2.28.0