[PATCH v7 5/7] arm64: vmemmap: Avoid base2 order of struct page size to dimension region

Catalin Marinas catalin.marinas at arm.com
Fri Feb 9 09:33:23 PST 2024


On Wed, Dec 13, 2023 at 02:39:30PM +0000, Mark Rutland wrote:
> > On Wed, 13 Dec 2023 at 14:49, Mark Rutland <mark.rutland at arm.com> wrote:
> > > | #define GUARD_VA_SIZE          (UL(SZ_8M))
> > > |
> > > | #define FIXADDR_TOP            (-GUARD_VA_SIZE)
> > > | #define FIXADDR_SIZE_MAX       SZ_8M
> > > | #define FIXADDR_START_MIN      (FIXADDR_TOP - FIXADDR_SIZE_MAX)
> > > |
> > > | #define PCI_IO_END             (FIXADDR_START_MIN - GUARD_VA_SIZE)
> > > | #define PCI_IO_START           (PCI_IO_END - PCI_IO_SIZE)
> > > |
> > > | #define VMEMMAP_END            (ALIGN_DOWN(PCI_IO_START - GUARD_VA_SIZE, SZ_1G))
> > > | #define VMEMMAP_START          (VMEMMAP_END - VMEMMAP_SIZE)
> > >
> > > ... and in fixmap.h have:
> > >
> > > /* Ensure the estimate in memory.h was big enough */
> > > static_assert(FIXADDR_SIZE_MAX > FIXADDR_SIZE);
[...]
> What I'm trying to do is make the relationship between those regions clear *in
> one place*, so that this is easier to follow, as that was one of the things I
> found painful during review. That said, it's not clear cut, and I'll happily
> defer to the judgement of Will and Catalin.

I think Mark's proposal is slightly cleaner. There's no actual layout
change, just making the maximum fixaddr size explicit in memory.h.

I'm queuing this series, so Mark please send a patch on top (I'll kick
off b4 ty soon).

Thanks.

-- 
Catalin



More information about the linux-arm-kernel mailing list