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

Hal Finkel via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 14 03:06:42 PDT 2015


----- Original Message -----
> From: "Sean Silva" <chisophugis at gmail.com>
> To: "Hal Finkel" <hfinkel at anl.gov>
> Cc: "Rafael EspĂ­ndola" <rafael.espindola at gmail.com>, "llvm-commits" <llvm-commits at lists.llvm.org>
> Sent: Tuesday, October 13, 2015 7:42:49 PM
> Subject: Re: [lld] r249760 - [ELF2] Make the system page size a target-dependent property
> 
> 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
> 

Your guess is correct, the kernel on that box has this:

  CONFIG_PPC_64K_PAGES=y

and I imagine that to be the RHEL default.

Thanks again,
Hal

> 
> -- 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
> 
> 

-- 
Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory


More information about the llvm-commits mailing list