Skip to content

Commit

Permalink
fix compilation on 6.5 and shift op
Browse files Browse the repository at this point in the history
reuse the patch from intel#151 and fix "shift exponent 32 is too large for 32-bit type 'int'" when loading the isgx module
  • Loading branch information
ticapix authored Feb 19, 2024
1 parent b6f5b4a commit 2f69bc4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sgx_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 2f69bc4

Please sign in to comment.