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

Re: [Xen-devel] [PATCH RFC] xsm: use XSM instead of IS_PRIV where duplicated



>>> On 30.07.12 at 21:49, Daniel De Graaf <dgdegra@xxxxxxxxxxxxx> wrote:
> --- a/xen/arch/x86/mm.c
> +++ b/xen/arch/x86/mm.c
> @@ -4790,8 +4790,10 @@ long arch_memory_op(int op, XEN_GUEST_HANDLE(void) arg)
>          XEN_GUEST_HANDLE(e820entry_t) buffer;
>          unsigned int i;
>  
> +#ifndef XSM_ENABLE
>          if ( !IS_PRIV(current->domain) )
>              return -EINVAL;
> +#endif

This recurring a number of times probably warrants some
abstraction, to avoid the #ifdef-ery?

> --- a/xen/arch/x86/physdev.c
> +++ b/xen/arch/x86/physdev.c
> @@ -430,12 +430,15 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE(void) 
> arg)
>          ret = -EFAULT;
>          if ( copy_from_guest(&apic, arg, 1) != 0 )
>              break;
> -        ret = -EPERM;
> -        if ( !IS_PRIV(v->domain) )
> -            break;
> +#ifdef XSM_ENABLE
>          ret = xsm_apic(v->domain, cmd);
>          if ( ret )
>              break;
> +#else
> +        ret = -EPERM;
> +        if ( !IS_PRIV(v->domain) )
> +            break;
> +#endif

Can't this be moved into the dummy stub, just like for other
cases?

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