RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v9]

Anton Kozlov akozlov at openjdk.java.net
Thu Feb 4 15:16:49 UTC 2021

On Wed, 3 Feb 2021 20:08:28 GMT, Mikael Vidstedt <mikael at openjdk.org> wrote:

> Out of curiosity, have you looked at the performance of the W^X state transition?

Earlier it was possible to disable W^X protection (unfortunately, I don't know a way to do this now). We compared Renaissance results with W^X transitions like the proposed one vs. no transitions with the protection disabled once. Results were identical for a small and large number of iterations.

>From the other hand, I've used https://github.com/AntonKozlov/macos-aarch64-transition-bench to estimate the cost of the transition.
I re-did measurements with the current implementation and on consumer hardware:

testJNI            thrpt   25   277997000.151 ±   4095685.956  ops/s
testJniNanoTime    thrpt   25    17851098.010 ±    119489.599  ops/s
testNanoTime       thrpt   25    78007491.762 ±    628455.971  ops/s
testNothing        thrpt   25  1724298829.088 ± 100537565.068  ops/s
testTwoStateAndWX  thrpt   25    21958839.057 ±    210490.755  ops/s
testWX             thrpt   25    23299813.266 ±    149837.302  ops/s

There is an overhead, but it does not look like blocking the first implementation. I'm not refusing future optimizations like enabling W only when necessary. But for now, I don't have a robust and maintainable solution for this, sorry.


PR: https://git.openjdk.java.net/jdk/pull/2200

More information about the security-dev mailing list