Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1035603imm; Mon, 21 May 2018 19:59:16 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrTGlt0xwsCbfnLDxYfRjLhK5YTwzUPCwHg3Fq/H60TsjipUukdpldxPBqeL7RjYKdWBgXH X-Received: by 2002:a63:a06a:: with SMTP id u42-v6mr16954734pgn.389.1526957956476; Mon, 21 May 2018 19:59:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526957956; cv=none; d=google.com; s=arc-20160816; b=g2Rnl2JqTP/7cB3PFOd1EuGKhVJ5FkuHuGSl55GQ0AGEnZfdTWGixcZqY0RU+I2QU7 TN+da6UuLueYBAeT4iZxSo80mFgKs34yE/zN3CtzLfxmpBD45eIyt+KzE64SeEC2tYOX DNzgh6+g3aes2Sl8rcqtSMyKLDu2x3HWCwVUx1Fk4LjnzV5miX6NmKbPYIs9ZFIu74i4 P+33aLqZZsd0EpJ3vEF6y3cu1mVBW3fVOXr65QEN273x7nRI6sMyCkXgGJnzTPApXaaV GpRUA68kZZ7RHtBZbqIdj3kKikQMzVxBMnE/9IsBp3LUCRhtc5EScyCorCwung13BOGP 1icQ== 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=sU/Xy38SE1jZjYNQ8qqoYtcGbkhrrd0+6m1L5IaLOC8=; b=ZospDpU2JnCu2HmJW4OX2PChCAFcR9Dx6G83CILgGN3Rwts1E7l7IndjdHRCzPZKVL i2DXcUqyyY7RRGwwdqiWyKxczkoiCLtqIcqcDHDVE9wpe0ha9HqAhTHre2TgYNa3TIeY GYzZTehsUYK2vieHQCxSTxh7usEC0MqxGt4ioEibcB1o4An5HFoIhW0L547dP6nI2njv VKpn/PkY0/b2rWkWdsQhshFKurJ3zkA7YOLHCanx7m3frV0i7w6PcA0rJB0OyEQQHeMP knKECEBHnpIfZBmXysR43PWr9XFmrpfrSnVi2lcHFInoZ3uWEhHYmhj+dySvaiK1pl+a nKqQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 95-v6si15977564plc.383.2018.05.21.19.59.02; Mon, 21 May 2018 19:59: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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752681AbeEVC6P (ORCPT + 99 others); Mon, 21 May 2018 22:58:15 -0400 Received: from mga06.intel.com ([134.134.136.31]:54501 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751601AbeEVC6J (ORCPT ); Mon, 21 May 2018 22:58:09 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 May 2018 19:58:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,428,1520924400"; d="scan'208";a="201335920" Received: from skx-d.bj.intel.com ([10.238.154.68]) by orsmga004.jf.intel.com with ESMTP; 21 May 2018 19:58:03 -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 v9 03/12] perf/x86/intel/pt: Add new bit definitions for Intel PT MSRs Date: Tue, 22 May 2018 12:52:06 +0800 Message-Id: <1526964735-16566-4-git-send-email-luwei.kang@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1526964735-16566-1-git-send-email-luwei.kang@intel.com> References: <1526964735-16566-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 afe4e13..6ae2462 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