From 2f69bc44869a23691001148bce16d26f77ba030a Mon Sep 17 00:00:00 2001 From: Pierre Gronlier Date: Mon, 19 Feb 2024 10:48:05 +0100 Subject: [PATCH] fix compilation on 6.5 and shift op reuse the patch from https://github.com/intel/linux-sgx-driver/pull/151 and fix "shift exponent 32 is too large for 32-bit type 'int'" when loading the isgx module --- sgx_main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sgx_main.c b/sgx_main.c index ca52821..f280587 100644 --- a/sgx_main.c +++ b/sgx_main.c @@ -109,9 +109,9 @@ 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; } @@ -221,7 +221,7 @@ static int sgx_dev_init(struct device *parent) for (i = 2; i < 64; i++) { cpuid_count(0x0D, i, &eax, &ebx, &ecx, &edx); - if ((1 << i) & sgx_xfrm_mask) + if ((1ULL << i) & sgx_xfrm_mask) sgx_xsave_size_tbl[i] = eax + ebx; } }