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

James Greenhalgh via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 24 04:32:01 PST 2017


jgreenhalgh added a comment.

I'm confused by the title and rationale for this change. I don't think this has anything to do with Armv8.2-A and is instead a feature of Armv8-A.

Looking at C.5.12 in a recent release (ARM DDI 0487B.a) Arm Architecture Reference Manual I see "If EL0 access is enabled, when executing at EL0, this instruction requires read access permission to the VA, otherwise it is IMPLEMENTATION DEFINED whether it causes a Permission Fault." that text (or a close equivalent) looks to have been in the manual since the first release.

So the change makes sense, but the references to Armv8.2-A look wrong to me.



================
Comment at: lib/Support/Unix/Memory.inc:172
+  // to temporarily add PROT_READ for the sake of flushing the instruction caches.
+  if (InvalidateCache && !(Protect && PROT_READ)) {
+    int Result = ::mprotect((void *)Start, End - Start, Protect | PROT_READ);
----------------
Probably this should be !(Protect & PROT_READ)


https://reviews.llvm.org/D40423





More information about the llvm-commits mailing list