Unverified Commit e8ec0ad8 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!13013 [OLK-5.10] Intel: Backport KVM Fix for Clearing SGX EDECCSSA to OLK-5.10

Merge Pull Request from: @zhiquan1-li 
 
**Description** 
When SGX EDECCSSA support was added to KVM in commit 16a7fe37 ("KVM/VMX: Allow exposing EDECCSSA user leaf function to KVM guest"), it forgot to clear the X86_FEATURE_SGX_EDECCSSA bit in KVM CPU caps when KVM SGX is disabled. Fix it.

Fixes: 16a7fe37 ("KVM/VMX: Allow exposing EDECCSSA user leaf function to KVM guest")

**Intel-Kernel Issue** 
https://gitee.com/openeuler/intel-kernel/issues/IB21Q3

**About the patch**
The content of the patch is the same as upstream.
There is 1 patch, this is the commit list from upstream:
```c
7efb4d8a392a KVM: VMX: Also clear SGX EDECCSSA in KVM CPU caps when SGX is disabled
```

**Test**
Test on EMR Platform
- Built and run the kernel successfully
- Kernel selftest - SGX on host: PASS
- Kernel selftest - SGX on guest: PASS

**Known Issue**
N/A

**Default config change**
N/A

**References**
- https://lore.kernel.org/r/20240905120837.579102-1-kai.huang@intel.com 
 
Link:https://gitee.com/openeuler/kernel/pulls/13013

 

Reviewed-by: default avatarJason Zeng <jason.zeng@intel.com>
Reviewed-by: default avatarKevin Zhu <zhukeqian1@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parents bce76101 9e55269b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -7814,6 +7814,7 @@ static __init void vmx_set_cpu_caps(void)
		kvm_cpu_cap_clear(X86_FEATURE_SGX_LC);
		kvm_cpu_cap_clear(X86_FEATURE_SGX1);
		kvm_cpu_cap_clear(X86_FEATURE_SGX2);
		kvm_cpu_cap_clear(X86_FEATURE_SGX_EDECCSSA);
	}

	if (vmx_umip_emulated())