Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp4072491imm; Mon, 14 May 2018 02:05:16 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqa4hKlHVaOzIxqHzIGnoZfI/nDt4cp84P12hjVTqfJTgyqnwhJWVnPwUJ4KtQkCTPsxpbO X-Received: by 2002:a17:902:76c1:: with SMTP id j1-v6mr8945698plt.284.1526288716684; Mon, 14 May 2018 02:05:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526288716; cv=none; d=google.com; s=arc-20160816; b=sbFVhevfYQKomg2CzaydckwrqpowiXq06eVSOBqWMUQ83JtFR45xZXWEzCEC8Vir6K hYnaZMFfHxmfigogQiVK0k6wD78XpAb240HigVk7Gg0mrZ/alqt2U5YG5X+7yqqislPD muNKVY2Fvjf0+06Cmez8ZAfQEt9uzEjcqANTSyqNdKWJUh0kLuPOnm7ItNlg6ZKxZaJk UoHF7Wz0noBOXWHaN56I8zxUwisoAL/emquf/gATbJ9PCdrGI/Y8nfYcjAy3MfW8iIVe 6Og2qXR/luyRfsQSItO+tfmuo3ImooL5jIZTZukF0N2bKUEkdBwknmiZaxkJSvuKTOC8 goJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=BlsY8DWussseUdrPFHptQ05E3Uuh9JImFQUxwYMY+wg=; b=AkEmCCbRMXcMSHPrLptJ0lQLmM9K+aoebuRw9QjCren6GTa+PGMCqKUDPhJJjheUz+ Pw+gZITt2M7kkOhdEYTnHiJHkEESuEm4JdLFUdeTR3igJksfL+ycpWfrD4jO/EIkaQw5 qIINgI7MwfzRkBsnTX88b8l7Y6dFoQ/hLAs6JXyt1yjBXvA0pjk57NEukJgNIGAsKdcF o47l2R0CJm19qZiEasSDmWG/KyfHpdHeoF9LQJUmSqb+oj29+py4O+5sTempsYCOXuR3 4ZVZ8nE+bdONw5YAAjX+t5H/HtSznLOmKAAiprFZkcfL90mZcYQ/41sK3+Lw7bI+oc1A NFOg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n9-v6si7135452pgq.470.2018.05.14.02.05.02; Mon, 14 May 2018 02:05:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752338AbeENJDK (ORCPT + 99 others); Mon, 14 May 2018 05:03:10 -0400 Received: from mga03.intel.com ([134.134.136.65]:19809 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752270AbeENJDE (ORCPT ); Mon, 14 May 2018 05:03:04 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 May 2018 02:03:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,399,1520924400"; d="scan'208";a="39701855" Received: from skx-d.bj.intel.com ([10.238.154.68]) by fmsmga008.fm.intel.com with ESMTP; 14 May 2018 02:02:59 -0700 From: Luwei Kang To: kvm@vger.kernel.org Cc: tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, chao.p.peng@linux.intel.com, thomas.lendacky@amd.com, bp@suse.de, Kan.liang@intel.com, Janakarajan.Natarajan@amd.com, dwmw@amazon.co.uk, linux-kernel@vger.kernel.org, alexander.shishkin@linux.intel.com, peterz@infradead.org, mathieu.poirier@linaro.org, kstewart@linuxfoundation.org, gregkh@linuxfoundation.org, pbonzini@redhat.com, rkrcmar@redhat.com, david@redhat.com, bsd@redhat.com, yu.c.zhang@linux.intel.com, joro@8bytes.org, Luwei Kang Subject: [PATCH v8 03/12] perf/x86/intel/pt: Add new bit definitions for Intel PT MSRs Date: Mon, 14 May 2018 18:57:03 +0800 Message-Id: <1526295432-20640-4-git-send-email-luwei.kang@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1526295432-20640-1-git-send-email-luwei.kang@intel.com> References: <1526295432-20640-1-git-send-email-luwei.kang@intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org These bit definitions are use for emulate MSRs read/write for KVM. For example, IA32_RTIT_CTL.FabricEn[bit 6] is available only when CPUID.(EAX=14H, ECX=0):ECX[bit 3] = 1. If KVM guest try to set this bit with CPUID.(EAX=14H, ECX=0):ECX[bit3] = 0 a #GP would be injected to KVM guest. Signed-off-by: Luwei Kang --- arch/x86/include/asm/msr-index.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/x86/include/asm/msr-index.h b/arch/x86/include/asm/msr-index.h index 5e8d156..f163f04 100644 --- a/arch/x86/include/asm/msr-index.h +++ b/arch/x86/include/asm/msr-index.h @@ -112,6 +112,7 @@ #define RTIT_CTL_USR BIT(3) #define RTIT_CTL_PWR_EVT_EN BIT(4) #define RTIT_CTL_FUP_ON_PTW BIT(5) +#define RTIT_CTL_FABRIC_EN BIT(6) #define RTIT_CTL_CR3EN BIT(7) #define RTIT_CTL_TOPA BIT(8) #define RTIT_CTL_MTC_EN BIT(9) @@ -140,6 +141,8 @@ #define RTIT_STATUS_BUFFOVF BIT(3) #define RTIT_STATUS_ERROR BIT(4) #define RTIT_STATUS_STOPPED BIT(5) +#define RTIT_STATUS_BYTECNT_OFFSET 32 +#define RTIT_STATUS_BYTECNT (0x1ffffull << RTIT_STATUS_BYTECNT_OFFSET) #define MSR_IA32_RTIT_ADDR0_A 0x00000580 #define MSR_IA32_RTIT_ADDR0_B 0x00000581 #define MSR_IA32_RTIT_ADDR1_A 0x00000582 -- 1.8.3.1