uxen-guest-tools: fix build against kernels 5.15+
PATCH 1/1 uxen-guest-tools: fix build against kernels 5.15+
This is a compile only fix to update the uxen kernel modules to work against newer kernels.
There is one more issue with 5.15 and this applied:
ERROR: modpost: missing MODULE_LICENSE() in uxen-guest-tools/4.1.8-r0/uxen-4.1.8-72a4af9/vm-support/linux/uxenhc/uxenhc.o
Bruce already tried to fix it in 0001-vm-support-fix-build-for-kernel-s-5.4.patch but it isn't enough for 5.15 and if I remove his MODULE_LICENSE() and KBUILD_MODFILE changes, then I get probably the same error he was originally trying to fix for 5.4:
| make -C work-shared/qemux86-64/kernel-source LX_TARGET_ATTOVM=n LX_TARGET_STANDARDVM=y M=uxen-guest-tools/4.1.8-r0/uxen-4.1.8-72a4af9/vm-support/linux EXTRA_CFLAGS="-DLX_TARGET_STANDARDVM -g -Wall" NOSTDINC_FLAGS="-Iuxen-guest-tools/4.1.8-r0/uxen-4.1.8-72a4af9/vm-support/linux/include/ -Iuxen-guest-tools/4.1.8-r0/uxen-4.1.8-72a4af9/vm-support/linux/include/uxen -Iuxen-guest-tools/4.1.8-r0/uxen-4.1.8-72a4af9/vm-support/linux/include/uxen/xen"
| make[1]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
| make[1]: Entering directory 'work-shared/qemux86-64/kernel-source'
| make[2]: Entering directory 'work-shared/qemux86-64/kernel-build-artifacts'
| CC [M] uxen-guest-tools/4.1.8-r0/uxen-4.1.8-72a4af9/vm-support/linux/uxenhc/hypercall.o
| In file included from work-shared/qemux86-64/kernel-source/include/linux/module.h:22,
| from uxen-guest-tools/4.1.8-r0/uxen-4.1.8-72a4af9/vm-support/linux/uxenhc/hypercall.c:3:
| work-shared/qemux86-64/kernel-source/include/linux/module.h:183:43: error: expected ',' or ';' before 'KBUILD_MODFILE'
| 183 | #define MODULE_FILE MODULE_INFO(file, KBUILD_MODFILE);
| | ^~~~~~~~~~~~~~
| work-shared/qemux86-64/kernel-source/include/linux/moduleparam.h:26:61: note: in definition of macro '__MODULE_INFO'
| 26 | = __MODULE_INFO_PREFIX __stringify(tag) "=" info
| | ^~~~
| work-shared/qemux86-64/kernel-source/include/linux/module.h:183:25: note: in expansion of macro 'MODULE_INFO'
| 183 | #define MODULE_FILE MODULE_INFO(file, KBUILD_MODFILE);
| | ^~~~~~~~~~~
| work-shared/qemux86-64/kernel-source/include/linux/module.h:230:34: note: in expansion of macro 'MODULE_FILE'
| 230 | #define MODULE_LICENSE(_license) MODULE_FILE MODULE_INFO(license, _license)
| | ^~~~~~~~~~~
| uxen-guest-tools/4.1.8-r0/uxen-4.1.8-72a4af9/vm-support/linux/uxenhc/hypercall.c:161:1: note: in expansion of macro 'MODULE_LICENSE'
| 161 | MODULE_LICENSE("GPL");
| | ^~~~~~~~~~~~~~Signed-off-by Martin Jansa <[email protected]>
--- ...-support-fix-build-for-kernel-s-5.15.patch | 47 +++++++++++++++++++ ...-support-fix-build-for-kernel-s-5.14.patch | 32 +++++++++++++ .../uxen/uxen-guest-tools_4.1.8.bb | 4 +- 3 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 recipes-extended/uxen/uxen-guest-tools/0002-vm-support-fix-build-for-kernel-s-5.15.patch create mode 100644 recipes-extended/uxen/uxen-guest-tools/0003-vm-support-fix-build-for-kernel-s-5.14.patch
recipes-extended/uxen/uxen-guest-tools/0002-vm-support-fix-build-for-kernel-s-5.15.patch new file +47 -0
@@ -0,0 +1,47 @@ +From cc31e9648b76bfaa2f04825b5ef8c09fe79782f7 Mon Sep 17 00:00:00 2001 +From: Martin Jansa <[email protected]> +Date: Tue, 30 Nov 2021 06:45:34 -0800 +Subject: [PATCH] vm-support: fix build for kernel's > 5.15 + +* remove callback was changed to return void instead of int in: + https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=fc7a6209d5710618eb4f72a77cd81b8d694ecf89 + +Signed-off-by: Martin Jansa <[email protected]> +--- + uxenplatform/platform.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/uxenplatform/platform.c b/uxenplatform/platform.c +index 99fc76a..579be7a 100644 +--- a/uxenplatform/platform.c ++++ b/uxenplatform/platform.c +@@ -4,6 +4,7 @@ + #include <linux/random.h> + #include <linux/kthread.h> + #include <linux/delay.h> ++#include <linux/version.h> + + #include <uxen-hypercall.h> + #include <uxen-platform.h> +@@ -64,7 +65,11 @@ static int bus_resume(struct device *_dev) + return 0; + } + ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,15,0)) + static int device_remove(struct device *_dev, void *data) ++#else ++static void device_remove(struct device *_dev, void *data) ++#endif + { + struct uxen_device *dev = dev_to_uxen(_dev); + struct uxen_driver *drv = drv_to_uxen(_dev->driver); +@@ -72,7 +77,9 @@ static int device_remove(struct device *_dev, void *data) + if (dev && drv && drv->remove) + drv->remove(dev); + device_unregister(_dev); ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,15,0)) + return 0; ++#endif + } + + int protvm_use_secure_keyboard = 0;
recipes-extended/uxen/uxen-guest-tools/0003-vm-support-fix-build-for-kernel-s-5.14.patch new file +32 -0
@@ -0,0 +1,32 @@ +From 59986e91d807591f05dfbd57b459ba71670874f9 Mon Sep 17 00:00:00 2001 +From: Martin Jansa <[email protected]> +Date: Tue, 30 Nov 2021 15:04:31 +0000 +Subject: [PATCH] vm-support: fix build for kernel's > 5.14 + +* remove set_driver_byte call +* not sure if it's still necessary here, but set_driver_byte as well as DRIVER_SENSE was killed in 5.14 with: + https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=464a00c9e0ad45e3f42ff6ea705491a356df818e + + in some cases it was replaced with set_status_byte(sc, SAM_STAT_CHECK_CONDITION), but I didn't + read the implementation carefully enough to decide if this is still needed, I was only interested + in fixing the build failure (and I don't use this at all to test it in runtime) + +Signed-off-by: Martin Jansa <[email protected]> +--- + uxenstor/stor.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/uxenstor/stor.c b/uxenstor/stor.c +index e07b08e..6bf2184 100644 +--- a/uxenstor/stor.c ++++ b/uxenstor/stor.c +@@ -109,7 +109,9 @@ static void uxenstor_softirq(unsigned long opaque) + sc->sense_buffer, + sizeof(hdr) + hdr.sense_size, + 0, sizeof(hdr)); ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,14,0)) + set_driver_byte(sc, DRIVER_SENSE); ++#endif + } + + set_host_byte(sc, DID_ERROR);
recipes-extended/uxen/uxen-guest-tools_4.1.8.bb +3 -1
@@ -10,7 +10,9 @@ SRC_URI = " \ https://www.bromium.com/wp-content/uploads/2019/11/Bromium-4.1.8-Open-Source-Software.pdf;name=license \ file://fix-Makefile-for-OE-kernel-build.patch \ file://0001-vm-support-fix-build-for-kernel-s-5.4.patch \ - " + file://0002-vm-support-fix-build-for-kernel-s-5.15.patch \ + file://0003-vm-support-fix-build-for-kernel-s-5.14.patch \ +" SRC_URI[uxen.sha384sum] = "be2233bc6506a23350d76c03ac28ea7ea381e1dc6ed5ce996e8ac71e6a3316fcaa2ed070c622618bd226f43a4d6db5d4" SRC_URI[license.sha384sum] = "92e48c614df3094cb52321d4c4e01f6df5526d46aee5c6fa36c43ee23d4c33f03baa1fc5f6f29efafff636b6d13bc92c"
Signature · 1 line
2.32.0