[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



On Thu, 2013-08-08 at 12:08 +0100, Tim Deegan wrote:
> At 11:12 +0100 on 08 Aug (1375960367), Ian Campbell wrote:
> > On Thu, 2013-08-08 at 11:09 +0100, Tim Deegan wrote:
> > > 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.
> > 
> > My worry was that they would get used on 32-bit code paths by mistake,
> > which is a build error with this version but a (possibly obscure)
> > runtime error with the alternative.
> 
> Isn't at a build error to shift 32-bit values by 39 bits?

Good point, without checking I htink it is. Lets go with your suggested
change then.

>   I guess is
> more reliable, though; stet.
> 
> Tim.
> 
> > > Also, please update the comment above LPAE_SHIFT to describe the 4-level 
> > > alternative. 
> > 
> > Will do.
> > 
> > 
> > 
> > _______________________________________________
> > Xen-devel mailing list
> > Xen-devel@xxxxxxxxxxxxx
> > http://lists.xen.org/xen-devel
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxx
> http://lists.xen.org/xen-devel



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