Received: by 10.192.165.148 with SMTP id m20csp1816865imm; Thu, 3 May 2018 06:00:30 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrZj4T46ctOACUuss4TtG1Dax52+ugTpgKDmcrnmiNGl03P6OxTBy08CALffho2H+lxYRcD X-Received: by 2002:a17:902:265:: with SMTP id 92-v6mr23175975plc.368.1525352430034; Thu, 03 May 2018 06:00:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525352430; cv=none; d=google.com; s=arc-20160816; b=E8axsi4yZt7sD950jim6ODwgUjRntpFXYkXUNsaCQFmv2x9rbd4alcHjd2JhRuFbB0 V4AAFLNUVHJt31WgHFS5y71i4OxqLWRiRCGFLTO4HBcD0AefABFMJbJj8ushMJ4Rreh1 EsFXj4n0D0SYP5eBA0KdyFSktqCzPAar1H9gCm1W3SpmF96mbbSHh2zpqPU7ItwnBEcC 50K+efAMvo/WM8DCV17SVRT3qrz1/Gg8g8fdeJ1lXnwUZf1RsWSz3nOKojrcytVz0Yl6 xkP4QZDLfa7MNxxBe8puluFqZ4yKOAlh6zaLYwcnGBmXz8UkzMug2lAU2EQ9Wu58v76N k7Mg== 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=GLLLsArM6Cf9tjIfRUkACb6o7V/l4wDeD2Xj2kOqR2M=; b=z35QTVWxG47lIoj34WiB32i7WTmhbq8pzQ6tD4DYVAZMMqO1HrCtYv3LpVYQdR6uhe AdtCDAGCDAs4CV6VaAWJ30BfhK2q8N0xI8YU+eSH5CThTucYG6wTEdSZ+hRpMooL3u5Q JIogrtoUZpKLWK/tRJCS0E6ZWfvNGE96pR1B953e7Ja4zFwCeEMfL7v1LrAb2UxyFPni rq8fnplawwawp2jsHrNYD+loO/z3xe2NTHlt+gFlnwVEwLD9XXVWvTB06KpDbSoKG/On Q17cvl3qVREDB0wpZMPHluk0qXnaYQVXNp76xLXxFNP7NbU2+WTN3VM+eLdz7z6oCmY3 ks4A== 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 38-v6si13828086pln.390.2018.05.03.06.00.16; Thu, 03 May 2018 06:00:30 -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 S1751055AbeECM7f (ORCPT + 99 others); Thu, 3 May 2018 08:59:35 -0400 Received: from mga14.intel.com ([192.55.52.115]:43553 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751064AbeECM7c (ORCPT ); Thu, 3 May 2018 08:59:32 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 May 2018 05:59:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,358,1520924400"; d="scan'208";a="52089931" Received: from um.fi.intel.com (HELO um) ([10.237.72.212]) by fmsmga001.fm.intel.com with ESMTP; 03 May 2018 05:59:28 -0700 Received: from ash by um with local (Exim 4.90_1) (envelope-from ) id 1fEDpW-0000RB-T7; Thu, 03 May 2018 15:59:26 +0300 Date: Thu, 3 May 2018 15:59:26 +0300 From: Alexander Shishkin To: "Kang, Luwei" Cc: Paolo Bonzini , Alexander Shishkin , "kvm@vger.kernel.org" , "tglx@linutronix.de" , "mingo@redhat.com" , "hpa@zytor.com" , "x86@kernel.org" , "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: <20180503125926.watdzpaleo27awuk@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> <20180503105032.h73n5lcrwkdbahgm@um.fi.intel.com> <82D7661F83C1A047AF7DC287873BF1E167F6DDCE@SHSMSX101.ccr.corp.intel.com> <20180503121301.nlbm4cotbv26tc7l@um.fi.intel.com> <82D7661F83C1A047AF7DC287873BF1E167F6DFFA@SHSMSX101.ccr.corp.intel.com> <349c6c61-6b6a-31b8-c8c5-24aed5716929@redhat.com> <82D7661F83C1A047AF7DC287873BF1E167F6E0B4@SHSMSX101.ccr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <82D7661F83C1A047AF7DC287873BF1E167F6E0B4@SHSMSX101.ccr.corp.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 12:50:48PM +0000, Kang, Luwei wrote: > > >> Can you elaborate on this, what information do we need besides > > >> MSR_IA32_VMX_MISC[14]? > > > > > > Enable Intel PT in guest depend on SECONDARY_EXEC_PT_USE_GPA, EPT, > > > MSR_IA32_VMX_MISC[14] and the capability of " PT_CAP_topa_output" on > > > hardware. PT driver will return " -ENODEV" if hardware not support > > > "PT_CAP_topa_output". > > > > I actually don't understand why PT_CAP_topa_output matters for the purpose of enabling PT in the guest. However you still need > > __pt_cap_get() in the CPUID checks. > > Hi Paolo, > I think we should expose Intel Processor Trace to guest that can be detected and initialized. But without "PT_CAP_topa_output" Intel PT can't work in Linux. So I add this feature as precondition. > About why need this check in driver I think Alexander may know the reason. The driver only operates on ToPA at the moment, so if PT doesn't support it, there's nothing for the driver to do. But other things, such as simple_pt, might still be functional without CAP_topa_output, so it still makes sense to virtualize it. Regards, -- Alex