cakeml icon indicating copy to clipboard operation
cakeml copied to clipboard

Update ARM8 export for EVAL

Open tanyongkiam opened this issue 1 year ago • 2 comments

It should be possible to run eval on ARMv8 on non-Mac machines at least.

tanyongkiam avatar Jun 03 '24 07:06 tanyongkiam

Does anyone remember what was the issue here?

EVAL requires a safe way to write code then execute it. At the moment that's done by setting the EVAL code buffer read-write-execute (which Linux permits, Mac forbids, etc). It hypothetically also requires a flush operation that synchronizes hardware state after writing the code and before executing any of it. If I remember right, the hook point for this might not exist, which doesn't matter on x64 since the sync operation is a no-op anyway.

talsewell avatar Jun 26 '24 05:06 talsewell

You will have to switch between write and exec after you write new code, but I don’t remember the details. But this should explain it: https://developer.apple.com/documentation/apple-silicon/porting-just-in-time-compilers-to-apple-silicon

oskarabrahamsson avatar Jun 26 '24 06:06 oskarabrahamsson