Skip to content

Conversation

dimakuv
Copy link

@dimakuv dimakuv commented Oct 14, 2024

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

Copy link
Author

@dimakuv dimakuv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 6 files reviewed, all discussions resolved, not enough approvals from maintainers (2 more required), not enough approvals from different teams (1 more required, approved so far: Intel)


pal/src/host/linux-sgx/host_entry.S line 18 at r1 (raw file):


    .extern tcs_base
    .extern g_in_aex_profiling

tcs_base and g_in_aex_profiling don't exist (some historic artifacts). Removed them, though they are unrelated to this PR.

Copy link
Author

@dimakuv dimakuv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 6 files reviewed, 1 unresolved discussion, not enough approvals from maintainers (2 more required), not enough approvals from different teams (1 more required, approved so far: Intel)


-- commits line 8 at r1:
Here and everywhere: the correct spelling is AEX-Notify, with a dash. Change.

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.

Signed-off-by: Dmitrii Kuvaiskii <[email protected]>
@dimakuv dimakuv force-pushed the dimakuv/aex-notify-part1 branch from 0e7cac7 to b9b90ed Compare October 22, 2024 07:11
@dimakuv dimakuv changed the title [PAL/Linux-SGX] Prepare AEX handler to call C code in release mode [PAL/Linux-SGX] AEX-Notify 1/5: Prepare AEX handler to call C code in release mode Oct 22, 2024
@dimakuv dimakuv force-pushed the dimakuv/aex-notify-part1 branch from b9b90ed to b272b9d Compare October 22, 2024 07:12
Copy link
Author

@dimakuv dimakuv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 6 files reviewed, all discussions resolved, not enough approvals from maintainers (1 more required), not enough approvals from different teams (1 more required, approved so far: Intel)


-- commits line 8 at r1:

Previously, dimakuv (Dmitrii Kuvaiskii) wrote…

Here and everywhere: the correct spelling is AEX-Notify, with a dash. Change.

Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Working on it
Development

Successfully merging this pull request may close these issues.

1 participant