Skip to content

Commit ac0a756

Browse files
committed
backport chnages to support Alma Linux 9.6
Signed-off-by: nindanaoto <[email protected]>
1 parent 6f5c938 commit ac0a756

File tree

16 files changed

+47
-26
lines changed

16 files changed

+47
-26
lines changed

src/runtime_src/core/pcie/driver/linux/xocl/mgmtpf/mgmt-core.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -315,13 +315,13 @@ static int bridge_mmap(struct file *file, struct vm_area_struct *vma)
315315
* and prevent the pages from being swapped out
316316
*/
317317
#ifndef VM_RESERVED
318-
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 3, 0)
318+
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 3, 0) && !defined(RHEL_9_5_GE)
319319
vma->vm_flags |= VM_IO | VM_DONTEXPAND | VM_DONTDUMP;
320320
#else
321321
vm_flags_set(vma, VM_IO | VM_DONTEXPAND | VM_DONTDUMP);
322322
#endif
323323
#else
324-
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 3, 0)
324+
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 3, 0) && !defined(RHEL_9_5_GE)
325325
vma->vm_flags |= VM_IO | VM_RESERVED;
326326
#else
327327
vm_flags_set(vma, VM_IO | VM_RESERVED);
@@ -1760,7 +1760,7 @@ static int __init xclmgmt_init(void)
17601760

17611761
pr_info(DRV_NAME " init()\n");
17621762

1763-
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0)
1763+
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0) && !defined(RHEL_9_4_GE)
17641764
xrt_class = class_create(THIS_MODULE, "xrt_mgmt");
17651765
#else
17661766
xrt_class = class_create("xrt_mgmt");

src/runtime_src/core/pcie/driver/linux/xocl/subdev/accel_deadlock_detector.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,13 +226,13 @@ static int accel_deadlock_detector_mmap(struct file *filp, struct vm_area_struct
226226

227227
// prevent touching the pages (byte access) for swap-in, and prevent the pages from being swapped out
228228
#ifndef VM_RESERVED
229-
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 3, 0)
229+
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 3, 0) && !defined(RHEL_9_5_GE)
230230
vma->vm_flags |= VM_IO | VM_DONTEXPAND | VM_DONTDUMP;
231231
#else
232232
vm_flags_set(vma, VM_IO | VM_DONTEXPAND | VM_DONTDUMP);
233233
#endif
234234
#else
235-
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 3, 0)
235+
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 3, 0) && !defined(RHEL_9_5_GE)
236236
vma->vm_flags |= VM_IO | VM_RESERVED;
237237
#else
238238
vm_flags_set(vma, VM_IO | VM_RESERVED);

src/runtime_src/core/pcie/driver/linux/xocl/subdev/aim.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,13 +413,13 @@ static int aim_mmap(struct file *filp, struct vm_area_struct *vma)
413413
* and prevent the pages from being swapped out
414414
*/
415415
#ifndef VM_RESERVED
416-
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 3, 0)
416+
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 3, 0) && !defined(RHEL_9_5_GE)
417417
vma->vm_flags |= VM_IO | VM_DONTEXPAND | VM_DONTDUMP;
418418
#else
419419
vm_flags_set(vma, VM_IO | VM_DONTEXPAND | VM_DONTDUMP);
420420
#endif
421421
#else
422-
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 3, 0)
422+
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 3, 0) && !defined(RHEL_9_5_GE)
423423
vma->vm_flags |= VM_IO | VM_RESERVED;
424424
#else
425425
vm_flags_set(vma, VM_IO | VM_RESERVED);

src/runtime_src/core/pcie/driver/linux/xocl/subdev/am.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,13 +405,13 @@ static int am_mmap(struct file *filp, struct vm_area_struct *vma)
405405
* and prevent the pages from being swapped out
406406
*/
407407
#ifndef VM_RESERVED
408-
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 3, 0)
408+
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 3, 0) && !defined(RHEL_9_5_GE)
409409
vma->vm_flags |= VM_IO | VM_DONTEXPAND | VM_DONTDUMP;
410410
#else
411411
vm_flags_set(vma, VM_IO | VM_DONTEXPAND | VM_DONTDUMP);
412412
#endif
413413
#else
414-
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 3, 0)
414+
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 3, 0) && !defined(RHEL_9_5_GE)
415415
vma->vm_flags |= VM_IO | VM_RESERVED;
416416
#else
417417
vm_flags_set(vma, VM_IO | VM_RESERVED);

src/runtime_src/core/pcie/driver/linux/xocl/subdev/asm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,13 +339,13 @@ static int asm_mmap(struct file *filp, struct vm_area_struct *vma)
339339
* and prevent the pages from being swapped out
340340
*/
341341
#ifndef VM_RESERVED
342-
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 3, 0)
342+
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 3, 0) && !defined(RHEL_9_5_GE)
343343
vma->vm_flags |= VM_IO | VM_DONTEXPAND | VM_DONTDUMP;
344344
#else
345345
vm_flags_set(vma, VM_IO | VM_DONTEXPAND | VM_DONTDUMP);
346346
#endif
347347
#else
348-
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 3, 0)
348+
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 3, 0) && !defined(RHEL_9_5_GE)
349349
vma->vm_flags |= VM_IO | VM_RESERVED;
350350
#else
351351
vm_flags_set(vma, VM_IO | VM_RESERVED);

src/runtime_src/core/pcie/driver/linux/xocl/subdev/lapc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,13 +244,13 @@ static int lapc_mmap(struct file *filp, struct vm_area_struct *vma)
244244
* and prevent the pages from being swapped out
245245
*/
246246
#ifndef VM_RESERVED
247-
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 3, 0)
247+
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 3, 0) && !defined(RHEL_9_5_GE)
248248
vma->vm_flags |= VM_IO | VM_DONTEXPAND | VM_DONTDUMP;
249249
#else
250250
vm_flags_set(vma, VM_IO | VM_DONTEXPAND | VM_DONTDUMP);
251251
#endif
252252
#else
253-
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 3, 0)
253+
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 3, 0) && !defined(RHEL_9_5_GE)
254254
vma->vm_flags |= VM_IO | VM_RESERVED;
255255
#else
256256
vm_flags_set(vma, VM_IO | VM_RESERVED);

src/runtime_src/core/pcie/driver/linux/xocl/subdev/msix_xdma.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,11 @@ static irqreturn_t msix_xdma_isr(int irq, void *arg)
9090
ret = irq_entry->handler(irq, irq_entry->arg);
9191

9292
if (!IS_ERR_OR_NULL(irq_entry->event_ctx)) {
93+
#if KERNEL_VERSION(6, 8, 0) <= LINUX_VERSION_CODE || defined(RHEL_9_5_GE)
94+
eventfd_signal(irq_entry->event_ctx);
95+
#else
9396
eventfd_signal(irq_entry->event_ctx, 1);
97+
#endif
9498
}
9599

96100
return ret;

src/runtime_src/core/pcie/driver/linux/xocl/subdev/spc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,13 +225,13 @@ static int spc_mmap(struct file *filp, struct vm_area_struct *vma)
225225
* and prevent the pages from being swapped out
226226
*/
227227
#ifndef VM_RESERVED
228-
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 3, 0)
228+
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 3, 0) && !defined(RHEL_9_5_GE)
229229
vma->vm_flags |= VM_IO | VM_DONTEXPAND | VM_DONTDUMP;
230230
#else
231231
vm_flags_set(vma, VM_IO | VM_DONTEXPAND | VM_DONTDUMP);
232232
#endif
233233
#else
234-
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 3, 0)
234+
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 3, 0) && !defined(RHEL_9_5_GE)
235235
vma->vm_flags |= VM_IO | VM_RESERVED;
236236
#else
237237
vm_flags_set(vma, VM_IO | VM_RESERVED);

src/runtime_src/core/pcie/driver/linux/xocl/subdev/trace_fifo_lite.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,13 +209,13 @@ static int trace_fifo_lite_mmap(struct file *filp, struct vm_area_struct *vma)
209209
* and prevent the pages from being swapped out
210210
*/
211211
#ifndef VM_RESERVED
212-
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 3, 0)
212+
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 3, 0) && !defined(RHEL_9_5_GE)
213213
vma->vm_flags |= VM_IO | VM_DONTEXPAND | VM_DONTDUMP;
214214
#else
215215
vm_flags_set(vma, VM_IO | VM_DONTEXPAND | VM_DONTDUMP);
216216
#endif
217217
#else
218-
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 3, 0)
218+
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 3, 0) && !defined(RHEL_9_5_GE)
219219
vma->vm_flags |= VM_IO | VM_RESERVED;
220220
#else
221221
vm_flags_set(vma, VM_IO | VM_RESERVED);

src/runtime_src/core/pcie/driver/linux/xocl/subdev/trace_funnel.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,13 +212,13 @@ static int trace_funnel_mmap(struct file *filp, struct vm_area_struct *vma)
212212
* and prevent the pages from being swapped out
213213
*/
214214
#ifndef VM_RESERVED
215-
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 3, 0)
215+
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 3, 0) && !defined(RHEL_9_5_GE)
216216
vma->vm_flags |= VM_IO | VM_DONTEXPAND | VM_DONTDUMP;
217217
#else
218218
vm_flags_set(vma, VM_IO | VM_DONTEXPAND | VM_DONTDUMP);
219219
#endif
220220
#else
221-
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 3, 0)
221+
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 3, 0) && !defined(RHEL_9_5_GE)
222222
vma->vm_flags |= VM_IO | VM_RESERVED;
223223
#else
224224
vm_flags_set(vma, VM_IO | VM_RESERVED);

0 commit comments

Comments
 (0)