Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1037160imm; Mon, 21 May 2018 20:01:07 -0700 (PDT) X-Google-Smtp-Source: AB8JxZo+cEh++9z4r+rDWoEqxwlXObv/tUSklSW21CnmVkfcI/mlFTHi83svn+v7BR+jdhRgmPXa X-Received: by 2002:a62:23d7:: with SMTP id q84-v6mr22211589pfj.31.1526958067367; Mon, 21 May 2018 20:01:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526958067; cv=none; d=google.com; s=arc-20160816; b=fXjQUOlPxdDpcqHjYCVRdyKa8M4KwqDe3SQj6f2iyscFlhriA0/KI7fr4K2/jM/f5z 21CGjZhFbgfN9u1SuKgYzhhcY+nnm1H+n7+j998PNVuUDtN9fUjvTUN/1M473rSml5F2 2iicuAwyMHuNck5BjvbtlX5QTkg7ii+Wgich3VyIqkSA3o1II5ylsA5KRC1teRHTlFb2 IcuZkoVLkupya3mKipQ74cc9MM/32NEJ/83YrTUCtnSY22mJuHAEHWqtQzdlsv24kK96 iNK9T1Td3srE3ks0VsnBBjijLWBCLSa5B9ukaUzRShIDIQeHKpfzfPY5cOg/D60Wkl/1 lESA== 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=oSARMHova8ckAQXE+qqZL+iAS6nh8fBZNoiR3BUv6yc=; b=beUUMCow/PwFb8ml0ibtj7TeBjrmKch2zSiLn+A/OoFKnsVxvJ+JHaDHXvqyr9hnIq 5C8rikzQBOSlHdi45qWK7ZMFrWw28MT0XwFcsp/xFepDlGwyU6iHJK0bsnjhxXtiBP5N wh57+aIJu1Jg3fEviBGc7gErWsMvwyXEZ/fyOl4yikThMXRHFmGEm00dUnR9uVHXc+RY y+r0lBC5rwB8Bw6fT0tBtzPbNnvros0e1z/9wMUGyUYCgUASSE/AI6d+hL44nuTb1vZt dSFmv/ezbEob3YcFhIqJ7C+BAj5Oo8SJU22hlkGi6pZSgY7WdNcDDz/PafyKwlIL7XX0 Ts+w== 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 w15-v6si3714370pgc.209.2018.05.21.20.00.52; Mon, 21 May 2018 20:01:07 -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 S1752662AbeEVDAZ (ORCPT + 99 others); Mon, 21 May 2018 23:00:25 -0400 Received: from mga04.intel.com ([192.55.52.120]:35887 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752566AbeEVC6O (ORCPT ); Mon, 21 May 2018 22:58:14 -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 fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 May 2018 19:58:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,428,1520924400"; d="scan'208";a="201335931" Received: from skx-d.bj.intel.com ([10.238.154.68]) by orsmga004.jf.intel.com with ESMTP; 21 May 2018 19:58:09 -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 04/12] perf/x86/intel/pt: add new capability for Intel PT Date: Tue, 22 May 2018 12:52:07 +0800 Message-Id: <1526964735-16566-5-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 CPUID(EAX=14H,ECX=0):EBX[bit 3] = 1 indicates support of output to Trace Transport subsystem. MSR IA32_RTIT_CTL.FabricEn[bit 6] is reserved if CPUID.(EAX=14H, ECX=0):ECX[bit 3] = 0. This is use for emulate IA32_RTIT_CTL MSR read/write in KVM. KVM guest write IA32_RTIT_CTL will trap to root mode and a #GP would be injected to guest if set IA32_RTIT_CTL.FabricEn with CPUID.(EAX=14H, ECX=0):ECX[bit 3] = 0. Signed-off-by: Luwei Kang --- arch/x86/events/intel/pt.c | 1 + arch/x86/include/asm/intel_pt.h | 1 + 2 files changed, 2 insertions(+) diff --git a/arch/x86/events/intel/pt.c b/arch/x86/events/intel/pt.c index c80e2f5..f65f97a 100644 --- a/arch/x86/events/intel/pt.c +++ b/arch/x86/events/intel/pt.c @@ -68,6 +68,7 @@ PT_CAP(topa_output, 0, CPUID_ECX, BIT(0)), PT_CAP(topa_multiple_entries, 0, CPUID_ECX, BIT(1)), PT_CAP(single_range_output, 0, CPUID_ECX, BIT(2)), + PT_CAP(output_subsys, 0, CPUID_ECX, BIT(3)), PT_CAP(payloads_lip, 0, CPUID_ECX, BIT(31)), PT_CAP(num_address_ranges, 1, CPUID_EAX, 0x3), PT_CAP(mtc_periods, 1, CPUID_EAX, 0xffff0000), diff --git a/arch/x86/include/asm/intel_pt.h b/arch/x86/include/asm/intel_pt.h index 4270421..2de4db0 100644 --- a/arch/x86/include/asm/intel_pt.h +++ b/arch/x86/include/asm/intel_pt.h @@ -16,6 +16,7 @@ enum pt_capabilities { PT_CAP_topa_output, PT_CAP_topa_multiple_entries, PT_CAP_single_range_output, + PT_CAP_output_subsys, PT_CAP_payloads_lip, PT_CAP_num_address_ranges, PT_CAP_mtc_periods, -- 1.8.3.1