[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v5 RESEND 14/17] x86/VPMU: Save VPMU state for PV guests during context switch



> From: Boris Ostrovsky [mailto:boris.ostrovsky@xxxxxxxxxx]
> Sent: Wednesday, April 23, 2014 8:51 PM
> 
> 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 <boris.ostrovsky@xxxxxxxxxx>

Acked-by: Kevin Tian <kevin.tian@xxxxxxxxx>

> ---
>  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 b389abc..87c3a02 100644
> --- a/xen/arch/x86/domain.c
> +++ b/xen/arch/x86/domain.c
> @@ -1461,16 +1461,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();
> 
> @@ -1508,7 +1506,7 @@ void context_switch(struct vcpu *prev, struct vcpu
> *next)
>                             (next->domain->domain_id != 0));
>      }
> 
> -    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.3.1


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.