meta-virtualization.lists.yoctoproject.org archive mirror
 help / color / mirror / Atom feed
* [meta-virtualization][honister][PATCH 1/5] uxen-guest-tools: fix build against kernels 5.4+
@ 2021-12-01 16:40 Martin Jansa
  2021-12-01 16:40 ` [meta-virtualization][honister][PATCH 2/5] uxen-guest-tools: fix build against kernels 5.15+ Martin Jansa
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Martin Jansa @ 2021-12-01 16:40 UTC (permalink / raw)
  To: meta-virtualization; +Cc: Bruce Ashfield

From: Bruce Ashfield <bruce.ashfield@gmail.com>

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>
---
 ...m-support-fix-build-for-kernel-s-5.4.patch | 97 +++++++++++++++++++
 .../uxen/uxen-guest-tools_4.1.8.bb            |  1 +
 2 files changed, 98 insertions(+)
 create mode 100644 recipes-extended/uxen/uxen-guest-tools/0001-vm-support-fix-build-for-kernel-s-5.4.patch

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 0000000..a3325ce
--- /dev/null
+++ b/recipes-extended/uxen/uxen-guest-tools/0001-vm-support-fix-build-for-kernel-s-5.4.patch
@@ -0,0 +1,97 @@
+From 21bb6953a64390dd1c5a8b7520eb5e2c18ea3ff1 Mon Sep 17 00:00:00 2001
+From: Bruce Ashfield <bruce.ashfield@gmail.com>
+Date: Mon, 29 Nov 2021 21:01:03 -0500
+Subject: [PATCH] vm-support: fix build for kernel's > 5.4
+
+Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
+---
+ a/uxenhc/hypercall.c             | 10 +++++++++-
+ a/v4vvsock/v4v_vsock.c           |  2 ++
+ a/vmdiagnostics/vm_diagnostics.c |  9 ++++++++-
+ 3 files changed, 19 insertions(+), 2 deletions(-)
+
+diff --git a/uxenhc/hypercall.c b/uxenhc/hypercall.c
+index 0b9ef3f..04957a8 100644
+--- a/uxenhc/hypercall.c
++++ b/uxenhc/hypercall.c
+@@ -10,6 +10,7 @@
+ #include <linux/mm.h>
+ #include <linux/spinlock.h>
+ #include <linux/compiler.h>
++#include <linux/version.h>
+ 
+ #include <xen/xen.h>
+ #include <xen/version.h>
+@@ -124,7 +125,11 @@ static int __init uxen_hypercall_init(void)
+     printk(KERN_INFO "using uxen hypervisor\n");
+ 
+     if (!uxen_hcbase) {
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,8,0))
+         uxen_hcbase =  __vmalloc(PAGE_SIZE, GFP_KERNEL, PAGE_KERNEL_EXEC);
++#else
++	uxen_hcbase =  __vmalloc(PAGE_SIZE, GFP_KERNEL);
++#endif
+         if (!uxen_hcbase) {
+             ret = -ENOMEM;
+             goto out;
+@@ -149,8 +154,11 @@ static void __exit uxen_hypercall_exit(void)
+ {
+ }
+ 
++
++#define KBUILD_MODFILE "uxenhc"
++
+ module_init(uxen_hypercall_init);
+ module_exit(uxen_hypercall_exit);
++MODULE_LICENSE("GPL");
+ MODULE_AUTHOR("paulian.marinca@bromium.com");
+ MODULE_DESCRIPTION("uXen hypercall support");
+-MODULE_LICENSE("GPL");
+diff --git a/v4vvsock/v4v_vsock.c b/v4vvsock/v4v_vsock.c
+index 8d80d7d..cd7e8ce 100644
+--- a/v4vvsock/v4v_vsock.c
++++ b/v4vvsock/v4v_vsock.c
+@@ -578,8 +578,10 @@ static const struct proto_ops vsock_dgram_ops = {
+     .ioctl = sock_no_ioctl,
+     .listen = sock_no_listen,
+     .shutdown = sock_no_shutdown,
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,10,0))
+     .setsockopt = sock_no_setsockopt,
+     .getsockopt = sock_no_getsockopt,
++#endif
+     .sendmsg = vsock_sendmsg,
+     .recvmsg = vsock_recvmsg,
+     .mmap = sock_no_mmap,
+diff --git a/vmdiagnostics/vm_diagnostics.c b/vmdiagnostics/vm_diagnostics.c
+index 9ff94fb..db14e57 100644
+--- a/vmdiagnostics/vm_diagnostics.c
++++ b/vmdiagnostics/vm_diagnostics.c
+@@ -22,6 +22,7 @@
+ #include <linux/timekeeping.h>
+ #include <linux/types.h>
+ #include <linux/vmstat.h>
++#include <linux/version.h>
+ 
+ #include <uxen-v4vlib.h>
+ 
+@@ -403,10 +404,16 @@ static void vm_handle_request_stat_task(struct vm_diagnostics_context *context,
+  
+             task_payload.state = task_state_to_char(task);
+             task_payload.num_threads = get_nr_threads(task);
++
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,5,0))
+             task_payload.start_time_nsec = task->real_start_time;
++#else
++            task_payload.start_time_nsec = task->start_boottime;
++#endif
++
+             task_payload.last_run_cpu_id = task_cpu(task);
+ 
+-            thread_group_cputime_adjusted(task, &user_nsec, &system_nsec);
++            //thread_group_cputime_adjusted(task, &user_nsec, &system_nsec);
+             task_payload.user_nsec = user_nsec;
+             task_payload.system_nsec = system_nsec;
+ 
+-- 
+2.19.1
+
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 2ca0cb1..06dc376 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 = " \
     https://www.bromium.com/wp-content/uploads/2019/11/uxen-${PV}.zip;name=uxen \
     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 \
     "
 
 SRC_URI[uxen.sha384sum] = "be2233bc6506a23350d76c03ac28ea7ea381e1dc6ed5ce996e8ac71e6a3316fcaa2ed070c622618bd226f43a4d6db5d4"
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [meta-virtualization][honister][PATCH 2/5] uxen-guest-tools: fix build against kernels 5.15+
  2021-12-01 16:40 [meta-virtualization][honister][PATCH 1/5] uxen-guest-tools: fix build against kernels 5.4+ Martin Jansa
@ 2021-12-01 16:40 ` Martin Jansa
  2021-12-01 16:40 ` [meta-virtualization][honister][PATCH 3/5] uxen-guest-tools: fix -DMODULE not working when building uxenhc module Martin Jansa
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Martin Jansa @ 2021-12-01 16:40 UTC (permalink / raw)
  To: meta-virtualization; +Cc: Martin Jansa, Bruce Ashfield

This is a compile only fix to update the uxen kernel modules to
work against newer kernels.

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
---
 ...-support-fix-build-for-kernel-s-5.15.patch | 46 +++++++++++++++++++
 ...-support-fix-build-for-kernel-s-5.14.patch | 32 +++++++++++++
 .../uxen/uxen-guest-tools_4.1.8.bb            |  4 +-
 3 files changed, 81 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

diff --git a/recipes-extended/uxen/uxen-guest-tools/0002-vm-support-fix-build-for-kernel-s-5.15.patch b/recipes-extended/uxen/uxen-guest-tools/0002-vm-support-fix-build-for-kernel-s-5.15.patch
new file mode 100644
index 0000000..6b7f1f8
--- /dev/null
+++ b/recipes-extended/uxen/uxen-guest-tools/0002-vm-support-fix-build-for-kernel-s-5.15.patch
@@ -0,0 +1,46 @@
+From f8a33a209498b32b0fc06d80baa071f0902b9a85 Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@gmail.com>
+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 <Martin.Jansa@gmail.com>
+---
+ uxenplatform/platform.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/uxenplatform/platform.c b/uxenplatform/platform.c
+index 99fc76a..5225a00 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>
+@@ -32,14 +33,20 @@ static int bus_probe(struct device *_dev)
+     return drv && drv->probe ? drv->probe(dev) : -ENODEV;
+ }
+ 
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,15,0))
+ static int bus_remove(struct device *_dev)
++#else
++static void bus_remove(struct device *_dev)
++#endif
+ {
+     struct uxen_device *dev = dev_to_uxen(_dev);
+     struct uxen_driver *drv = drv_to_uxen(_dev->driver);
+ 
+     if (dev && drv && drv->remove)
+        drv->remove(dev);
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,15,0))
+     return 0;
++#endif
+ }
+ 
+ static int bus_suspend(struct device *_dev, pm_message_t state)
diff --git a/recipes-extended/uxen/uxen-guest-tools/0003-vm-support-fix-build-for-kernel-s-5.14.patch b/recipes-extended/uxen/uxen-guest-tools/0003-vm-support-fix-build-for-kernel-s-5.14.patch
new file mode 100644
index 0000000..ec31eea
--- /dev/null
+++ b/recipes-extended/uxen/uxen-guest-tools/0003-vm-support-fix-build-for-kernel-s-5.14.patch
@@ -0,0 +1,32 @@
+From 59986e91d807591f05dfbd57b459ba71670874f9 Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@gmail.com>
+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 <Martin.Jansa@gmail.com>
+---
+ 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);
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 06dc376..841c71a 100644
--- a/recipes-extended/uxen/uxen-guest-tools_4.1.8.bb
+++ b/recipes-extended/uxen/uxen-guest-tools_4.1.8.bb
@@ -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"
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [meta-virtualization][honister][PATCH 3/5] uxen-guest-tools: fix -DMODULE not working when building uxenhc module
  2021-12-01 16:40 [meta-virtualization][honister][PATCH 1/5] uxen-guest-tools: fix build against kernels 5.4+ Martin Jansa
  2021-12-01 16:40 ` [meta-virtualization][honister][PATCH 2/5] uxen-guest-tools: fix build against kernels 5.15+ Martin Jansa
@ 2021-12-01 16:40 ` Martin Jansa
  2021-12-01 16:40 ` [meta-virtualization][honister][PATCH 4/5] xvisor: uprev to latest master and fix python reference Martin Jansa
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Martin Jansa @ 2021-12-01 16:40 UTC (permalink / raw)
  To: meta-virtualization; +Cc: Martin Jansa, Bruce Ashfield

* undo the unnecessary and incomplete changes from 0001-vm-support-fix-build-for-kernel-s-5.4.patch
  because with 5.15 it was still failing with:
  ERROR: modpost: missing MODULE_LICENSE() in uxen-guest-tools/4.1.8-r0/uxen-4.1.8-72a4af9/vm-support/linux/uxenhc/uxenhc.o

  fix it properly in 0004-uxenhc-fix-DMODULE-not-working-on-module-build-comma.patch

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
---
 ...m-support-fix-build-for-kernel-s-5.4.patch | 13 -----
 ...LE-not-working-on-module-build-comma.patch | 56 +++++++++++++++++++
 .../uxen/uxen-guest-tools_4.1.8.bb            |  1 +
 3 files changed, 57 insertions(+), 13 deletions(-)
 create mode 100644 recipes-extended/uxen/uxen-guest-tools/0004-uxenhc-fix-DMODULE-not-working-on-module-build-comma.patch

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
index a3325ce..287170c 100644
--- 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
@@ -34,19 +34,6 @@ index 0b9ef3f..04957a8 100644
          if (!uxen_hcbase) {
              ret = -ENOMEM;
              goto out;
-@@ -149,8 +154,11 @@ static void __exit uxen_hypercall_exit(void)
- {
- }
- 
-+
-+#define KBUILD_MODFILE "uxenhc"
-+
- module_init(uxen_hypercall_init);
- module_exit(uxen_hypercall_exit);
-+MODULE_LICENSE("GPL");
- MODULE_AUTHOR("paulian.marinca@bromium.com");
- MODULE_DESCRIPTION("uXen hypercall support");
--MODULE_LICENSE("GPL");
 diff --git a/v4vvsock/v4v_vsock.c b/v4vvsock/v4v_vsock.c
 index 8d80d7d..cd7e8ce 100644
 --- a/v4vvsock/v4v_vsock.c
diff --git a/recipes-extended/uxen/uxen-guest-tools/0004-uxenhc-fix-DMODULE-not-working-on-module-build-comma.patch b/recipes-extended/uxen/uxen-guest-tools/0004-uxenhc-fix-DMODULE-not-working-on-module-build-comma.patch
new file mode 100644
index 0000000..60018f0
--- /dev/null
+++ b/recipes-extended/uxen/uxen-guest-tools/0004-uxenhc-fix-DMODULE-not-working-on-module-build-comma.patch
@@ -0,0 +1,56 @@
+From 732791cb353289e37448d84503a7d62ca156f29f Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@gmail.com>
+Date: Tue, 30 Nov 2021 16:33:14 +0000
+Subject: [PATCH] uxenhc: fix -DMODULE not working on module build command line
+
+* ATTOXEN_API_INC isn't defined anywhere in our OE builds, so the command line ends like this:
+
+  x86_64-oe-linux-gcc  -fuse-ld=bfd -fmacro-prefix-map=/OE/work/qemux86_64-oe-linux/uxen-guest-tools/4.1.8-r0=/usr/src/debug/uxen-guest-tools/4.1.8-r0                      -fdebug-prefix-map=/OE/work/qemux86_64-oe-linux/uxen-guest-tools/4.1.8-r0=/usr/src/debug/uxen-guest-tools/4.1.8-r0                      -fdebug-prefix-map=/OE/work/qemux86_64-oe-linux/uxen-guest-tools/4.1.8-r0/recipe-sysroot=                      -fdebug-prefix-map=/OE/work/qemux86_64-oe-linux/uxen-guest-tools/4.1.8-r0/recipe-sysroot-native=  -fdebug-prefix-map=/OE/work-shared/qemux86-64/kernel-source=/usr/src/kernel -Wp,-MMD,/OE/work/qemux86_64-oe-linux/uxen-guest-tools/4.1.8-r0/uxen-4.1.8-72a4af9/vm-support/linux/uxenhc/.hypercall.o.d -I/OE/work/qemux86_64-oe-linux/uxen-guest-tools/4.1.8-r0/uxen-4.1.8-72a4af9/vm-support/linux/include/ -I/OE/work/qemux86_64-oe-linux/uxen-guest-tools/4.1.8-r0/uxen-4.1.8-72a4af9/vm-support/linux/include/uxen -I/OE/work/qemux86_64-oe-linux/uxen-guest-tools/4.1.8-r0/uxen-4.1.8-72a4af9/vm-support/linux/include/uxen/xen -I/OE/work-shared/qemux86-64/kernel-source/arch/x86/include -I./arch/x86/include/generated -I/OE/work-shared/qemux86-64/kernel-source/include -I./include -I/OE/work-shared/qemux86-64/kernel-source/arch/x86/include/uapi -I./arch/x86/include/generated/uapi -I/OE/work-shared/qemux86-64/kernel-source/include/uapi -I./include/generated/uapi -include /OE/work-shared/qemux86-64/kernel-source/include/linux/compiler-version.h -include /OE/work-shared/qemux86-64/kernel-source/include/linux/kconfig.h -include /OE/work-shared/qemux86-64/kernel-source/include/linux/compiler_types.h -D__KERNEL__ -fmacro-prefix-map=/OE/work-shared/qemux86-64/kernel-source/= -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE -Werror=implicit-function-declaration -Werror=implicit-int -Werror=return-type -Wno-format-security -std=gnu89 -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -fcf-protection=none -m64 -falign-jumps=1 -falign-loops=1 -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mskip-rax-setup -march=core2 -mno-red-zone -mcmodel=kernel -Wno-sign-compare -fno-asynchronous-unwind-tables -mindirect-branch=thunk-extern -mindirect-branch-register -fno-jump-tables -fno-delete-null-pointer-checks -Wno-frame-address -Wno-format-truncation -Wno-format-overflow -Wno-address-of-packed-member -O2 -fno-allow-store-data-races -Wframe-larger-than=2048 -fstack-protector-strong -Wimplicit-fallthrough=5 -Wno-main -Wno-unused-but-set-variable -Wno-unused-const-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-stack-clash-protection -pg -mrecord-mcount -mfentry -DCC_USING_FENTRY -Wdeclaration-after-statement -Wvla -Wno-pointer-sign -Wno-stringop-truncation -Wno-zero-length-bounds -Wno-array-bounds -Wno-stringop-overflow -Wno-restrict -Wno-maybe-uninitialized -fno-strict-overflow -fno-stack-check -fconserve-stack -Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init -Wno-packed-not-aligned -DLX_TARGET_STANDARDVM -g -Wall -I  -DMODULE  -DKBUILD_BASENAME='"hypercall"' -DKBUILD_MODNAME='"uxenhc"' -D__KBUILD_MODNAME=kmod_uxenhc -c -o /OE/work/qemux86_64-oe-linux/uxen-guest-tools/4.1.8-r0/uxen-4.1.8-72a4af9/vm-support/linux/uxenhc/hypercall.o /OE/work/qemux86_64-oe-linux/uxen-guest-tools/4.1.8-r0/uxen-4.1.8-72a4af9/vm-support/linux/uxenhc/hypercall.c
+
+  the important part is "-I  -DMODULE" which breaks include/linux/module.h behavior:
+
+  /*
+   * MODULE_FILE is used for generating modules.builtin
+   * So, make it no-op when this is being built as a module
+   */
+  #ifdef MODULE
+  #define MODULE_FILE
+  #else
+  #define MODULE_FILE     MODULE_INFO(file, KBUILD_MODFILE);
+  #endif
+
+  resulting in:
+
+  In file included from /OE/work-shared/qemux86-64/kernel-source/include/linux/module.h:22,
+                   from /OE/work/qemux86_64-oe-linux/uxen-guest-tools/4.1.8-r0/uxen-4.1.8-72a4af9/vm-support/linux/uxenhc/hypercall.c:3:
+  /OE/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);
+        |                                           ^~~~~~~~~~~~~~
+  /OE/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
+        |                                                             ^~~~
+  /OE/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);
+        |                         ^~~~~~~~~~~
+  /OE/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)
+        |                                  ^~~~~~~~~~~
+  /OE/work/qemux86_64-oe-linux/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 <Martin.Jansa@gmail.com>
+---
+ uxenhc/Kbuild | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/uxenhc/Kbuild b/uxenhc/Kbuild
+index e418096..ef1b145 100644
+--- a/uxenhc/Kbuild
++++ b/uxenhc/Kbuild
+@@ -1,4 +1,3 @@
+ obj-m += uxenhc.o
+ 
+ uxenhc-y := hypercall.o
+-CFLAGS_hypercall.o := -I$(ATTOXEN_API_INC)
+\ No newline at end of file
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 841c71a..529efdb 100644
--- a/recipes-extended/uxen/uxen-guest-tools_4.1.8.bb
+++ b/recipes-extended/uxen/uxen-guest-tools_4.1.8.bb
@@ -12,6 +12,7 @@ SRC_URI = " \
     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 \
+    file://0004-uxenhc-fix-DMODULE-not-working-on-module-build-comma.patch \
 "
 
 SRC_URI[uxen.sha384sum] = "be2233bc6506a23350d76c03ac28ea7ea381e1dc6ed5ce996e8ac71e6a3316fcaa2ed070c622618bd226f43a4d6db5d4"
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [meta-virtualization][honister][PATCH 4/5] xvisor: uprev to latest master and fix python reference
  2021-12-01 16:40 [meta-virtualization][honister][PATCH 1/5] uxen-guest-tools: fix build against kernels 5.4+ Martin Jansa
  2021-12-01 16:40 ` [meta-virtualization][honister][PATCH 2/5] uxen-guest-tools: fix build against kernels 5.15+ Martin Jansa
  2021-12-01 16:40 ` [meta-virtualization][honister][PATCH 3/5] uxen-guest-tools: fix -DMODULE not working when building uxenhc module Martin Jansa
@ 2021-12-01 16:40 ` Martin Jansa
  2021-12-01 16:40 ` [meta-virtualization][honister][PATCH 5/5] xvisor: set PV Martin Jansa
  2021-12-02  4:04 ` [meta-virtualization][honister][PATCH 1/5] uxen-guest-tools: fix build against kernels 5.4+ Bruce Ashfield
  4 siblings, 0 replies; 6+ messages in thread
From: Martin Jansa @ 2021-12-01 16:40 UTC (permalink / raw)
  To: meta-virtualization; +Cc: Bruce Ashfield

From: Bruce Ashfield <bruce.ashfield@gmail.com>

Bumping to the latest xvisor tip.

We drop one patch that is now part of the upstream, and we
add another to remove /usr/bin/python from scripts called
during build, since it breaks the build on hosts without
/usr/bin/python.

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
---
 ...-Allow-Xvisor-to-compile-with-gcc-10.patch | 55 -------------------
 ...d-use-usr-bin-env-for-python-scripts.patch | 36 ++++++++++++
 recipes-extended/xvisor/xvisor_git.bb         |  4 +-
 3 files changed, 38 insertions(+), 57 deletions(-)
 delete mode 100644 recipes-extended/xvisor/files/0001-EMULATORS-Allow-Xvisor-to-compile-with-gcc-10.patch
 create mode 100644 recipes-extended/xvisor/files/0001-build-use-usr-bin-env-for-python-scripts.patch

diff --git a/recipes-extended/xvisor/files/0001-EMULATORS-Allow-Xvisor-to-compile-with-gcc-10.patch b/recipes-extended/xvisor/files/0001-EMULATORS-Allow-Xvisor-to-compile-with-gcc-10.patch
deleted file mode 100644
index 221a314..0000000
--- a/recipes-extended/xvisor/files/0001-EMULATORS-Allow-Xvisor-to-compile-with-gcc-10.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-From 417184cc41cfd33ae7b4c11c8396e0f47f43e2ba Mon Sep 17 00:00:00 2001
-From: Jean-Christophe Dubois <jcd@tribudubois.net>
-Date: Fri, 8 May 2020 15:17:36 +0200
-Subject: [PATCH] EMULATORS: Allow Xvisor to compile with gcc 10.
-
-With gcc 10 because some header files do not declare some variable
-definition as extern, the variable get duplicated in all files
-using it.
-
-This patch allow xvisor to compile with the latest gcc.
-
-Signed-off-by: Jean-Christophe Dubois <jcd@tribudubois.net>
-Reviewed-by: Anup Patel <anup@brainfault.org>
----
- drivers/mmc/core/core.h    |  2 +-
- emulators/display/drawfn.h | 10 +++++-----
- 2 files changed, 6 insertions(+), 6 deletions(-)
-
-diff --git a/drivers/mmc/core/core.h b/drivers/mmc/core/core.h
-index d75d135a..e2ca3141 100644
---- a/drivers/mmc/core/core.h
-+++ b/drivers/mmc/core/core.h
-@@ -64,7 +64,7 @@ int mmc_go_idle(struct mmc_host *host);
-  * Note: Must be called with host->lock held.
-  */
- extern struct vmm_bus sdio_bus_type;
--struct vmm_device_type sdio_func_type;
-+extern struct vmm_device_type sdio_func_type;
- 
- int __sdio_attach(struct mmc_host *host);
- 
-diff --git a/emulators/display/drawfn.h b/emulators/display/drawfn.h
-index f9163cff..385deaf6 100644
---- a/emulators/display/drawfn.h
-+++ b/emulators/display/drawfn.h
-@@ -69,14 +69,14 @@ typedef void (*drawfn)(struct vmm_surface *,
- 				 DRAWFN_ORDER_MAX * \
- 				 DRAWFN_FORMAT_MAX)
- 
--drawfn drawfn_surface_fntable_8[DRAWFN_FNTABLE_SIZE];
-+extern drawfn drawfn_surface_fntable_8[DRAWFN_FNTABLE_SIZE];
- 
--drawfn drawfn_surface_fntable_15[DRAWFN_FNTABLE_SIZE];
-+extern drawfn drawfn_surface_fntable_15[DRAWFN_FNTABLE_SIZE];
- 
--drawfn drawfn_surface_fntable_16[DRAWFN_FNTABLE_SIZE];
-+extern drawfn drawfn_surface_fntable_16[DRAWFN_FNTABLE_SIZE];
- 
--drawfn drawfn_surface_fntable_24[DRAWFN_FNTABLE_SIZE];
-+extern drawfn drawfn_surface_fntable_24[DRAWFN_FNTABLE_SIZE];
- 
--drawfn drawfn_surface_fntable_32[DRAWFN_FNTABLE_SIZE];
-+extern drawfn drawfn_surface_fntable_32[DRAWFN_FNTABLE_SIZE];
- 
- #endif
diff --git a/recipes-extended/xvisor/files/0001-build-use-usr-bin-env-for-python-scripts.patch b/recipes-extended/xvisor/files/0001-build-use-usr-bin-env-for-python-scripts.patch
new file mode 100644
index 0000000..dfbb00b
--- /dev/null
+++ b/recipes-extended/xvisor/files/0001-build-use-usr-bin-env-for-python-scripts.patch
@@ -0,0 +1,36 @@
+From eb351ca63a86f53cfb18987284a1445d543dfe56 Mon Sep 17 00:00:00 2001
+From: Bruce Ashfield <bruce.ashfield@gmail.com>
+Date: Mon, 29 Nov 2021 17:20:00 -0500
+Subject: [PATCH] build: use /usr/bin/env for python scripts
+
+Without this, we break on hosts without /usr/bin/python
+
+Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
+---
+ tools/scripts/d2c.py    | 2 +-
+ tools/scripts/memimg.py | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/tools/scripts/d2c.py b/tools/scripts/d2c.py
+index b46a7bc4..0a6bce08 100755
+--- a/tools/scripts/d2c.py
++++ b/tools/scripts/d2c.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python
++#!/usr/bin/env python3
+ #/**
+ # Copyright (c) 2013 Anup Patel.
+ # All rights reserved.
+diff --git a/tools/scripts/memimg.py b/tools/scripts/memimg.py
+index 423c9c33..ba2f06cb 100755
+--- a/tools/scripts/memimg.py
++++ b/tools/scripts/memimg.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python
++#!/usr/bin/env python3
+ #/**
+ # Copyright (c) 2011 Anup Patel.
+ # All rights reserved.
+-- 
+2.19.1
+
diff --git a/recipes-extended/xvisor/xvisor_git.bb b/recipes-extended/xvisor/xvisor_git.bb
index 749fec3..4d2a719 100644
--- a/recipes-extended/xvisor/xvisor_git.bb
+++ b/recipes-extended/xvisor/xvisor_git.bb
@@ -9,10 +9,10 @@ require xvisor-configs.inc
 inherit autotools-brokensep
 
 # This version support the RISC-V v0.5.0 Hypervisor extensions
-SRCREV = "b3dac5b1f61f23f21dc59b3880897cff78f3b618"
+SRCREV = "6b23764a1439f9d08b2ed2f363da522460d8a22b"
 SRC_URI = "git://github.com/avpatel/xvisor-next.git;branch=master;protocol=https \
     file://0001-TESTS-Don-t-specify-mabi-or-march-for-RISC-V.patch \
-    file://0001-EMULATORS-Allow-Xvisor-to-compile-with-gcc-10.patch \
+    file://0001-build-use-usr-bin-env-for-python-scripts.patch \
 "
 
 S = "${WORKDIR}/git"
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [meta-virtualization][honister][PATCH 5/5] xvisor: set PV
  2021-12-01 16:40 [meta-virtualization][honister][PATCH 1/5] uxen-guest-tools: fix build against kernels 5.4+ Martin Jansa
                   ` (2 preceding siblings ...)
  2021-12-01 16:40 ` [meta-virtualization][honister][PATCH 4/5] xvisor: uprev to latest master and fix python reference Martin Jansa
@ 2021-12-01 16:40 ` Martin Jansa
  2021-12-02  4:04 ` [meta-virtualization][honister][PATCH 1/5] uxen-guest-tools: fix build against kernels 5.4+ Bruce Ashfield
  4 siblings, 0 replies; 6+ messages in thread
From: Martin Jansa @ 2021-12-01 16:40 UTC (permalink / raw)
  To: meta-virtualization; +Cc: Martin Jansa

* use something more reasonable than default 'git' from filename
* there wasn't a new tag for a long time, so this is quite far
  from 0.3.0 as git describe shows:
  v0.3.0-231-g6b23764a
  but 0.3.0 is still the closest release I've found
  and matches PROJECT_VERSION in Makefile:
  https://github.com/avpatel/xvisor-next/blob/6b23764a1439f9d08b2ed2f363da522460d8a22b/Makefile#L29

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 recipes-extended/xvisor/xvisor_git.bb | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/recipes-extended/xvisor/xvisor_git.bb b/recipes-extended/xvisor/xvisor_git.bb
index 4d2a719..26b4e0f 100644
--- a/recipes-extended/xvisor/xvisor_git.bb
+++ b/recipes-extended/xvisor/xvisor_git.bb
@@ -8,6 +8,8 @@ require xvisor-configs.inc
 
 inherit autotools-brokensep
 
+PV = "0.3.0+git${SRCPV}"
+
 # This version support the RISC-V v0.5.0 Hypervisor extensions
 SRCREV = "6b23764a1439f9d08b2ed2f363da522460d8a22b"
 SRC_URI = "git://github.com/avpatel/xvisor-next.git;branch=master;protocol=https \
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [meta-virtualization][honister][PATCH 1/5] uxen-guest-tools: fix build against kernels 5.4+
  2021-12-01 16:40 [meta-virtualization][honister][PATCH 1/5] uxen-guest-tools: fix build against kernels 5.4+ Martin Jansa
                   ` (3 preceding siblings ...)
  2021-12-01 16:40 ` [meta-virtualization][honister][PATCH 5/5] xvisor: set PV Martin Jansa
@ 2021-12-02  4:04 ` Bruce Ashfield
  4 siblings, 0 replies; 6+ messages in thread
From: Bruce Ashfield @ 2021-12-02  4:04 UTC (permalink / raw)
  To: Martin Jansa; +Cc: meta-virtualization

5/5 are now merged to honister.

Thanks!

Bruce

In message: [meta-virtualization][honister][PATCH 1/5] uxen-guest-tools: fix build against kernels 5.4+
on 01/12/2021 Martin Jansa wrote:

> From: Bruce Ashfield <bruce.ashfield@gmail.com>
> 
> 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>
> ---
>  ...m-support-fix-build-for-kernel-s-5.4.patch | 97 +++++++++++++++++++
>  .../uxen/uxen-guest-tools_4.1.8.bb            |  1 +
>  2 files changed, 98 insertions(+)
>  create mode 100644 recipes-extended/uxen/uxen-guest-tools/0001-vm-support-fix-build-for-kernel-s-5.4.patch
> 
> 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 0000000..a3325ce
> --- /dev/null
> +++ b/recipes-extended/uxen/uxen-guest-tools/0001-vm-support-fix-build-for-kernel-s-5.4.patch
> @@ -0,0 +1,97 @@
> +From 21bb6953a64390dd1c5a8b7520eb5e2c18ea3ff1 Mon Sep 17 00:00:00 2001
> +From: Bruce Ashfield <bruce.ashfield@gmail.com>
> +Date: Mon, 29 Nov 2021 21:01:03 -0500
> +Subject: [PATCH] vm-support: fix build for kernel's > 5.4
> +
> +Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
> +---
> + a/uxenhc/hypercall.c             | 10 +++++++++-
> + a/v4vvsock/v4v_vsock.c           |  2 ++
> + a/vmdiagnostics/vm_diagnostics.c |  9 ++++++++-
> + 3 files changed, 19 insertions(+), 2 deletions(-)
> +
> +diff --git a/uxenhc/hypercall.c b/uxenhc/hypercall.c
> +index 0b9ef3f..04957a8 100644
> +--- a/uxenhc/hypercall.c
> ++++ b/uxenhc/hypercall.c
> +@@ -10,6 +10,7 @@
> + #include <linux/mm.h>
> + #include <linux/spinlock.h>
> + #include <linux/compiler.h>
> ++#include <linux/version.h>
> + 
> + #include <xen/xen.h>
> + #include <xen/version.h>
> +@@ -124,7 +125,11 @@ static int __init uxen_hypercall_init(void)
> +     printk(KERN_INFO "using uxen hypervisor\n");
> + 
> +     if (!uxen_hcbase) {
> ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,8,0))
> +         uxen_hcbase =  __vmalloc(PAGE_SIZE, GFP_KERNEL, PAGE_KERNEL_EXEC);
> ++#else
> ++	uxen_hcbase =  __vmalloc(PAGE_SIZE, GFP_KERNEL);
> ++#endif
> +         if (!uxen_hcbase) {
> +             ret = -ENOMEM;
> +             goto out;
> +@@ -149,8 +154,11 @@ static void __exit uxen_hypercall_exit(void)
> + {
> + }
> + 
> ++
> ++#define KBUILD_MODFILE "uxenhc"
> ++
> + module_init(uxen_hypercall_init);
> + module_exit(uxen_hypercall_exit);
> ++MODULE_LICENSE("GPL");
> + MODULE_AUTHOR("paulian.marinca@bromium.com");
> + MODULE_DESCRIPTION("uXen hypercall support");
> +-MODULE_LICENSE("GPL");
> +diff --git a/v4vvsock/v4v_vsock.c b/v4vvsock/v4v_vsock.c
> +index 8d80d7d..cd7e8ce 100644
> +--- a/v4vvsock/v4v_vsock.c
> ++++ b/v4vvsock/v4v_vsock.c
> +@@ -578,8 +578,10 @@ static const struct proto_ops vsock_dgram_ops = {
> +     .ioctl = sock_no_ioctl,
> +     .listen = sock_no_listen,
> +     .shutdown = sock_no_shutdown,
> ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,10,0))
> +     .setsockopt = sock_no_setsockopt,
> +     .getsockopt = sock_no_getsockopt,
> ++#endif
> +     .sendmsg = vsock_sendmsg,
> +     .recvmsg = vsock_recvmsg,
> +     .mmap = sock_no_mmap,
> +diff --git a/vmdiagnostics/vm_diagnostics.c b/vmdiagnostics/vm_diagnostics.c
> +index 9ff94fb..db14e57 100644
> +--- a/vmdiagnostics/vm_diagnostics.c
> ++++ b/vmdiagnostics/vm_diagnostics.c
> +@@ -22,6 +22,7 @@
> + #include <linux/timekeeping.h>
> + #include <linux/types.h>
> + #include <linux/vmstat.h>
> ++#include <linux/version.h>
> + 
> + #include <uxen-v4vlib.h>
> + 
> +@@ -403,10 +404,16 @@ static void vm_handle_request_stat_task(struct vm_diagnostics_context *context,
> +  
> +             task_payload.state = task_state_to_char(task);
> +             task_payload.num_threads = get_nr_threads(task);
> ++
> ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,5,0))
> +             task_payload.start_time_nsec = task->real_start_time;
> ++#else
> ++            task_payload.start_time_nsec = task->start_boottime;
> ++#endif
> ++
> +             task_payload.last_run_cpu_id = task_cpu(task);
> + 
> +-            thread_group_cputime_adjusted(task, &user_nsec, &system_nsec);
> ++            //thread_group_cputime_adjusted(task, &user_nsec, &system_nsec);
> +             task_payload.user_nsec = user_nsec;
> +             task_payload.system_nsec = system_nsec;
> + 
> +-- 
> +2.19.1
> +
> 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 2ca0cb1..06dc376 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 = " \
>      https://www.bromium.com/wp-content/uploads/2019/11/uxen-${PV}.zip;name=uxen \
>      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 \
>      "
>  
>  SRC_URI[uxen.sha384sum] = "be2233bc6506a23350d76c03ac28ea7ea381e1dc6ed5ce996e8ac71e6a3316fcaa2ed070c622618bd226f43a4d6db5d4"
> -- 
> 2.32.0
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-12-02  4:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-01 16:40 [meta-virtualization][honister][PATCH 1/5] uxen-guest-tools: fix build against kernels 5.4+ Martin Jansa
2021-12-01 16:40 ` [meta-virtualization][honister][PATCH 2/5] uxen-guest-tools: fix build against kernels 5.15+ Martin Jansa
2021-12-01 16:40 ` [meta-virtualization][honister][PATCH 3/5] uxen-guest-tools: fix -DMODULE not working when building uxenhc module Martin Jansa
2021-12-01 16:40 ` [meta-virtualization][honister][PATCH 4/5] xvisor: uprev to latest master and fix python reference Martin Jansa
2021-12-01 16:40 ` [meta-virtualization][honister][PATCH 5/5] xvisor: set PV Martin Jansa
2021-12-02  4:04 ` [meta-virtualization][honister][PATCH 1/5] uxen-guest-tools: fix build against kernels 5.4+ Bruce Ashfield

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).