Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i#2350 rseq: Target start instead of handler #3791

Merged
merged 4 commits into from
Aug 22, 2019

Conversation

derekbruening
Copy link
Contributor

Changes the native execution of the rseq region to target the start of
the sequence rather than the abort handler. This is done for two
reasons: to support abort handlers which simply abort and do not
restart, and to make it much easier in the future to run a copy of the
sequence rather than rely on call-return semantics in the app code.

Adds preservation of input registers, limited to general-purpose
registers clearly read-before-written in the sequence. Documents the
new restrictions. Tries to pick a better scratch register, though
this should go away once we switch to using a local copy.

Issue: #2350

Changes the native execution of the rseq region to target the start of
the sequence rather than the abort handler.  This is done for two
reasons: to support abort handlers which simply abort and do not
restart, and to make it much easier in the future to run a copy of the
sequence rather than rely on call-return semantics in the app code.

Adds preservation of input registers, limited to general-purpose
registers clearly read-before-written in the sequence.  Documents the
new restrictions.  Tries to pick a better scratch register, though
this should go away once we switch to using a local copy.

Issue: #2350
Copy link

@hgreving2304 hgreving2304 left a comment

Choose a reason for hiding this comment

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

Tries to pick a better scratch register, though this should go away once we switch to using a local copy.
Don't we still need a scratch register for dcontext pointer and save/restore?

core/arch/arch.c Show resolved Hide resolved
core/arch/arch_exports.h Show resolved Hide resolved
core/arch/mangle_shared.c Outdated Show resolved Hide resolved
core/arch/mangle_shared.c Outdated Show resolved Hide resolved
core/arch/mangle_shared.c Show resolved Hide resolved
@derekbruening
Copy link
Contributor Author

Tries to pick a better scratch register, though this should go away once we switch to using a local copy.

Don't we still need a scratch register for dcontext pointer and save/restore?

We won't need a register we can't restore, though: i.e., we won't need a dead register.

@hgreving2304
Copy link

I'm done.

Changes the call* to go through TLS, avoiding the need for a dead register.

Inserts register saving code at the very start, avoiding conflits with
client (esp drreg) instrumentation.

Adds attach handling.

Inserts consistently before next_instr for end-of-rseq mangling.
@derekbruening
Copy link
Contributor Author

PTAL

core/arch/arch.h Show resolved Hide resolved
core/unix/rseq_linux.c Show resolved Hide resolved
@hgreving2304
Copy link

LGTM!

Copy link

@hgreving2304 hgreving2304 left a comment

Choose a reason for hiding this comment

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

It's good then

@derekbruening derekbruening merged commit 00ae95b into master Aug 22, 2019
@derekbruening derekbruening deleted the i2350-rseq-run-start branch August 22, 2019 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants