summarylogtreecommitdiffstats
path: root/vmmon.patch
diff options
context:
space:
mode:
authorJean-Marc Lenoir2022-04-09 15:34:34 +0200
committerJean-Marc Lenoir2022-04-09 15:34:34 +0200
commit8bc636602e26f505c39a18cd15c7f73d9516a562 (patch)
tree4d4a9af64a99231cbdd0d3bf2104830d01d57bdf /vmmon.patch
parent71abfac85200709ac584ca10cd93c2ea5a0054e9 (diff)
downloadaur-8bc636602e26f505c39a18cd15c7f73d9516a562.tar.gz
Compatibility with Linux 5.18-rc1
Diffstat (limited to 'vmmon.patch')
-rw-r--r--vmmon.patch28
1 files changed, 28 insertions, 0 deletions
diff --git a/vmmon.patch b/vmmon.patch
index 56f7da0a9828..167c16fdcfdd 100644
--- a/vmmon.patch
+++ b/vmmon.patch
@@ -78,3 +78,31 @@ index 0ec30b3..b920e2d 100644
#else
/*
* Vmkernel's bogus __FreeBSD__ value causes gcc <stddef.h> to break.
+From 16d490ae022d7fc4ca867971e20e2dcd59e6ca5a Mon Sep 17 00:00:00 2001
+From: Michal Kubecek <mkubecek@suse.cz>
+Date: Mon, 4 Apr 2022 01:57:28 +0200
+Subject: [PATCH] vmmon: do not rely on HAVE_GET_KERNEL_NOFAULT
+
+Mainline commit 34737e269803 ("uaccess: add generic
+__{get,put}_kernel_nofault") in 5.18-rc1 removes HAVE_GET_KERNEL_NOFAULT
+macro as all architectures can use get_kernel_nofault() now. Check for
+existence of __get_kernel_nofault() instead and add also a version check in
+case it stops being a macro or is removed in the future.
+---
+ vmmon-only/linux/hostif.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/vmmon-only/linux/hostif.c b/vmmon-only/linux/hostif.c
+index a21c300..b6326e9 100644
+--- a/vmmon-only/linux/hostif.c
++++ b/vmmon-only/linux/hostif.c
+@@ -2356,7 +2356,8 @@ isVAReadable(VA r) // IN:
+ int ret;
+
+ r = APICR_TO_ADDR(r, APICR_VERSION);
+-#ifdef HAVE_GET_KERNEL_NOFAULT
++#if defined(HAVE_GET_KERNEL_NOFAULT) || defined(__get_kernel_nofault) || \
++ (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0))
+ ret = get_kernel_nofault(dummy, (void *)r);
+ #else
+ {