Received: by 10.192.165.148 with SMTP id m20csp1686495imm; Thu, 3 May 2018 03:52:17 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoYe92ahJjnIP1y54bKnYkIfzwD9ezwpq4Fq4uyoXftGZI8huekWkXk4k1Q+gUUSlCE5vcf X-Received: by 2002:a63:7981:: with SMTP id u123-v6mr18753001pgc.328.1525344737359; Thu, 03 May 2018 03:52:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525344737; cv=none; d=google.com; s=arc-20160816; b=o72kFxmSqlIfC3zyOesjEHMCOwgw5FXXAzbzdxftAUBWv6JGmcQEY4PZX8Rn9WyHw9 QO+//Viav0nTqOZsM17vmqFTKFDpe7MJbBQ9ghMWKwbwNHtvLjMA6rk2obJaIvx78uji tmZ/dpet27RzFhbNFTNSV4BY1vUpnC/cT1yb9MGOhwFtavANE/fN13ni6pqX/tKUK+Bb GzQ0uAZ/JBPCTVA6zi3DH9X/rLHPSU5zvjwvfUkrbzaknbsRGkzFcL0ZQh0WpUDyHzCT jfhEJIMiEt5PJlLMuL51Qvji6Mpzn47mXazH7FOTEqt5jWP5wW9Vm+V9Q+Lx5STaOpzf z9Xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=UwlpcdBj6+lbx7avS9VkHPPUbnPO0NLyu9meNmQNYCc=; b=AYbqeS2va5HHf9lemUXI6BJdXVmViCYxzh2p/53NRBvnLCVWa8OMYWL8KmZIPY9DLW TK1F8o5S/MSkZCiq0fGziHkY379mPoRD7y8UUhoITtR639hLx8e6SFS8w+uVvH02Eo+e hBt1+2bjWBn43i/u3SgVzIIRQGaZyW1tcral3sZ35BuziNqDL/3nnnCXxa4QCdMVWZZv aTALesQw5zHDug75fcbWTeHPxvdbKCIictabIwVV3xJtXw5NBgdxExd8YqqY7D+jvG92 caSFAPFsQ+NmU90LCH2ph1Ma7xzxJM9fEVoosXJHQ3OKzoFlT4EJyzZBbm7pbDGeIAcJ sKDQ== 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 z5-v6si2797216pln.562.2018.05.03.03.52.02; Thu, 03 May 2018 03:52:17 -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 S1751602AbeECKul (ORCPT + 99 others); Thu, 3 May 2018 06:50:41 -0400 Received: from mga14.intel.com ([192.55.52.115]:38907 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750969AbeECKuj (ORCPT ); Thu, 3 May 2018 06:50:39 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 May 2018 03:50:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,358,1520924400"; d="scan'208";a="38359660" Received: from um.fi.intel.com (HELO um) ([10.237.72.212]) by orsmga008.jf.intel.com with ESMTP; 03 May 2018 03:50:34 -0700 Received: from ash by um with local (Exim 4.90_1) (envelope-from ) id 1fEBon-0005G1-20; Thu, 03 May 2018 13:50:33 +0300 Date: Thu, 3 May 2018 13:50:32 +0300 From: Alexander Shishkin To: Luwei Kang Cc: kvm@vger.kernel.org, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, pbonzini@redhat.com, rkrcmar@redhat.com, linux-kernel@vger.kernel.org, joro@8bytes.org, peterz@infradead.org, chao.p.peng@linux.intel.com Subject: Re: [PATCH v7 05/13] perf/x86/intel/pt: Introduce a new function to get capability of Intel PT Message-ID: <20180503105032.h73n5lcrwkdbahgm@um.fi.intel.com> References: <1525349323-9938-1-git-send-email-luwei.kang@intel.com> <1525349323-9938-6-git-send-email-luwei.kang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1525349323-9938-6-git-send-email-luwei.kang@intel.com> User-Agent: NeoMutt/20171215 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 03, 2018 at 08:08:35PM +0800, Luwei Kang wrote: > New function __pt_cap_get() will be invoked in KVM to check > if a specific capability is availiable in KVM guest. > Another function pt_cap_get() can only check the hardware > capabilities but this may different with KVM guest because > some features may not be exposed to guest. Do we really need both in KVM? > diff --git a/arch/x86/include/asm/intel_pt.h b/arch/x86/include/asm/intel_pt.h > index 2de4db0..3a4f524 100644 > --- a/arch/x86/include/asm/intel_pt.h > +++ b/arch/x86/include/asm/intel_pt.h > @@ -27,9 +27,11 @@ enum pt_capabilities { > #if defined(CONFIG_PERF_EVENTS) && defined(CONFIG_CPU_SUP_INTEL) > void cpu_emergency_stop_pt(void); > extern u32 pt_cap_get(enum pt_capabilities cap); > +extern u32 __pt_cap_get(u32 *caps, enum pt_capabilities cap); I'd call it something like pt_cap_decode().