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

Re: [Xen-devel] [PATCH v4 03/34] xsm/xen_version: Add XSM for the xen_version hypercall



>>> On 18.03.16 at 18:26, <konrad.wilk@xxxxxxxxxx> wrote:
> On Fri, Mar 18, 2016 at 05:55:55AM -0600, Jan Beulich wrote:
>> >>> On 15.03.16 at 18:56, <konrad.wilk@xxxxxxxxxx> wrote:
>> > @@ -223,12 +224,15 @@ void __init do_initcalls(void)
>> >  /*
>> >   * Simple hypercalls.
>> >   */
>> > -
>> >  DO(xen_version)(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
>> 
>> Please retain the blank line, as it relates to more than just this
>> one function.
> 
> Done! (stray change).

Considering this I'm not puzzled by ...

>      case XENVER_guest_handle:
> -        if ( copy_to_guest(arg, current->domain->handle,
> -                           ARRAY_SIZE(current->domain->handle)) )
> +    {
> +        xen_domain_handle_t hdl;
> +
> +        if ( deny )
> +            memset(&hdl, 0, ARRAY_SIZE(hdl));
> +
> +        BUILD_BUG_ON(ARRAY_SIZE(current->domain->handle) != ARRAY_SIZE(hdl));
> +
> +        if ( copy_to_guest(arg, deny ? hdl : current->domain->handle,
> +                           ARRAY_SIZE(hdl) ) )
>              return -EFAULT;
>          return 0;
> -
> +    }
>      case XENVER_commandline:

... this.

> --- a/xen/include/xsm/dummy.h
> +++ b/xen/include/xsm/dummy.h
> @@ -727,3 +727,27 @@ static XSM_INLINE int xsm_pmu_op (XSM_DEFAULT_ARG struct 
> domain *d, unsigned int
>  }
>  
>  #endif /* CONFIG_X86 */
> +
> +#include <public/version.h>
> +static XSM_INLINE int xsm_xen_version (XSM_DEFAULT_ARG uint32_t op)
> +{
> +    XSM_ASSERT_ACTION(XSM_OTHER);
> +    switch ( op )
> +    {
> +    case XENVER_version:
> +    case XENVER_platform_parameters:
> +    case XENVER_get_features:
> +        /* The sub-ops ignores the permission check and returns data. */

ignore ... and return ...

With those minor things addressed I think the patch can have my ack.

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