Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp172972ybh; Fri, 17 Jul 2020 23:41:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxKsuE0mWFwtRwLB97glHCxBHkRYPFhiZZ0Fj9Qcu3dXZ2y79erxGEw8VSD+kgIyj2gExqr X-Received: by 2002:a17:906:8316:: with SMTP id j22mr11483598ejx.97.1595054495000; Fri, 17 Jul 2020 23:41:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595054494; cv=none; d=google.com; s=arc-20160816; b=wvsrko8XtwTa/ueFbJP+M8q60+/PnJepI5RnXsJthai9OlxMv96wEjN72kz7UKm30W ufI9kcUvoLhstT7eUIfIKmJVGt/O06iOcjr4/1VUMSGzQPAG3P19DJq68XS0chx6fcIu obP3o+GMhSdFTl5nnIFA5g7AvmbKI/dFpX2Tj2YubxNZGci2+qQzvlTyyt8k9Yt0/0rX ehNDhM1POYRC+wXeMRWUHUGawsw6/BSoBb47+QbDcPlJ2gSZDUmHZAvx6Z0I1eracgkS UBSBtshzFbfwT2kJ3e6w/0ytSy+Q8jXc/XciaeiveyPDuNGdS4T6CJh4ZmUCGsrLSb48 PXLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:ironport-sdr:ironport-sdr; bh=zwnhU5kbbeR3QZvk9D649JfUnzJcJiZO+4GZ7eMyAd8=; b=KldKi3CK8SGQIBae8IEApQgcAW3Y1Qf6fHouVqcDf/4Y9ht2XqxOHPkZrWXmUAsQcm 4b0umxt0Pi4yV9dF11uxCCmE2Ea5zbzqVQFn2r1OGUMYbPv7dIGsPC1sUGPJayNhJ8xB MugkABgwBFTJk5NlAgFUEs74vmcxaw8i6BVr+xaiLLVUfEga63qGVObjKszutVaTTEzC oG2h/UifCBxJNnQZWuHryyBfdo9DHR67qcwPmOjHVn9fiQks2U7w9aO+V3fKHqLLkwlr y2rkb/yWa+iupTRuUJDHrLGi//R9Eh3nYM+i5Nhl++1o57/gIhGFofEGG6nS2uonpEsb ahBg== 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 l9si6903359edn.77.2020.07.17.23.41.12; Fri, 17 Jul 2020 23:41:34 -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 S1726711AbgGRGjB (ORCPT + 99 others); Sat, 18 Jul 2020 02:39:01 -0400 Received: from mga09.intel.com ([134.134.136.24]:30319 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726466AbgGRGjA (ORCPT ); Sat, 18 Jul 2020 02:39:00 -0400 IronPort-SDR: VBG67egJ9LbN53sa4iL5V6/4uBaZBCqwsqPvXY92LRqJWSDSg8WM3EOb2wNvaPsT674WM//Tnj xmMBSX/GChYA== X-IronPort-AV: E=McAfee;i="6000,8403,9685"; a="151079552" X-IronPort-AV: E=Sophos;i="5.75,366,1589266800"; d="scan'208";a="151079552" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jul 2020 23:39:00 -0700 IronPort-SDR: TshmekDtA3lv29or1uv6qeiETKNvK92+6aKC/H/JBGvbMLI+zj+9hscec/rKtRRuz7H13eO27l gx5u7c+d7Awg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,366,1589266800"; d="scan'208";a="486690945" Received: from sjchrist-coffee.jf.intel.com ([10.54.74.152]) by fmsmga006.fm.intel.com with ESMTP; 17 Jul 2020 23:38:59 -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 0/7] KVM: x86: Tracepoint improvements and fixes Date: Fri, 17 Jul 2020 23:38:47 -0700 Message-Id: <20200718063854.16017-1-sean.j.christopherson@intel.com> X-Mailer: git-send-email 2.26.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Various improvements and fixes for the kvm_entry, kvm_exit and kvm_nested_vmexit tracepoints. 1. Capture the guest's RIP during kvm_entry for obvious reasons. 2. Extend kvm_exit to report the same info as kvm_nested_vmexit, and macrofy its definition to reuse it verbatim for nested exits. 3. Stop passing in params to kvm_nested_vmexit, and instead use the same approach (and now code) as kvm_exit where the tracepoint uses a dedicated kvm_x86_ops hook to retrieve the info. 4. Stop reading GUEST_RIP, EXIT_QUAL, INTR_INFO, and ERROR_CODE on every VM-Exit from L2 (some of this comes in #3). This saves ~100 cycles (150+ with retpolines) on VM-Exits from L2 that are handled by L0, e.g. hardware interrupts. Sean Christopherson (7): KVM: x86: Add RIP to the kvm_entry, i.e. VM-Enter, tracepoint KVM: x86: Read guest RIP from within the kvm_nested_vmexit tracepoint KVM: VMX: Add a helper to test for a valid error code given an intr info KVM: x86: Add intr/vectoring info and error code to kvm_exit tracepoint KVM: x86: Add macro wrapper for defining kvm_exit tracepoint KVM: x86: Use common definition for kvm_nested_vmexit tracepoint KVM: nVMX: Read EXIT_QUAL and INTR_INFO only when needed for nested exit arch/x86/include/asm/kvm_host.h | 7 ++- arch/x86/kvm/svm/svm.c | 16 ++--- arch/x86/kvm/trace.h | 107 +++++++++++++------------------- arch/x86/kvm/vmx/nested.c | 14 ++--- arch/x86/kvm/vmx/vmcs.h | 7 +++ arch/x86/kvm/vmx/vmx.c | 18 +++++- arch/x86/kvm/x86.c | 2 +- 7 files changed, 86 insertions(+), 85 deletions(-) -- 2.26.0