From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boris Ostrovsky Subject: Re: patch for restricted vPMU modes Date: Mon, 23 Nov 2015 17:54:40 -0500 Message-ID: <56539930.8050600@oracle.com> References: <56532419.3010807@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Brendan Gregg Cc: Dietmar Hahn , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On 11/23/2015 05:01 PM, Brendan Gregg wrote: > > > On Mon, Nov 23, 2015 at 6:35 AM, Boris Ostrovsky > > wrote: > > > On 11/20/2015 07:21 PM, Brendan Gregg wrote: > > These new features would need a corresponding change in Linux for > PV guests (or for dom0 to change feature set globally). But before > that do_xenpmu_op()'s XENPMU_feature_set clause will have to be > updated to deal with new modes. > > > Ok, thanks. For now this is HVM, and I can EINVAL in do_xenpmu_op() > for the new modes, like with BTS. (Do you know if the later Linux > changes would be more than a feature version of > pmu_mode_store/pmu_mode_show?) You are right --- Linux doesn't need anything, it just passes the features directly to the hypervisor. pmu_mode_store/show convert strings to numbers but we don't use strings for features. So the only thing that's needed is to allow hypervisor set/clear those two bits in vpmu_features in do_xenpmu_op(). > > Also, if either of those two flags is set we probably want to > block MSR_IA32_DS_AREA and MSR_IA32_PEBS_ENABLE accesses as well. > > > Ok, yes, good idea. But: DS area is needed by BTS so if that feature is set we want to allow guests to write it (and as for PEBS (which also uses DS area) --- that's really a nop so whether or not you block it won't make any difference. But we should probably still do it). I don't know whether anyone else uses debug store. The way SDM's section 18.11.4 describes it there doesn't seem to be any other users. -boris