On Tue, Nov 03, 2020 at 03:49:32PM +0000, Nikos Nikoleris wrote: > > > diff --git a/lib/arm64/asm/page.h b/lib/arm64/asm/page.h > > > index 46af552..2a06207 100644 > > > --- a/lib/arm64/asm/page.h > > > +++ b/lib/arm64/asm/page.h > > > @@ -10,38 +10,51 @@ > > > * This work is licensed under the terms of the GNU GPL, version 2. > > > */ > > > +#include <config.h> > > > #include <linux/const.h> > > > -#define PGTABLE_LEVELS 2 > > > #define VA_BITS 42 > > > > Let's bump VA_BITS to 48 while we're at it. I tried my suggestion to go to 48 VA bits, but it seems to break things for 64K pages. > > > > > +#define PAGE_SIZE CONFIG_PAGE_SIZE > > > > I see now how we had '%d' in the other patch for PAGE_SIZE > > instead of %ld. To keep a UL like it is for arm and x86, > > then we can add the UL to CONFIG_PAGE_SIZE in configure. > > > > I realised the problem as soon as I reorderd the two changes. I have now > added UL to CONFIG_PAGE_SIZE. > > > > +#if PAGE_SIZE == 65536 > > > #define PAGE_SHIFT 16 > > > -#define PAGE_SIZE (_AC(1,UL) << PAGE_SHIFT) > > > +#elif PAGE_SIZE == 16384 > > > +#define PAGE_SHIFT 14 > > > +#elif PAGE_SIZE == 4096 > > > +#define PAGE_SHIFT 12 > > I've also reordered things a little in <libclat.h> so that I can use SZ_4K, > SZ_16K and SZ_64K here too. Sounds good to me, as long as we can have PAGE_SIZE and PAGE_SHIFT defined in assembly too. Thanks, drew