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

Re: [Xen-devel] [PATCH v4 1/2] x86/hvm: Always do SMAP check when updating runstate_guest(v)



>>> On 30.07.14 at 03:35, <feng.wu@xxxxxxxxx> wrote:
> @@ -1349,22 +1357,33 @@ static void paravirt_ctxt_switch_to(struct vcpu *v)
>  }
>  
>  /* Update per-VCPU guest runstate shared memory area (if registered). */
> -bool_t update_runstate_area(const struct vcpu *v)
> +bool_t update_runstate_area(struct vcpu *v)
>  {
> +    bool_t rc;
> +    smap_check_policy_t smap_policy;
> +
>      if ( guest_handle_is_null(runstate_guest(v)) )
>          return 1;
>  
> +    smap_policy = smap_policy_change(v, SMAP_CHECK_ENABLED);
> +
>      if ( has_32bit_shinfo(v->domain) )
>      {
>          struct compat_vcpu_runstate_info info;
>  
>          XLAT_vcpu_runstate_info(&info, &v->runstate);
>          __copy_to_guest(v->runstate_guest.compat, &info, 1);
> -        return 1;
> +        smap_policy_change(v, smap_policy);
> +        rc = 1;
> +    }
> +    else
> +    {
> +        rc = __copy_to_guest(runstate_guest(v), &v->runstate, 1) !=
> +             sizeof(v->runstate);
> +        smap_policy_change(v, smap_policy);
>      }

The common smap_policy_change(v, smap_policy) should have been
pulled out of the if and else parts. I'll see to remember doing this when
committing (assuming that not other issue with the patch gets spotted
by someone else).

Jan


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