Skip to content

Commit

Permalink
Added a constant-time instruction decoder to supplement the default A…
Browse files Browse the repository at this point in the history
…EX-Notify mitigation. (#960)

Added a constant-time instruction decoder to supplement the default AEX-Notify mitigation.

Signed-off-by: Scott Constable <[email protected]>
  • Loading branch information
scottconstable authored Oct 20, 2023
1 parent f656e74 commit 8be98b1
Show file tree
Hide file tree
Showing 6 changed files with 1,464 additions and 12 deletions.
11 changes: 10 additions & 1 deletion sdk/simulation/trtssim/linux/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ TRTS1_OBJS := init_enclave.o \
trts_emm_sim.o

TRTS2_OBJS := trts_nsp.o
TRTS_OBJS := $(TRTS1_OBJS) $(TRTS2_OBJS)
TRTS_OBJS := $(TRTS1_OBJS) $(TRTS2_OBJS) ctd.o

TINST_OBJS := t_instructions.o \
deriv.o
Expand All @@ -93,6 +93,15 @@ TLDR_C_OBJS := elf_parser.o \

TLDR_OBJS := $(TLDR_ASM_OBJS) $(TLDR_C_OBJS)

ctd.o: $(TRTS_DIR)/ctd.c
$(CC) -mavx2 -O3 -masm=intel $(filter-out -O2,$(CFLAGS)) $(TCFLAGS) -c $< -o $@ \
-I$(COMMON_DIR)/inc/ \
-I$(COMMON_DIR)/inc/tlibc/ \
-I$(COMMON_DIR)/inc/internal \
-I$(LINUX_SDK_DIR)/trts/ \
-I$(LINUX_SDK_DIR)/pthread/ \
-I$(LINUX_SDK_DIR)/tlibcxx/include

LIBTRTS := libsgx_trts_sim.a

vpath %.cpp $(TRTS_DIR):$(TINST_DIR)
Expand Down
8 changes: 7 additions & 1 deletion sdk/trts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ OBJS2 := trts_nsp.o

OBJS3 := ema_rt.o

OBJS := $(OBJS1) $(OBJS2) $(OBJ3)
OBJS4 := ctd.o # The CTD requires AVX2

OBJS := $(OBJS1) $(OBJS2) $(OBJ3) $(OBJS4)

all: $(OBJS) elf_parser

Expand All @@ -74,6 +76,10 @@ $(OBJS2): %.o: %.cpp
$(OBJS3): %.o: %.c
$(CC) -c $(TCFLAGS) $(CFLAGS) -fPIC $< -o $@

$(OBJS4): %.o: %.c
$(CC) -mavx2 -O3 -masm=intel $(filter-out -O2,$(CFLAGS)) $(TCFLAGS) \
-I$(COMMON_DIR)/inc/internal -I$(COMMON_DIR)/inc -c $< -o $@

.PHONY: elf_parser
elf_parser: $(OBJS)
$(MAKE) -C linux
Expand Down
Loading

0 comments on commit 8be98b1

Please sign in to comment.