This is an archive of the discontinued LLVM Phabricator instance.

[BranchAlign] Fix bug w/nop padding for SS manipulation
ClosedPublic

Authored by reames on Feb 28 2020, 8:54 AM.

Details

Summary

X86 has several instructions which are documented as enabling interrupts exactly one instruction *after* the one which changes the SS segment register. Inserting a nop between these two instructions allows an interrupt to arrive before the execution of the following instruction which changes semantic behaviour.

The list of instructions is documented in "Table 24-3. Format of Interruptibility State" in Volume 3c of the Intel manual. They basically all come down to different ways to write to the SS register.

Diff Detail

Event Timeline

reames created this revision.Feb 28 2020, 8:54 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 28 2020, 8:54 AM
skan accepted this revision.Feb 29 2020, 2:49 AM

LGTM if the patch is formatted.

This revision is now accepted and ready to land.Feb 29 2020, 2:49 AM
This revision was automatically updated to reflect the committed changes.