sgx-lkl icon indicating copy to clipboard operation
sgx-lkl copied to clipboard

Add Java DaCapo benchmark sample + provide fixes

Open prp opened this issue 4 years ago • 1 comments

This PR adds the Java DaCapo benchmark sample and attempts to fix #645.

A fundamental issue with SGX1 is that the in-enclave segfault handler does not receive the correct address of the memory access that caused the fault (instead before it received the address of the instruction causing the segfault). The Hotspot JVM uses guard pages that trigger segfaults to make threads reach safepoints for garbage collection. Since the faulting access isn't reported correctly, the JVM may be confused and segfault.

The PR also adds a new enclave_config option unsafe_host_signal, which controls if untrusted page faults are exposed to the enclave. It also adds a CI test that runs one of the DaCapo Java benchmarks.

In addition, the PR does some minor cleanup work:

  • Move dumping of mount table to correct location (This was a previous merge error.)
  • Output thread struct address in backtraces
  • Fix dependency in Makefile for Java sample

prp avatar Jul 19 '20 15:07 prp

If the JVM is running in a configuration where it depends on SIGSEGV for functional correctness then it is insecure on current SGX. We should not be running benchmarks in that configuration because it's misleading. The GC should be configured to use explicit barriers in the JIT, not page protection.

@davidchisnall I could not find a JVM configuration option to make the HotSpot JVM not use barriers based on page protection.

prp avatar Jul 27 '20 20:07 prp