Skip to content

Add support for Indirect Branch Tracking (IBT) #199

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

Merged
merged 1 commit into from
May 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/asm/jump_x86_64_sysv_elf_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,18 @@
* ---------------------------------------------------------------------------------- *
* *
****************************************************************************************/

# if defined __CET__
# include <cet.h>
# else
# define _CET_ENDBR
# endif
.file "jump_x86_64_sysv_elf_gas.S"
.text
.globl jump_fcontext
.type jump_fcontext,@function
.align 16
jump_fcontext:
_CET_ENDBR
leaq -0x38(%rsp), %rsp /* prepare stack */

#if !defined(BOOST_USE_TSX)
Expand Down
9 changes: 8 additions & 1 deletion src/asm/make_x86_64_sysv_elf_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,18 @@
* ---------------------------------------------------------------------------------- *
* *
****************************************************************************************/

# if defined __CET__
# include <cet.h>
# else
# define _CET_ENDBR
# endif
.file "make_x86_64_sysv_elf_gas.S"
.text
.globl make_fcontext
.type make_fcontext,@function
.align 16
make_fcontext:
_CET_ENDBR
/* first arg of make_fcontext() == top of context-stack */
movq %rdi, %rax

Expand Down Expand Up @@ -64,13 +69,15 @@ make_fcontext:
ret /* return pointer to context-data */

trampoline:
_CET_ENDBR
/* store return address on stack */
/* fix stack alignment */
push %rbp
/* jump to context-function */
jmp *%rbx

finish:
_CET_ENDBR
/* exit code is zero */
xorq %rdi, %rdi
/* exit application */
Expand Down
7 changes: 6 additions & 1 deletion src/asm/ontop_x86_64_sysv_elf_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,18 @@
* ---------------------------------------------------------------------------------- *
* *
****************************************************************************************/

# if defined __CET__
# include <cet.h>
# else
# define _CET_ENDBR
# endif
.file "ontop_x86_64_sysv_elf_gas.S"
.text
.globl ontop_fcontext
.type ontop_fcontext,@function
.align 16
ontop_fcontext:
_CET_ENDBR
/* preserve ontop-function in R8 */
movq %rdx, %r8

Expand Down