arch/x86_64: Add ARCH_INTEL64_DISABLE_CET
Intel CET (Control-flow Enforcement Technology) is a hardware enhancement aimed at mitigating the Retpoline vulnerability, but it may impact CPU branch prediction performance. This commit added ARCH_INTEL64_DISABLE_CET, which can disable CET completely with compilation option `-fcf-protection=none`. Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
This commit is contained in:
parent
126221df97
commit
cb7894d644
@ -32,6 +32,10 @@ ARCHCPUFLAGS = -fPIC -fno-stack-protector -mno-red-zone -mrdrnd
|
||||
ARCHPICFLAGS = -fPIC
|
||||
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef
|
||||
|
||||
ifeq ($(CONFIG_ARCH_INTEL64_DISABLE_CET),y)
|
||||
ARCHOPTIMIZATION += -fcf-protection=none
|
||||
endif
|
||||
|
||||
# We have to use a cross-development toolchain under Cygwin because the native
|
||||
# Cygwin toolchains don't generate ELF binaries.
|
||||
|
||||
|
@ -195,4 +195,13 @@ config ARCH_INTEL64_DISABLE_INT_INIT
|
||||
controllers. This is necessary if those are already
|
||||
initialized, i.e. Jailhouse system.
|
||||
|
||||
config ARCH_INTEL64_DISABLE_CET
|
||||
bool "Disable CET completely"
|
||||
---help---
|
||||
Intel CET (Control-flow Enforcement Technology) is a hardware
|
||||
enhancement aimed at mitigating the Retpoline vulnerability.
|
||||
It inserts the endbr64 instruction at the beginning of functions,
|
||||
which may impact CPU branch prediction performance.
|
||||
|
||||
|
||||
endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user