[PATCH] D40423: [ARM][AArch64] Workaround ARM/AArch64 percularity in clearing icache.

James Greenhalgh via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 24 05:50:50 PST 2017


jgreenhalgh added a comment.

In https://reviews.llvm.org/D40423#934427, @maxim-kuvyrkov wrote:

> In https://reviews.llvm.org/D40423#934358, @jgreenhalgh wrote:
>
> >
>
>
> ...
>
> > So the change makes sense, but the references to Armv8.2-A look wrong to me.
>
> I've checked the docs once again, and, indeed, they don't mention Armv8.2, so I'll remove the reference.  However, judging from cursory read of https://patchwork.kernel.org/patch/9275721/ , it appears only Armv8.2 kernels would set EXECUTE_ONLY bits on the pages, kernels for Armv8.[01] would set READ permissions on EXEC pages as well.


My reading (confirmed by our kernel team here) is that you'll be EXECUTE_ONLY at all architecture levels. The difference is that prior to Armv8.2 you don't have a Privileged Access Never (PAN) bit, so EL1 (kernel) can read EL0 (user)'s execute only data. With PAN+UAO in Armv8.2-A, even the kernel can't read the user execute only data.

So this code has likely always been buggy for AArch64, we just didn't see it on Linux systems until Linux 4.9 (4.10?) started allowing use of execute-only user permissions.


https://reviews.llvm.org/D40423





More information about the llvm-commits mailing list