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

Re: [Xen-devel] [PATCH v3] xen/mm: Fix page_list_* helpers to evaluate all their arguments



On 07/03/16 18:12, Andrew Cooper wrote:
> If an architecture does not provide a custom page_list_entry, default
> page_list_* helpers are provided, wrapping list_head as an underlying type for
> page_list_head.
> 
> The two declarations of the page_list_* helpers differ between defines and
> static inline functions, where the defines discard some of their parameters.
> 
> This causes a compilation failure if CONFIG_BIGMEM and debug=n in p2m-pod.c:
> 
>   p2m-pod.c: In function ‘p2m_pod_cache_add’:
>   p2m-pod.c:72:20: error: unused variable ‘d’ [-Werror=unused-variable]
>        struct domain *d = p2m->domain;
>                       ^
>   cc1: all warnings being treated as errors
> 
> because the use of d outside of the !NDEBUG section doesn't get evaluated as a
> parameter by page_list_del().
> 
> Fix this by turning all #defines into static inline functions, so all
> parameters are evaluated even if they are not used.
> 
> This reveals a build issue on ARM.  page_alloc.c references
> d->arch.relmem_list in the previously-discarded parameter.  Fix this by
> introducing relmem_list for ARM (currently unused).
> 
> While editing this area, correct the return type of page_list_empty from int
> to bool_t.
> 
> Reported-by: Doug Goldstein <cardoe@xxxxxxxxxx>
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> Reviewed-by: Doug Goldstein <cardoe@xxxxxxxxxx>

FWIW this patch is fine with me as it is:

Acked-by: George Dunlap <george.dunlap@xxxxxxxxxx>

But properly fixing the common code not to reference an arch-specific
data structure would be even better, if you've got the time and
motivation to do it.


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