From: "Jan Beulich" Subject: Re: [PATCH v6 16/19] x86/VPMU: Save VPMU state for PV guests during context switch Date: Mon, 26 May 2014 13:03:39 +0100 Message-ID: <538349BB0200007800015C65@mail.emea.novell.com> References: <1399996413-1998-1-git-send-email-boris.ostrovsky@oracle.com> <1399996413-1998-17-git-send-email-boris.ostrovsky@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1399996413-1998-17-git-send-email-boris.ostrovsky@oracle.com> Content-Disposition: inline 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, suravee.suthikulpanit@amd.com, andrew.cooper3@citrix.com, donald.d.dugger@intel.com, xen-devel@lists.xen.org, dietmar.hahn@ts.fujitsu.com, jun.nakajima@intel.com List-Id: xen-devel@lists.xenproject.org >>> On 13.05.14 at 17:53, wrote: > Save VPMU state during context switch for both HVM and PV guests unless we > are in PMU privileged mode (i.e. dom0 is doing all profiling). > > Signed-off-by: Boris Ostrovsky > Acked-by: Kevin Tian May I ask that you don't put in inapplicable acks - there's no VMX code being modfied here, i.e. the above either should be dropped or become a Reviewed-by. > Reviewed-by: Dietmar Hahn > Tested-by: Dietmar Hahn Acked-by: Jan Beulich > --- > xen/arch/x86/domain.c | 12 +++++------- > 1 file changed, 5 insertions(+), 7 deletions(-) > > diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c > index 4a122da..a853071 100644 > --- a/xen/arch/x86/domain.c > +++ b/xen/arch/x86/domain.c > @@ -1478,16 +1478,14 @@ void context_switch(struct vcpu *prev, struct vcpu > *next) > } > > if ( prev != next ) > - _update_runstate_area(prev); > - > - if ( is_hvm_vcpu(prev) ) > { > - if ( (prev != next) && (vpmu_mode & XENPMU_MODE_ON) ) > + _update_runstate_area(prev); > + if ( vpmu_mode & XENPMU_MODE_ON ) > vpmu_save(prev); > + } > > - if ( !list_empty(&prev->arch.hvm_vcpu.tm_list) ) > + if ( is_hvm_vcpu(prev) && !list_empty(&prev->arch.hvm_vcpu.tm_list) ) > pt_save_timer(prev); > - } > > local_irq_disable(); > > @@ -1526,7 +1524,7 @@ void context_switch(struct vcpu *prev, struct vcpu > *next) > !is_hardware_domain(next->domain)); > } > > - if ( is_hvm_vcpu(next) && (prev != next) && (vpmu_mode & XENPMU_MODE_ON) ) > + if ( (prev != next) && (vpmu_mode & XENPMU_MODE_ON) ) > /* Must be done with interrupts enabled */ > vpmu_load(next); > > -- > 1.8.1.4