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

Re: [Xen-devel] [PATCH v11 5/9] xen/x86: use DECLARE_BOUNDS as required



Stefano Stabellini writes ("Re: [PATCH v11 5/9] xen/x86: use DECLARE_BOUNDS as 
required"):
> This is problematic. We have also the following instances in this series
> to deal with:
> 
> xen/arch/arm/percpu.c:_free_percpu_area
>   char *p = (char *)__per_cpu_start + __per_cpu_offset[cpu];
> 
> xen/arch/x86/percpu.c:_free_percpu_area
>   char *p = (char *)__per_cpu_start + __per_cpu_offset[cpu];
> 
> xen/arch/x86/setup.c:init_done
>   for ( va = (char *)__init_begin; init_lt(va, __init_end); va += PAGE_SIZE )
> 
> xen/arch/x86/alternative.c:apply_alternatives
>   for ( a = base = (struct alt_instr *)start; alt_instr_lt(a, end); a++ )

Presumably you will be writing some explanation as to why each of
these is OK ?

> In all these cases we actually end up modifying the object. I suggest
> we remove the const from either __DECLARE_BOUNDS (so from everywhere),
> or just for per_cpu, init, and alt_instr by introducing another MACRO.

My personal opinion is that you should:

 * Introduce a new macro DECLARE_BOUNDS_NONCONST.
 * Write a clear explanation of when DECLARE_BOUNDS_NONCONST is
   permitted and when DECLARE_BOUNDS must be used.
 * Implement both macros in terms of a common internal macro
   which takes an argument CONST which is empty or `const'.

Ian.

PS in prose, `macro' is written thus, not in all caps.  It is not an
acroynom; the etymology is from ancient Greek.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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