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
Signed-off-by: Angie Chinchilla <angie.v.chinchilla@intel.com>
Authors:
Serge Ayoun <serge.ayoun@intel.com>
Angie Chinchilla <angie.v.chinchilla@intel.com>
Shay Katz-zamir <shay.katz-zamir@intel.com>
Cedric Xing <cedric.xing@intel.com>

Signed-off-by: Angie Chinchilla <angie.v.chinchilla@intel.com>
Signed-off-by: Angie Chinchilla <angie.v.chinchilla@intel.com>
Signed-off-by: Angie Chinchilla <angie.v.chinchilla@intel.com>
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 <serge.ayoun@intel.com>
Angie Chinchilla <angie.v.chinchilla@intel.com>
Shay Katz-zamir <shay.katz-zamir@intel.com>
Cedric Xing <cedric.xing@intel.com>

Signed-off-by: Angie Chinchilla <angie.v.chinchilla@intel.com>
Signed-off-by: Angie Chinchilla <angie.v.chinchilla@intel.com>
Signed-off-by: Zhang Lili lili.z.zhang@intel.com
Update README

Signed-off-by: Zhang Lili lili.z.zhang@intel.com
Signed-off-by: Zhang Lili lili.z.zhang@intel.com
Update README for SUSE on sgx2 branch

Signed-off-by: Zhang Lili lili.z.zhang@intel.com
Signed-off-by: Zhang Lili lili.z.zhang@intel.com
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 <sean.j.christopherson@intel.com>
intel_sgx: use mmu_notifier_unregister w/o "no_release"
Signed-off-by: Serge Ayoun <serge.ayoun@intel.com>
Removing conflicting compilation flags
…ap_sem) added

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

Signed-off-by: Serge Ayoun <serge.ayoun@intel.com>
Calling PF handler from isolate_range was not protected: down_read(mm…
Signed-off-by: Angie Chinchilla <angie.v.chinchilla@intel.com>
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 <serge.ayoun@intel.com>
In order to cope with KSS feature:

Signed-off-by: Zhang Lili Z <lili.z.zhang@intel.com>
Signed-off-by: Serge Ayoun <serge.ayoun@intel.com>
vm_insert_pfn replaced by vmf_insert_pfn from kernel 4.20
Signed-off-by: Serge Ayoun <serge.ayoun@intel.com>
Enclave virtual address range should never be defined as MAP_PRIVATE.
in success case

Signed-off-by: Serge Ayoun <serge.ayoun@intel.com>
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 <npmccallum@redhat.com>
Rename MSR_IA32_FEATURE_CONTROL and FEATURE_CONTROL_LOCKED
Signed-off-by: Haitao Huang <4699115+haitaohuang@users.noreply.github.com>
Signed-off-by: Haitao Huang <4699115+haitaohuang@users.noreply.github.com>
Clarify intended usage of this driver

Signed-off-by: Haitao Huang <4699115+haitaohuang@users.noreply.github.com>
Signed-off-by: Haitao Huang <4699115+haitaohuang@users.noreply.github.com>
Obviously, this if check is redundant. Remove it.

Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
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 colin.king@canonical.com

Signed-off-by: Haitao Huang <4699115+haitaohuang@users.noreply.github.com>
Fix signed integer overflow on shift
Note this is used in Intel PSW release 2.11

Signed-off-by: Haitao Huang <4699115+haitaohuang@users.noreply.github.com>
* Fix compilation on 5.8 kernel

Signed-off-by: Don Porter <porter@cs.unc.edu>

* Address review comments

* Address review comments
Signed-off-by: Haitao Huang <4699115+haitaohuang@users.noreply.github.com>
Signed-off-by: Haitao Huang <4699115+haitaohuang@users.noreply.github.com>
Signed-off-by: Haitao Huang <4699115+haitaohuang@users.noreply.github.com>
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 <4699115+haitaohuang@users.noreply.github.com>
Use cpuid instead of boot_cpu_has to check cpu features
Signed-off-by: Zhang Lili lili.z.zhang@intel.com
Signed-off-by: Haitao Huang <haitao.huang@linux.intel.com>
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
10 participants