<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 12, 2015 at 12:39 PM, Hal Finkel via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="">----- Original Message -----<br>
> From: "Rafael Espíndola" <<a href="mailto:rafael.espindola@gmail.com">rafael.espindola@gmail.com</a>><br>
> To: "Hal Finkel" <<a href="mailto:hfinkel@anl.gov">hfinkel@anl.gov</a>><br>
> Cc: "llvm-commits" <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>><br>
> Sent: Friday, October 9, 2015 8:45:20 AM<br>
> Subject: Re: [lld] r249760 - [ELF2] Make the system page size a target-dependent property<br>
><br>
> > The required page alignment is different on different targets. On<br>
> > PowerPC, for<br>
> > example, we need 64K pages (the loader won't set different<br>
> > permissions on a<br>
> > finer granularity than that). I've set the existing targets to what<br>
> > I believe<br>
> > to be the correct values, and have updated the regression tests<br>
> > accordingly.<br>
><br>
> Can you make this a comment is the code? For someone reading it now<br>
> it<br>
> would look like a bug since the hardware itself uses 4k pages, no?<br>
<br>
</span>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.<br></blockquote><div><br></div><div><br></div><div>I'm guessing that your kernel is built with CONFIG_PPC_64K_PAGES.<br></div><div><br></div><div>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 <a href="https://github.com/torvalds/linux/blob/2965faa5e03d1e71e9ff9aa143fff39e0a77543a/arch/powerpc/Kconfig#L551">https://github.com/torvalds/linux/blob/2965faa5e03d1e71e9ff9aa143fff39e0a77543a/arch/powerpc/Kconfig#L551</a></div><div><br></div><div>-- Sean Silva</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
Thanks again,<br>
Hal<br>
<br>
><br>
> Cheers,<br>
> Rafael<br>
><br>
<span class=""><font color="#888888"><br>
--<br>
Hal Finkel<br>
Assistant Computational Scientist<br>
Leadership Computing Facility<br>
Argonne National Laboratory<br>
</font></span><div class=""><div class="h5">_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</div></div></blockquote></div><br></div></div>