[lld] r249760 - [ELF2] Make the system page size a target-dependent property

Sean Silva via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 13 17:42:49 PDT 2015


On Mon, Oct 12, 2015 at 12:39 PM, Hal Finkel via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> ----- Original Message -----
> > From: "Rafael EspĂ­ndola" <rafael.espindola at gmail.com>
> > To: "Hal Finkel" <hfinkel at anl.gov>
> > Cc: "llvm-commits" <llvm-commits at lists.llvm.org>
> > Sent: Friday, October 9, 2015 8:45:20 AM
> > Subject: Re: [lld] r249760 - [ELF2] Make the system page size a
> target-dependent property
> >
> > > The required page alignment is different on different targets. On
> > > PowerPC, for
> > > example, we need 64K pages (the loader won't set different
> > > permissions on a
> > > finer granularity than that). I've set the existing targets to what
> > > I believe
> > > to be the correct values, and have updated the regression tests
> > > accordingly.
> >
> > Can you make this a comment is the code? For someone reading it now
> > it
> > would look like a bug since the hardware itself uses 4k pages, no?
>
> I added a comment in r250087. To be honest, I don't understand myself why
> this is necessary, as I agree the underlying system page size is smaller,
> but experimentally, this is certainly necessary to get the loader to set
> the memory permissions correctly. Also, this matches what ld.gold does.
>


I'm guessing that your kernel is built with CONFIG_PPC_64K_PAGES.

There is a distinction between the hardware page size and the software page
size ("kernel logical page size"). The software page size doesn't
necessarily match the hardware page size (but will always be >= the
hardware page size, obviously); it basically just determines the unit of
mmap and such. For more info on why you would want to do that even without
hardware pages of that size, see
https://github.com/torvalds/linux/blob/2965faa5e03d1e71e9ff9aa143fff39e0a77543a/arch/powerpc/Kconfig#L551

-- Sean Silva


>
> Thanks again,
> Hal
>
> >
> > Cheers,
> > Rafael
> >
>
> --
> Hal Finkel
> Assistant Computational Scientist
> Leadership Computing Facility
> Argonne National Laboratory
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151013/d79ac7c5/attachment.html>


More information about the llvm-commits mailing list