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

Re: [Xen-devel] [PATCH v5 1/2] xsm: rework policy_buffer globals



(Re-sending, as I got two bounces)

>>> On 07.07.16 at 17:35, <dgdegra@xxxxxxxxxxxxx> wrote:
> --- a/xen/xsm/flask/hooks.c
> +++ b/xen/xsm/flask/hooks.c
> @@ -1815,7 +1815,7 @@ static struct xsm_operations flask_ops = {
>      .xen_version = flask_xen_version,
>  };
>  
> -__init void flask_init(void)
> +__init void flask_init(const void *policy_buffer, size_t policy_size)

Please take the opportunity and move the __init to its more
conventional place:

void __init flask_init(const void *policy_buffer, size_t policy_size)

> --- a/xen/xsm/xsm_policy.c
> +++ b/xen/xsm/xsm_policy.c
> @@ -28,13 +28,12 @@
>  # include <xen/device_tree.h>
>  #endif
>  
> -char *__initdata policy_buffer = NULL;
> -u32 __initdata policy_size = 0;
> -
>  #ifdef CONFIG_MULTIBOOT
>  int __init xsm_multiboot_policy_init(unsigned long *module_map,
>                                       const multiboot_info_t *mbi,
> -                                     void *(*bootstrap_map)(const module_t 
> *))
> +                                     void *(*bootstrap_map)(const module_t 
> *),
> +                                     void **policy_buffer,
> +                                     size_t *policy_size)
>  {
>      int i;
>      module_t *mod = (module_t *)__va(mbi->mods_addr);
> @@ -56,8 +55,8 @@ int __init xsm_multiboot_policy_init(unsigned long 
> *module_map,
>  
>          if ( (xsm_magic_t)(*_policy_start) == XSM_MAGIC )
>          {
> -            policy_buffer = (char *)_policy_start;
> -            policy_size = _policy_len;
> +            *policy_buffer = (char *)_policy_start;
> +            *policy_size = _policy_len;

With *policy_buffer now being of type void * I don't think this cast is
necessary anymore (or if it is, then it certainly shouldn't needlessly
go through char *).

With at least this latter aspect adjusted
Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

Thanks for adding this patch,
Jan


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

 


Rackspace

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