Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8307817

AARCH64: make macOS W^X locking more fine grained

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 21
    • hotspot
    • aarch64
    • os_x

      On Apple Silicon the Writer/Execute lock is a new Hardened Runtime capability, see:
      https://developer.apple.com/documentation/apple-silicon/porting-just-in-time-compilers-to-apple-silicon

      It prevents memory regions to be writable and executable at the same time. Therefore, we need to acquire WXWrite when we want to write to the code cache.

      At the moment, the write lock is acquired by
      ```
      MACOS_AARCH64_ONLY(ThreadWXEnable __wx(WXWrite, thread));
      ```

      Acquiring write lock can be expensive and is too coarse grained at the moment.
      Check all the write lock if they can be move down in the call hierarchy, especially the ones in `interfaceSupport.inline.hpp`

      In https://bugs.openjdk.org/browse/JDK-8302736 WXWrite locks caused a major performance regression and was resolved by moving one of the locks already down.

            dlong Dean Long
            tholenstein Tobias Holenstein
            Votes:
            1 Vote for this issue
            Watchers:
            14 Start watching this issue

              Created:
              Updated: