-
Notifications
You must be signed in to change notification settings - Fork 308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Calls to __clear_cache() require pointer arguments #239
Comments
Ping for @aswaterman as he is the author of the affected piece of code. |
I think we can replace this one with an asm volatile fence.i. If you make such a PR, I’ll merge it. |
cmuellner
added a commit
to cmuellner/riscv-pk
that referenced
this issue
Apr 28, 2021
Using recent compilers we get the following error message: ../pk/pk.c: In function 'run_loaded_program.constprop': ../pk/pk.c:177:3: error: both arguments to '__builtin___clear_cache' must be pointers 177 | __clear_cache(0, 0); | ^~~~~~~~~~~~~~~~~~~ Let's use the existing function __riscv_flush_icache(), give it a header with a prototype and use it to emits the FENCE.I instruction directly. See riscv-software-src#239 Suggested-by: Andrew Waterman <andrew@sifive.com> Signed-off-by: Christoph Muellner <cmuellner@linux.com>
The required code was already there. Just needed to be called. |
aswaterman
pushed a commit
that referenced
this issue
Apr 28, 2021
Using recent compilers we get the following error message: ../pk/pk.c: In function 'run_loaded_program.constprop': ../pk/pk.c:177:3: error: both arguments to '__builtin___clear_cache' must be pointers 177 | __clear_cache(0, 0); | ^~~~~~~~~~~~~~~~~~~ Let's use the existing function __riscv_flush_icache(), give it a header with a prototype and use it to emits the FENCE.I instruction directly. See #239 Suggested-by: Andrew Waterman <andrew@sifive.com> Signed-off-by: Christoph Muellner <cmuellner@linux.com>
Resolved by #240. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When compiling with a recent version of GCC, we run into the following error:
The error comes from the fact, that we pass numeric values as arguments to the invocation of __clear_cache.
Using
(void*)0
orNULL
instead of0
does not work either.My understanding of the code is, that we know that we can only clear the complete instruction cache and therefore we don't care about the arguments. Is this assumption correct?
This error has been introduced by the GCC commit c05ece9 in Dec 2020.
I have created a GCC bug report (PR100316) as well.
The text was updated successfully, but these errors were encountered: