Skip to content

Commit 8be98b1

Browse files
Added a constant-time instruction decoder to supplement the default AEX-Notify mitigation. (#960)
Added a constant-time instruction decoder to supplement the default AEX-Notify mitigation. Signed-off-by: Scott Constable <scott.d.constable@intel.com>
1 parent f656e74 commit 8be98b1

File tree

6 files changed

+1464
-12
lines changed

6 files changed

+1464
-12
lines changed

sdk/simulation/trtssim/linux/Makefile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ TRTS1_OBJS := init_enclave.o \
7171
trts_emm_sim.o
7272

7373
TRTS2_OBJS := trts_nsp.o
74-
TRTS_OBJS := $(TRTS1_OBJS) $(TRTS2_OBJS)
74+
TRTS_OBJS := $(TRTS1_OBJS) $(TRTS2_OBJS) ctd.o
7575

7676
TINST_OBJS := t_instructions.o \
7777
deriv.o
@@ -93,6 +93,15 @@ TLDR_C_OBJS := elf_parser.o \
9393

9494
TLDR_OBJS := $(TLDR_ASM_OBJS) $(TLDR_C_OBJS)
9595

96+
ctd.o: $(TRTS_DIR)/ctd.c
97+
$(CC) -mavx2 -O3 -masm=intel $(filter-out -O2,$(CFLAGS)) $(TCFLAGS) -c $< -o $@ \
98+
-I$(COMMON_DIR)/inc/ \
99+
-I$(COMMON_DIR)/inc/tlibc/ \
100+
-I$(COMMON_DIR)/inc/internal \
101+
-I$(LINUX_SDK_DIR)/trts/ \
102+
-I$(LINUX_SDK_DIR)/pthread/ \
103+
-I$(LINUX_SDK_DIR)/tlibcxx/include
104+
96105
LIBTRTS := libsgx_trts_sim.a
97106

98107
vpath %.cpp $(TRTS_DIR):$(TINST_DIR)

sdk/trts/Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ OBJS2 := trts_nsp.o
6060

6161
OBJS3 := ema_rt.o
6262

63-
OBJS := $(OBJS1) $(OBJS2) $(OBJ3)
63+
OBJS4 := ctd.o # The CTD requires AVX2
64+
65+
OBJS := $(OBJS1) $(OBJS2) $(OBJ3) $(OBJS4)
6466

6567
all: $(OBJS) elf_parser
6668

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

79+
$(OBJS4): %.o: %.c
80+
$(CC) -mavx2 -O3 -masm=intel $(filter-out -O2,$(CFLAGS)) $(TCFLAGS) \
81+
-I$(COMMON_DIR)/inc/internal -I$(COMMON_DIR)/inc -c $< -o $@
82+
7783
.PHONY: elf_parser
7884
elf_parser: $(OBJS)
7985
$(MAKE) -C linux

0 commit comments

Comments
 (0)