From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boris Ostrovsky Subject: Re: [PATCH v12 for-xen-4.5 11/20] x86/VPMU: Interface for setting PMU mode and flags Date: Tue, 30 Sep 2014 20:56:31 -0400 Message-ID: <542B513F.6010001@oracle.com> References: <1411673336-32736-1-git-send-email-boris.ostrovsky@oracle.com> <1411673336-32736-12-git-send-email-boris.ostrovsky@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: "Tian, Kevin" , "jbeulich@suse.com" , "suravee.suthikulpanit@amd.com" , "Aravind.Gopalakrishnan@amd.com" , "dietmar.hahn@ts.fujitsu.com" , "dgdegra@tycho.nsa.gov" Cc: "andrew.cooper3@citrix.com" , "xen-devel@lists.xen.org" , "keir@xen.org" , "Nakajima, Jun" , "tim@xen.org" List-Id: xen-devel@lists.xenproject.org On 09/30/2014 08:48 PM, Tian, Kevin wrote: >> From: Boris Ostrovsky [mailto:boris.ostrovsky@oracle.com] >> Sent: Thursday, September 25, 2014 12:29 PM >> >> 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. >> >> Signed-off-by: Boris Ostrovsky >> Reviewed-by: Konrad Rzeszutek Wilk > In general it's OK to me: > Acked-by: Kevin Tian > > Just a small comment: > >> +static void vpmu_sched_checkin(unsigned long unused) >> +{ >> + atomic_inc(&vpmu_sched_counter); >> +} >> + >> +static int vpmu_force_context_switch(void) >> +{ >> + unsigned i, j, allbutself_num, mycpu; >> + static s_time_t start, now; > any reason of such static variables when there's no continuation any more? No reason at all. They are gone in v13. Thanks. -boris