summaryrefslogtreecommitdiffstats
path: root/recipes-extended
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@gmail.com>2021-11-29 23:13:33 -0500
committerBruce Ashfield <bruce.ashfield@gmail.com>2021-11-29 23:13:33 -0500
commit844f4e1d7be32b4888193357d944fcf84170d019 (patch)
tree119a06b207374996917f7d832caf5c2e5fe7e6cb /recipes-extended
parent9a7aa013db5a13a82e9aa38ff0b1692ef4bf5478 (diff)
downloadmeta-virtualization-844f4e1d7be32b4888193357d944fcf84170d019.tar.gz
uxen-guest-tools: fix build against kernels 5.4+
This is a compile only fix to update the uxen kernel modules to work against newer kernels. Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Diffstat (limited to 'recipes-extended')
-rw-r--r--recipes-extended/uxen/uxen-guest-tools/0001-vm-support-fix-build-for-kernel-s-5.4.patch97
-rw-r--r--recipes-extended/uxen/uxen-guest-tools_4.1.8.bb1
2 files changed, 98 insertions, 0 deletions
diff --git a/recipes-extended/uxen/uxen-guest-tools/0001-vm-support-fix-build-for-kernel-s-5.4.patch b/recipes-extended/uxen/uxen-guest-tools/0001-vm-support-fix-build-for-kernel-s-5.4.patch
new file mode 100644
index 00000000..a3325ce6
--- /dev/null
+++ b/recipes-extended/uxen/uxen-guest-tools/0001-vm-support-fix-build-for-kernel-s-5.4.patch
@@ -0,0 +1,97 @@
1From 21bb6953a64390dd1c5a8b7520eb5e2c18ea3ff1 Mon Sep 17 00:00:00 2001
2From: Bruce Ashfield <bruce.ashfield@gmail.com>
3Date: Mon, 29 Nov 2021 21:01:03 -0500
4Subject: [PATCH] vm-support: fix build for kernel's > 5.4
5
6Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
7---
8 a/uxenhc/hypercall.c | 10 +++++++++-
9 a/v4vvsock/v4v_vsock.c | 2 ++
10 a/vmdiagnostics/vm_diagnostics.c | 9 ++++++++-
11 3 files changed, 19 insertions(+), 2 deletions(-)
12
13diff --git a/uxenhc/hypercall.c b/uxenhc/hypercall.c
14index 0b9ef3f..04957a8 100644
15--- a/uxenhc/hypercall.c
16+++ b/uxenhc/hypercall.c
17@@ -10,6 +10,7 @@
18 #include <linux/mm.h>
19 #include <linux/spinlock.h>
20 #include <linux/compiler.h>
21+#include <linux/version.h>
22
23 #include <xen/xen.h>
24 #include <xen/version.h>
25@@ -124,7 +125,11 @@ static int __init uxen_hypercall_init(void)
26 printk(KERN_INFO "using uxen hypervisor\n");
27
28 if (!uxen_hcbase) {
29+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,8,0))
30 uxen_hcbase = __vmalloc(PAGE_SIZE, GFP_KERNEL, PAGE_KERNEL_EXEC);
31+#else
32+ uxen_hcbase = __vmalloc(PAGE_SIZE, GFP_KERNEL);
33+#endif
34 if (!uxen_hcbase) {
35 ret = -ENOMEM;
36 goto out;
37@@ -149,8 +154,11 @@ static void __exit uxen_hypercall_exit(void)
38 {
39 }
40
41+
42+#define KBUILD_MODFILE "uxenhc"
43+
44 module_init(uxen_hypercall_init);
45 module_exit(uxen_hypercall_exit);
46+MODULE_LICENSE("GPL");
47 MODULE_AUTHOR("paulian.marinca@bromium.com");
48 MODULE_DESCRIPTION("uXen hypercall support");
49-MODULE_LICENSE("GPL");
50diff --git a/v4vvsock/v4v_vsock.c b/v4vvsock/v4v_vsock.c
51index 8d80d7d..cd7e8ce 100644
52--- a/v4vvsock/v4v_vsock.c
53+++ b/v4vvsock/v4v_vsock.c
54@@ -578,8 +578,10 @@ static const struct proto_ops vsock_dgram_ops = {
55 .ioctl = sock_no_ioctl,
56 .listen = sock_no_listen,
57 .shutdown = sock_no_shutdown,
58+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,10,0))
59 .setsockopt = sock_no_setsockopt,
60 .getsockopt = sock_no_getsockopt,
61+#endif
62 .sendmsg = vsock_sendmsg,
63 .recvmsg = vsock_recvmsg,
64 .mmap = sock_no_mmap,
65diff --git a/vmdiagnostics/vm_diagnostics.c b/vmdiagnostics/vm_diagnostics.c
66index 9ff94fb..db14e57 100644
67--- a/vmdiagnostics/vm_diagnostics.c
68+++ b/vmdiagnostics/vm_diagnostics.c
69@@ -22,6 +22,7 @@
70 #include <linux/timekeeping.h>
71 #include <linux/types.h>
72 #include <linux/vmstat.h>
73+#include <linux/version.h>
74
75 #include <uxen-v4vlib.h>
76
77@@ -403,10 +404,16 @@ static void vm_handle_request_stat_task(struct vm_diagnostics_context *context,
78
79 task_payload.state = task_state_to_char(task);
80 task_payload.num_threads = get_nr_threads(task);
81+
82+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,5,0))
83 task_payload.start_time_nsec = task->real_start_time;
84+#else
85+ task_payload.start_time_nsec = task->start_boottime;
86+#endif
87+
88 task_payload.last_run_cpu_id = task_cpu(task);
89
90- thread_group_cputime_adjusted(task, &user_nsec, &system_nsec);
91+ //thread_group_cputime_adjusted(task, &user_nsec, &system_nsec);
92 task_payload.user_nsec = user_nsec;
93 task_payload.system_nsec = system_nsec;
94
95--
962.19.1
97
diff --git a/recipes-extended/uxen/uxen-guest-tools_4.1.8.bb b/recipes-extended/uxen/uxen-guest-tools_4.1.8.bb
index 2ca0cb1d..06dc3768 100644
--- a/recipes-extended/uxen/uxen-guest-tools_4.1.8.bb
+++ b/recipes-extended/uxen/uxen-guest-tools_4.1.8.bb
@@ -9,6 +9,7 @@ SRC_URI = " \
9 https://www.bromium.com/wp-content/uploads/2019/11/uxen-${PV}.zip;name=uxen \ 9 https://www.bromium.com/wp-content/uploads/2019/11/uxen-${PV}.zip;name=uxen \
10 https://www.bromium.com/wp-content/uploads/2019/11/Bromium-4.1.8-Open-Source-Software.pdf;name=license \ 10 https://www.bromium.com/wp-content/uploads/2019/11/Bromium-4.1.8-Open-Source-Software.pdf;name=license \
11 file://fix-Makefile-for-OE-kernel-build.patch \ 11 file://fix-Makefile-for-OE-kernel-build.patch \
12 file://0001-vm-support-fix-build-for-kernel-s-5.4.patch \
12 " 13 "
13 14
14SRC_URI[uxen.sha384sum] = "be2233bc6506a23350d76c03ac28ea7ea381e1dc6ed5ce996e8ac71e6a3316fcaa2ed070c622618bd226f43a4d6db5d4" 15SRC_URI[uxen.sha384sum] = "be2233bc6506a23350d76c03ac28ea7ea381e1dc6ed5ce996e8ac71e6a3316fcaa2ed070c622618bd226f43a4d6db5d4"