gramineproject / gramine

A library OS for Linux multi-process applications, with Intel SGX support
GNU Lesser General Public License v3.0
603 stars 201 forks source link

[PAL/Linux-SGX] AEX-Notify 1/5: Prepare AEX handler to call C code in release mode #2025

Open dimakuv opened 1 month ago

dimakuv commented 1 month ago

Description of the changes

Part 1 in AEX-Notify series.

Previously, the AEX handler only called C code (more specific to our use case, the code that works on the untrusted-thread stack) for SGX profiling logic and only when Gramine was built in debug mode.

As a preparation for AEX-Notify support, this commit modifies the AEX handler such that it can call C code when Gramine is built in release mode. Also, the AEX handler logic is not restricted to SGX profiling only, so the _PROF/_prof suffixes in related function and variable names are removed.

This commit also adds two small prerequisites for AEX-Notify: (1) eenter_pointer helper so that signal handling logic can learn whether an exception happened at EENTER instruction, and (2) dummy function maybe_raise_pending_signal that will be populated in a later commit.

See also related PRs and discussions:

How to test this PR?

CI is enough.


This change is Reviewable