[PATCH] D37788: [ARM] builtins: Do not abort in clear_cache.

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 25 11:43:00 PDT 2017


peter.smith added a comment.

In https://reviews.llvm.org/D37788#879519, @manojgupta wrote:

> An example of this idion usage: make_executable() function in https://github.com/pathscale/libunwind/blob/vanilla_pathscale/tests/ia64-test-dyn1.c
>
> I verified that running the above code  in a sample program (with a mmap'ed()'s memory buffer) aborts the program with compiler-rt but not libgcc.


If I understand correctly the use of mprotect in that example leaves the pages readable and executable, but removes write access? As far as I can tell the memory doesn't need to be readable for cache clear instructions to work so I am surprised that an abort is happening.

What I'd like to know is if the libgcc implementation is reporting failure and ignoring it, in which case there might be something fundamentally wrong, or maybe the system call on your kernel the syscall doesn't report the error in r0, in which case compiler-rt is reading random garbage. Apologies I'm at a conference this week and can't check any of this myself, would you be able to:

- Check your kernel to see what its implementation of the syscall does? If it doesn't return anything useful in R0 we have our answer.
- Check the return value from the syscall from libgcc, or some clone of it?


https://reviews.llvm.org/D37788





More information about the llvm-commits mailing list