提交 04c2453e 编写于 作者: J Jarkko Sakkinen 提交者: Zheng Zengkai

x86/cpu/intel: Add a nosgx kernel parameter

mainline inclusion
from mainline-v5.11-rc1
commit 38853a30
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I4SIGI
CVE: NA

--------------------------------

Add a kernel parameter to disable SGX kernel support and document it.

 [ bp: Massage. ]

Intel-SIG: commit 38853a30 x86/cpu/intel: Add a nosgx kernel parameter
Backport for SGX Foundations support
Signed-off-by: NJarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: NBorislav Petkov <bp@suse.de>
Reviewed-by: NSean Christopherson <sean.j.christopherson@intel.com>
Acked-by: NJethro Beekman <jethro@fortanix.com>
Tested-by: NSean Christopherson <sean.j.christopherson@intel.com>
Link: https://lkml.kernel.org/r/20201112220135.165028-9-jarkko@kernel.org
Signed-off-by: Fan Du <fan.du@intel.com> #openEuler_contributor
Signed-off-by: NLaibin Qiu <qiulaibin@huawei.com>
Reviewed-by: NBamvor Zhang <bamvor.zhang@suse.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 9cfcb641
...@@ -3498,6 +3498,8 @@ ...@@ -3498,6 +3498,8 @@
nosep [BUGS=X86-32] Disables x86 SYSENTER/SYSEXIT support. nosep [BUGS=X86-32] Disables x86 SYSENTER/SYSEXIT support.
nosgx [X86-64,SGX] Disables Intel SGX kernel support.
nosmp [SMP] Tells an SMP kernel to act as a UP kernel, nosmp [SMP] Tells an SMP kernel to act as a UP kernel,
and disable the IO APIC. legacy for "maxcpus=0". and disable the IO APIC. legacy for "maxcpus=0".
......
...@@ -99,6 +99,15 @@ static void clear_sgx_caps(void) ...@@ -99,6 +99,15 @@ static void clear_sgx_caps(void)
setup_clear_cpu_cap(X86_FEATURE_SGX_LC); setup_clear_cpu_cap(X86_FEATURE_SGX_LC);
} }
static int __init nosgx(char *str)
{
clear_sgx_caps();
return 0;
}
early_param("nosgx", nosgx);
void init_ia32_feat_ctl(struct cpuinfo_x86 *c) void init_ia32_feat_ctl(struct cpuinfo_x86 *c)
{ {
bool tboot = tboot_enabled(); bool tboot = tboot_enabled();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册