Skip to content
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
4 changes: 1 addition & 3 deletions tee/supervisor-snp/src/reset_vector.s
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,7 @@ mov rax, cr0
or rax, 1 << 1
mov cr0, rax
mov rax, cr4
or rax, 1 << 9
or rax, 1 << 10
or rax, 1 << 18
or rax, (1 << 9) | (1 << 10) | (1 << 18)
mov cr4, rax
# 7.2 Enable AVX
xor rcx, rcx
Expand Down
2 changes: 1 addition & 1 deletion tee/supervisor-tdx/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ CARGO_BUILD_STD_FEATURES = $(CARGO_BUILD_STD_FEATURES_$(PROFILE))
CARGO_EXTRA_FLAGS_release = --features harden
CARGO_EXTRA_FLAGS = $(CARGO_EXTRA_FLAGS_$(PROFILE))

export RUSTFLAGS = -Z cf-protection=return
export RUSTFLAGS = -Z cf-protection=full

supervisor:
cargo build \
Expand Down
8 changes: 3 additions & 5 deletions tee/supervisor-tdx/src/reset_vector.s
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,7 @@ mov rax, cr0
or rax, 1 << 1
mov cr0, rax
mov rax, cr4
or rax, 1 << 9
or rax, 1 << 10
or rax, 1 << 18
or rax, (1 << 9) | (1 << 10) | (1 << 18)
mov cr4, rax
# 5.2 Enable AVX
xor rcx, rcx
Expand Down Expand Up @@ -98,10 +96,10 @@ add r8, SHADOW_STACK_SIZE - 8
mov rax, cr4
or rax, 1 << 23
mov cr4, rax
# 7.2 Enable Shadow Stacks in in SCET MSR
# 7.2 Enable SH_STK_EN, ENBR_EN, and NO_TRACK_EN in in SCET MSR
mov ecx, 0x6a2
xor edx, edx
mov eax, 1
mov eax, (1 << 0) | (1 << 2) | (1 << 4)
wrmsr
# 7.3 Load SSP
rstorssp [r8]
Expand Down