From df2a4e2636a8bf82262e1c5ad7f34fe33ffbb6dc Mon Sep 17 00:00:00 2001 From: Akihiro Saiki Date: Wed, 1 May 2024 18:13:47 +0900 Subject: [PATCH] keystone-driver: Support linux 6.8 --- linux-keystone-driver/keystone-page.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/linux-keystone-driver/keystone-page.c b/linux-keystone-driver/keystone-page.c index e27d0aa8c..77f06f3a1 100644 --- a/linux-keystone-driver/keystone-page.c +++ b/linux-keystone-driver/keystone-page.c @@ -6,6 +6,7 @@ #include #include "keystone.h" #include +#include /* Destroy all memory associated with an EPM */ int epm_destroy(struct epm* epm) { @@ -40,7 +41,11 @@ int epm_init(struct epm* epm, unsigned int min_pages) count = 0x1 << order; /* prevent kernel from complaining about an invalid argument */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 8, 0) + if (order < MAX_PAGE_ORDER) +#else if (order < MAX_ORDER) +#endif epm_vaddr = (vaddr_t) __get_free_pages(GFP_HIGHUSER, order); #ifdef CONFIG_CMA