From 17729b0d5831b8c85ab1c46c41e74a7a095f2c3a Mon Sep 17 00:00:00 2001 From: zhoushuiqing Date: Mon, 24 Jul 2023 15:19:54 +0800 Subject: [PATCH] fix the compile error. Modify the vm_flags variable through API interfaces --- ...vm_flags-variable-through-interfaces.patch | 32 +++++++++++++++++++ linux-sgx-driver.spec | 6 +++- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 0001-Modify-the-vm_flags-variable-through-interfaces.patch diff --git a/0001-Modify-the-vm_flags-variable-through-interfaces.patch b/0001-Modify-the-vm_flags-variable-through-interfaces.patch new file mode 100644 index 0000000..5c9f335 --- /dev/null +++ b/0001-Modify-the-vm_flags-variable-through-interfaces.patch @@ -0,0 +1,32 @@ +From 753fd239a08e331168f7fac6fed1f2c9f5632fe4 Mon Sep 17 00:00:00 2001 +From: zhoushuiqing +Date: Mon, 24 Jul 2023 15:08:24 +0800 +Subject: [PATCH] Modify the vm_flags variable through interfaces +The kernel has set the vm_flags variable as const and provided a series of +interfaces to manipulate it. Therefore, it is necessary to make appropriate +modifications to the code in linux-sgx-driver. + +the kernel commit is https://github.com/torvalds/linux/commit/bc292ab00f6c7a661a8a605c714e8a148f629ef6 +--- + sgx_main.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/sgx_main.c b/sgx_main.c +index ca52821..75951a2 100644 +--- a/sgx_main.c ++++ b/sgx_main.c +@@ -109,9 +109,8 @@ bool sgx_has_sgx2; + static int sgx_mmap(struct file *file, struct vm_area_struct *vma) + { + vma->vm_ops = &sgx_vm_ops; +- vma->vm_flags |= VM_PFNMAP | VM_DONTEXPAND | VM_DONTDUMP | VM_IO | +- VM_DONTCOPY; +- ++ vm_flags_set(vma, VM_PFNMAP | VM_DONTEXPAND | VM_DONTDUMP | VM_IO | ++ VM_DONTCOPY); + return 0; + } + +-- +2.33.0 + diff --git a/linux-sgx-driver.spec b/linux-sgx-driver.spec index 96a1f3d..0ec3ae8 100644 --- a/linux-sgx-driver.spec +++ b/linux-sgx-driver.spec @@ -1,6 +1,6 @@ Name: linux-sgx-driver Version: 2.14 -Release: 1 +Release: 2 Summary: Intel SGX Linux* Driver ExclusiveArch: x86_64 License: BSD-3-Clause and GPL-2.0 License @@ -8,6 +8,7 @@ URL: https://github.com/intel/linux-sgx-driver Source0: https://github.com/intel/linux-sgx-driver/archive/sgx_driver_%{version}.tar.gz BuildRequires: gcc kernel-devel make module-init-tools glibc uname-build-checks elfutils-devel +Patch0: 0001-Modify-the-vm_flags-variable-through-interfaces.patch %define kern_devel_ver %(uname -r) Requires: kernel=%{kern_devel_ver} @@ -60,6 +61,9 @@ sed -i '/^isgx$/d' /etc/modules %changelog +* Mon Jul 24 2023 zhoushuiqing - 2.14-2 +- fix the compile error of vm_flags + * Mon Jan 30 2023 wangyunjia - 2.14-1 - Update version to 2.14