Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync with intel main and add fix for kernel 6.5 OOT driver compilation error #1

Open
wants to merge 83 commits into
base: master
Choose a base branch
from

Conversation

joshwyant
Copy link

@joshwyant joshwyant commented Apr 27, 2024

see commit for the fix by @ticapix below, "fix compilation on 6.5 and shift op, 2f69bc4"

Angie Chinchilla and others added 30 commits October 30, 2017 16:18
Authors:
Serge Ayoun <[email protected]>
Angie Chinchilla <[email protected]>
Shay Katz-zamir <[email protected]>
Cedric Xing <[email protected]>

Signed-off-by: Angie Chinchilla <[email protected]>
Signed-off-by: Angie Chinchilla <[email protected]>
Signed-off-by: Angie Chinchilla <[email protected]>
Set sgx2 to master:<03435d33de0bcca6c5777f23ac161249b9158f1e>
for rebasing but keep the previous commit history/label.
Rebased 2.0 patch applies to linux-sgx-driver:master
commit-id 03435d3

Authors:
Serge Ayoun <[email protected]>
Angie Chinchilla <[email protected]>
Shay Katz-zamir <[email protected]>
Cedric Xing <[email protected]>

Signed-off-by: Angie Chinchilla <[email protected]>
Signed-off-by: Angie Chinchilla <[email protected]>
Signed-off-by: Zhang Lili [email protected]
Signed-off-by: Zhang Lili [email protected]
Update README for SUSE on sgx2 branch

Signed-off-by: Zhang Lili [email protected]
Signed-off-by: Zhang Lili [email protected]
Port README.md update from master
Replace the call to mmu_notifier_unregister_no_release() with a call
to the basic mmu_notifier_unregister().  The no_release variant was
not added until kernel 3.17 and using it prevents building the driver
in Debian 8 (and earlier).

Back when usge of the MMU notifier was added to the SGX driver, the
MMU release callback, sgx_mmu_notifier_release(), included acquiring
mmap_sem for read, i.e. down_read(&mm->mmap_sem).  This caused a
deadlock if we called mmu_notifier_unregister() in sgx_encl_release()
because the semaphore is already write-locked by munmap().  Eventually
we stopped acquiring mmap_sem in sgx_mmu_notifier_release(), but kept
using the no_release unregister variant as invoking release on a dying
enclave was unnecessary and added an extra lock/unlock sequence.

TL;DR: Calling mmu_notifier_unregister_no_release() was necessary to
avoid deadlock in an old incarnation of the driver, but the current
driver plays nice with the release variant.

Signed-off-by: Sean Christopherson <[email protected]>
intel_sgx: use mmu_notifier_unregister w/o "no_release"
Removing conflicting compilation flags
…ap_sem) added

isolate_range does not always extract the right vma ptr: code fix

Signed-off-by: Serge Ayoun <[email protected]>
Calling PF handler from isolate_range was not protected: down_read(mm…
Update License.txt to 3-c BSD/GPL v2, to match src
. Updating sgx_secs structure to reflect configid and configsvn members.
. Releasing SGX_ATTR_RESERVED bit mask 7.

Signed-off-by: Serge Ayoun <[email protected]>
In order to cope with KSS feature:

Signed-off-by: Zhang Lili Z <[email protected]>
vm_insert_pfn replaced by vmf_insert_pfn from kernel 4.20
Enclave virtual address range should never be defined as MAP_PRIVATE.
npmccallum and others added 28 commits February 26, 2020 23:56
They have new names in more recent kernels. We check for the old
defines, however, in order to prevent breaking on older kernels.

Also, rename FEATURE_CONTROL_SGX_ENABLE to match the new naming.

Signed-off-by: Nathaniel McCallum <[email protected]>
Rename MSR_IA32_FEATURE_CONTROL and FEATURE_CONTROL_LOCKED
Signed-off-by: Haitao Huang <[email protected]>
Clarify intended usage of this driver

Signed-off-by: Haitao Huang <[email protected]>
Signed-off-by: Haitao Huang <[email protected]>
Obviously, this if check is redundant. Remove it.

Signed-off-by: Tianjia Zhang <[email protected]>
Shifting a signed integer value of 1 by 31 or more bits will cause
overflow and can lead to undefined behaviour. Fix this by adding
a UL suffix to ensure an unsigned long is being shifted.

Signed-off-by: Colin Ian King [email protected]

Signed-off-by: Haitao Huang <[email protected]>
Fix signed integer overflow on shift
Note this is used in Intel PSW release 2.11

Signed-off-by: Haitao Huang <[email protected]>
* Fix compilation on 5.8 kernel

Signed-off-by: Don Porter <[email protected]>

* Address review comments

* Address review comments
Signed-off-by: Haitao Huang <[email protected]>
Update supported OSes by referring to releases
For non-FLC platforms, Linux kernel 5.11 or above disables sgx feature flag
so boot_cpu_has is not usable.

Signed-off-by: Haitao Huang <[email protected]>
Use cpuid instead of boot_cpu_has to check cpu features
Signed-off-by: Zhang Lili [email protected]
reuse the patch from intel#151 and fix "shift exponent 32 is too large for 32-bit type 'int'" when loading the isgx module
@joshwyant joshwyant changed the title Sync with intel/linux-sgx-driver main branch Sync with intel main and add fix for kernel 6.5 OOT driver compilation error Apr 27, 2024
@joshwyant
Copy link
Author

Merging in commit from ticapix@2f69bc4 which fixes the issue, see intel#152 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants