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

Re: [Xen-devel] [PATCH v2 02/10] xen: arm: Add zeroeth level page table macros and defines



At 14:31 +0100 on 07 Aug (1375885891), Ian Campbell wrote:
> --- a/xen/include/asm-arm/page.h
> +++ b/xen/include/asm-arm/page.h
> @@ -337,7 +337,15 @@ static inline int gva_to_ipa(vaddr_t va, paddr_t *paddr)
>  #define second_table_offset(va) TABLE_OFFSET(second_linear_offset(va))
>  #define third_table_offset(va)  TABLE_OFFSET(third_linear_offset(va))
>  
> -#define clear_page(page)memset((void *)(page), 0, PAGE_SIZE)
> +#ifdef CONFIG_ARM_64
> +#define ZEROETH_SHIFT  (FIRST_SHIFT + LPAE_SHIFT)
> +#define ZEROETH_SIZE   (1u << ZEROETH_SHIFT)
> +#define ZEROETH_MASK   (~(ZEROETH_SIZE - 1))
> +#define zeroeth_linear_offset(va) ((va) >> ZEROETH_SHIFT)
> +#define zeroeth_table_offset(va)  TABLE_OFFSET(zeroeth_linear_offset(va))
> +#endif

I'd prefer to see these defined alongside the other levels.  There's no
harm in defining them on 32-bit builds.  Also, please update the comment
above LPAE_SHIFT to describe the 4-level alternative. 

Cheers,

Tim.

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