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

Re: [Xen-devel] [PATCH 2/2] xen: add update indicator to vcpu_runstate_info



On 20/05/16 14:22, Juergen Gross wrote:
> diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
> index 1365b4a..91f256b 100644
> --- a/xen/arch/arm/domain.c
> +++ b/xen/arch/arm/domain.c
> @@ -239,10 +239,32 @@ static void ctxt_switch_to(struct vcpu *n)
>  /* Update per-VCPU guest runstate shared memory area (if registered). */
>  static void update_runstate_area(struct vcpu *v)
>  {
> +    bool_t update_flag;
> +    void __user *guest_handle = NULL;
> +    unsigned off = 0;
> +
>      if ( guest_handle_is_null(runstate_guest(v)) )
>          return;
>  
> +    update_flag = VM_ASSIST(v->domain, runstate_update_flag);
> +    if ( update_flag )
> +    {
> +        off = offsetof(struct vcpu_runstate_info, state_entry_time) + 7;
> +        guest_handle = v->runstate_guest.p;
> +        guest_handle += off;
> +        v->runstate.state_entry_time |= XEN_RUNSTATE_UPDATE;
> +        __raw_copy_to_guest(guest_handle, (void *)&v->runstate + off, 1);
> +        wmb();

smp_wmb(), throughout.

A whole lot of code gets this wrong in Xen, and plan to clean it all up
in 4.8

~Andrew

_______________________________________________
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®.