Hi,
We have a need on OpenJDK to flush the entire icache. Basically this need occurs when we do a garbage collection which may include garbage collection and patching of the dynamically generated code.
Problem is, the IC IALLUIS instruction which we need is only executable from EL1 or greater.
Is there any kernel hook to flush then entire icache.
Thanks for your help, Ed.
On 29 August 2014 13:02, Edward Nevill edward.nevill@linaro.org wrote:
We have a need on OpenJDK to flush the entire icache. Basically this need occurs when we do a garbage collection which may include garbage collection and patching of the dynamically generated code.
Surely, you could restrict the icache flush to the JIT heap, right? There is a __builtin___clear_cache() function in GCC which maps onto __clear_cache() in libgcc for AArch64, but it takes a begin and end pointer.
Yes... but the JIT heap is 128Mb, and the way it flushes the cache is to do an IC IVAU on every virtual cache line address from start .. end.
That could be up to 2E6 cache flush operations.
We had hoped that IC IALLUIS would be faster.
Maybe we end up doing this. It seems absolutely daft to me IALLUIS is not EL0.
Regards, Ed.
On Fri, 2014-08-29 at 13:52 +0200, Ard Biesheuvel wrote:
On 29 August 2014 13:02, Edward Nevill edward.nevill@linaro.org wrote:
We have a need on OpenJDK to flush the entire icache. Basically this need occurs when we do a garbage collection which may include garbage collection and patching of the dynamically generated code.
Surely, you could restrict the icache flush to the JIT heap, right? There is a __builtin___clear_cache() function in GCC which maps onto __clear_cache() in libgcc for AArch64, but it takes a begin and end pointer.
On 08/29/2014 07:52 AM, Ard Biesheuvel wrote:
On 29 August 2014 13:02, Edward Nevill edward.nevill@linaro.org wrote:
We have a need on OpenJDK to flush the entire icache. Basically this need occurs when we do a garbage collection which may include garbage collection and patching of the dynamically generated code.
Surely, you could restrict the icache flush to the JIT heap, right? There is a __builtin___clear_cache() function in GCC which maps onto __clear_cache() in libgcc for AArch64, but it takes a begin and end pointer.
Ooh. Maybe I can rewrite my trivial JIT code in C.
https://github.com/xemul/criu/blob/master/arch/aarch64/intraprocedure.S
Thanks, Christopher