From: Daniel De Graaf Subject: Re: [PATCH v11 for-xen-4.5 11/20] x86/VPMU: Interface for setting PMU mode and flags Date: Tue, 23 Sep 2014 16:47:47 -0400 Message-ID: <5421DC73.9030803@tycho.nsa.gov> References: <1411430281-6132-1-git-send-email-boris.ostrovsky@oracle.com> <1411430281-6132-12-git-send-email-boris.ostrovsky@oracle.com> <20140923185810.GW3007@laptop.dumpdata.com> <5421C90B.5080505@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <5421C90B.5080505@oracle.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Boris Ostrovsky Cc: kevin.tian@intel.com, keir@xen.org, jbeulich@suse.com, jun.nakajima@intel.com, andrew.cooper3@citrix.com, tim@xen.org, dietmar.hahn@ts.fujitsu.com, xen-devel@lists.xen.org, Aravind.Gopalakrishnan@amd.com, suravee.suthikulpanit@amd.com List-Id: xen-devel@lists.xenproject.org On 09/23/2014 03:24 PM, Boris Ostrovsky wrote: > On 09/23/2014 02:58 PM, Konrad Rzeszutek Wilk wrote: >> On Mon, Sep 22, 2014 at 07:57:52PM -0400, Boris Ostrovsky wrote: >>> Add runtime interface for setting PMU mode and flags. Three main modes are >>> provided: >>> * XENPMU_MODE_OFF: PMU is not virtualized >>> * XENPMU_MODE_SELF: Guests can access PMU MSRs and receive PMU interrupts. >>> * XENPMU_MODE_HV: Same as XENPMU_MODE_SELF for non-proviledged guests, dom0 >>> can profile itself and the hypervisor. >>> >>> Note that PMU modes are different from what can be provided at Xen's boot line >>> with 'vpmu' argument. An 'off' (or '0') value is equivalent to XENPMU_MODE_OFF. >>> Any other value, on the other hand, will cause VPMU mode to be set to >>> XENPMU_MODE_SELF during boot. >>> >>> For feature flags only Intel's BTS is currently supported. >>> >>> Mode and flags are set via HYPERVISOR_xenpmu_op hypercall. >> I forgot to mention that we should probably also include the XSM calls. >> (And CC the maintainer of it). >> >> For examples, see the claim (919f59b3b99e1d845c6a1f30125e79e828805d87) or >> vnmua (40c7af684fc0bf89c7b643a5492b4abd920fba86) patches. > > (+ Daniel) > > I haven't looked at XSM in a few months but I remember when I tried to use XSM for this I found that we ran out of bits for a new hypercall in the permission vector. (I actually mention this in the cover letter, but it's way way down) > > The two commits that you refer to are using existing hypercalls. > > -boris The solution to running out of bits is to create another class in order to hold the new permissions, as has already been done for domain/domain2. The CQM patches (v15 03/11) already define a class xen2, so you may want to base on top of it so that patches don't conflict (or whatever is preferred based on the patchesets' relative readiness). -- Daniel De Graaf National Security Agency