Date   

[hardknott][PATCH 01/13] uxen: update guest tools to 4.1.8

Martin Jansa
 

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

Signed-off-by: Bruce Ashfield <bruce.ashfield@...>
---
...xen-guest-tools_4.1.7.bb => uxen-guest-tools_4.1.8.bb} | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
rename recipes-extended/uxen/{uxen-guest-tools_4.1.7.bb => uxen-guest-tools_4.1.8.bb} (63%)

diff --git a/recipes-extended/uxen/uxen-guest-tools_4.1.7.bb b/recipes-extended/uxen/uxen-guest-tools_4.1.8.bb
similarity index 63%
rename from recipes-extended/uxen/uxen-guest-tools_4.1.7.bb
rename to recipes-extended/uxen/uxen-guest-tools_4.1.8.bb
index 4dcfe51..2ca0cb1 100644
--- a/recipes-extended/uxen/uxen-guest-tools_4.1.7.bb
+++ b/recipes-extended/uxen/uxen-guest-tools_4.1.8.bb
@@ -6,17 +6,17 @@ LICENSE = "GPLv2"
COMPATIBLE_HOST = '(x86_64.*).*-linux'

SRC_URI = " \
- https://www.bromium.com/wp-content/uploads/2019/06/uxen-vmsupport-linux-${PV}.zip;name=uxen \
+ 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 \
"

-SRC_URI[uxen.sha384sum] = "d9d7a1fa5c44ac77eea3d8d4756f9e07fc02acfe12606325ff0bb8a60c07abc3e9ddb80c2039797fb2122d750219722f"
+SRC_URI[uxen.sha384sum] = "be2233bc6506a23350d76c03ac28ea7ea381e1dc6ed5ce996e8ac71e6a3316fcaa2ed070c622618bd226f43a4d6db5d4"
SRC_URI[license.sha384sum] = "92e48c614df3094cb52321d4c4e01f6df5526d46aee5c6fa36c43ee23d4c33f03baa1fc5f6f29efafff636b6d13bc92c"

# The software license is GPLv2: please see page 199 of the pdf document
-LIC_FILES_CHKSUM = "file://../Bromium-4.1.8-Open-Source-Software.pdf;md5=cf120df6ffa417b36f870a9997650049"
+LIC_FILES_CHKSUM = "file://${WORKDIR}/Bromium-4.1.8-Open-Source-Software.pdf;md5=cf120df6ffa417b36f870a9997650049"

-S = "${WORKDIR}/uxen-vmsupport-linux-${PV}"
+S = "${WORKDIR}/uxen-${PV}-72a4af9/vm-support/linux"

inherit module dos2unix
--
2.32.0


[hardknott][PATCH 03/13] uxen-guest-tools: fix build against kernels 5.15+

Martin Jansa
 

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

Signed-off-by: Martin Jansa <Martin.Jansa@...>
Signed-off-by: Bruce Ashfield <bruce.ashfield@...>
---
...-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@...>
+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@...>
+---
+ 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@...>
+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@...>
+---
+ 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


[honister][PATCH 5/5] xvisor: set PV

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@...>
---
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


[honister][PATCH 4/5] xvisor: uprev to latest master and fix python reference

Martin Jansa
 

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

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@...>
---
...-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@...>
-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@...>
-Reviewed-by: Anup Patel <anup@...>
----
- 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@...>
+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@...>
+---
+ 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


[honister][PATCH 3/5] uxen-guest-tools: fix -DMODULE not working when building uxenhc module

Martin Jansa
 

* undo the unnecessary and incomplete changes from 0001-vm-support-fix-buil=
d-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/uxe=
n-4.1.8-72a4af9/vm-support/linux/uxenhc/uxenhc.o

fix it properly in 0004-uxenhc-fix-DMODULE-not-working-on-module-build-co=
mma.patch

Signed-off-by: Martin Jansa <Martin.Jansa@...>
Signed-off-by: Bruce Ashfield <bruce.ashfield@...>
---
...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-bui=
ld-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 =3D -ENOMEM;
goto out;
-@@ -149,8 +154,11 @@ static void __exit uxen_hypercall_exit(void)
- {
- }
-=20
-+
-+#define KBUILD_MODFILE "uxenhc"
-+
- module_init(uxen_hypercall_init);
- module_exit(uxen_hypercall_exit);
-+MODULE_LICENSE("GPL");
- MODULE_AUTHOR("paulian.marinca@...");
- 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-wo=
rking-on-module-build-comma.patch
@@ -0,0 +1,56 @@
+From 732791cb353289e37448d84503a7d62ca156f29f Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@...>
+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=3Dbfd -fmacro-prefix-map=3D/OE/work/qemux8=
6_64-oe-linux/uxen-guest-tools/4.1.8-r0=3D/usr/src/debug/uxen-guest-tools/4=
.1.8-r0 -fdebug-prefix-map=3D/OE/work/qemux86_64-oe-li=
nux/uxen-guest-tools/4.1.8-r0=3D/usr/src/debug/uxen-guest-tools/4.1.8-r0 =
-fdebug-prefix-map=3D/OE/work/qemux86_64-oe-linux/uxen-g=
uest-tools/4.1.8-r0/recipe-sysroot=3D -fdebug-prefix-m=
ap=3D/OE/work/qemux86_64-oe-linux/uxen-guest-tools/4.1.8-r0/recipe-sysroot-=
native=3D -fdebug-prefix-map=3D/OE/work-shared/qemux86-64/kernel-source=3D=
/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/q=
emux86_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/uxe=
n-4.1.8-72a4af9/vm-support/linux/include/uxen -I/OE/work/qemux86_64-oe-linu=
x/uxen-guest-tools/4.1.8-r0/uxen-4.1.8-72a4af9/vm-support/linux/include/uxe=
n/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-sou=
rce/include/uapi -I./include/generated/uapi -include /OE/work-shared/qemux8=
6-64/kernel-source/include/linux/compiler-version.h -include /OE/work-share=
d/qemux86-64/kernel-source/include/linux/kconfig.h -include /OE/work-shared=
/qemux86-64/kernel-source/include/linux/compiler_types.h -D__KERNEL__ -fmac=
ro-prefix-map=3D/OE/work-shared/qemux86-64/kernel-source/=3D -Wall -Wundef =
-Werror=3Dstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common=
-fshort-wchar -fno-PIE -Werror=3Dimplicit-function-declaration -Werror=3Di=
mplicit-int -Werror=3Dreturn-type -Wno-format-security -std=3Dgnu89 -mno-ss=
e -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -fcf-protection=3Dnone -m64 -falig=
n-jumps=3D1 -falign-loops=3D1 -mno-80387 -mno-fp-ret-in-387 -mpreferred-sta=
ck-boundary=3D3 -mskip-rax-setup -march=3Dcore2 -mno-red-zone -mcmodel=3Dke=
rnel -Wno-sign-compare -fno-asynchronous-unwind-tables -mindirect-branch=3D=
thunk-extern -mindirect-branch-register -fno-jump-tables -fno-delete-null-p=
ointer-checks -Wno-frame-address -Wno-format-truncation -Wno-format-overflo=
w -Wno-address-of-packed-member -O2 -fno-allow-store-data-races -Wframe-lar=
ger-than=3D2048 -fstack-protector-strong -Wimplicit-fallthrough=3D5 -Wno-ma=
in -Wno-unused-but-set-variable -Wno-unused-const-variable -fno-omit-frame-=
pointer -fno-optimize-sibling-calls -fno-stack-clash-protection -pg -mrecor=
d-mcount -mfentry -DCC_USING_FENTRY -Wdeclaration-after-statement -Wvla -Wn=
o-pointer-sign -Wno-stringop-truncation -Wno-zero-length-bounds -Wno-array-=
bounds -Wno-stringop-overflow -Wno-restrict -Wno-maybe-uninitialized -fno-s=
trict-overflow -fno-stack-check -fconserve-stack -Werror=3Ddate-time -Werro=
r=3Dincompatible-pointer-types -Werror=3Ddesignated-init -Wno-packed-not-al=
igned -DLX_TARGET_STANDARDVM -g -Wall -I -DMODULE -DKBUILD_BASENAME=3D'"h=
ypercall"' -DKBUILD_MODNAME=3D'"uxenhc"' -D__KBUILD_MODNAME=3Dkmod_uxenhc -=
c -o /OE/work/qemux86_64-oe-linux/uxen-guest-tools/4.1.8-r0/uxen-4.1.8-72a4=
af9/vm-support/linux/uxenhc/hypercall.o /OE/work/qemux86_64-oe-linux/uxen-g=
uest-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/l=
inux/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 | =3D __MODULE_INFO_PREFIX __stringify(tag) "=3D" =
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-72a4af=
9/vm-support/linux/uxenhc/hypercall.c:161:1: note: in expansion of macro 'M=
ODULE_LICENSE'
+ 161 | MODULE_LICENSE("GPL");
+ | ^~~~~~~~~~~~~~
+
+Signed-off-by: Martin Jansa <Martin.Jansa@...>
+---
+ 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 +=3D uxenhc.o
+=20
+ uxenhc-y :=3D hypercall.o
+-CFLAGS_hypercall.o :=3D -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-exte=
nded/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 =3D " \
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=
\
"
=20
SRC_URI[uxen.sha384sum] =3D "be2233bc6506a23350d76c03ac28ea7ea381e1dc6ed5c=
e996e8ac71e6a3316fcaa2ed070c622618bd226f43a4d6db5d4"
--=20
2.32.0


[honister][PATCH 2/5] uxen-guest-tools: fix build against kernels 5.15+

Martin Jansa
 

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

Signed-off-by: Martin Jansa <Martin.Jansa@...>
Signed-off-by: Bruce Ashfield <bruce.ashfield@...>
---
...-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@...>
+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@...>
+---
+ 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@...>
+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@...>
+---
+ 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


[honister][PATCH 1/5] uxen-guest-tools: fix build against kernels 5.4+

Martin Jansa
 

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

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

Signed-off-by: Bruce Ashfield <bruce.ashfield@...>
---
...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@...>
+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@...>
+---
+ 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@...");
+ 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


[PATCH] qemu-package-split.inc: Correct a typo

Peter Kjellerstedt
 

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@...>
---
recipes-devtools/qemu/qemu-package-split.inc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/recipes-devtools/qemu/qemu-package-split.inc b/recipes-devtools/qemu/qemu-package-split.inc
index f9db331..f1d8932 100644
--- a/recipes-devtools/qemu/qemu-package-split.inc
+++ b/recipes-devtools/qemu/qemu-package-split.inc
@@ -10,7 +10,7 @@ PACKAGES:prepend:class-target = "${PN}-x86_64 \
"

FILES:${PN}-x86_64:class-target = "${bindir}/qemu-system-x86_64 ${bindir}/qemu-x86_64"
-RDEPENDS:${PN}-x86_64:append:class_target = "${PN}"
+RDEPENDS:${PN}-x86_64:append:class-target = "${PN}"
INSANE_SKIP:${PN}-x86_64:class-target = "file-rdeps"

FILES:${PN}-i386:class-target = "${bindir}/qemu-i386"


Re: [PATCHv2 2/2] uxen-guest-tools: fix -DMODULE not working when building uxenhc module

Bruce Ashfield
 

Confirmed. These fix my build as well.

I've merged them to master.

Thanks for the help on these, most appreciated.

Bruce

On Tue, Nov 30, 2021 at 11:47 AM Martin Jansa <Martin.Jansa@...> wrote:

* 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@...>
---
...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@...");
- 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@...>
+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@...>
+---
+ 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



--
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II


Re: [dunfell][gatesgarth][hardknott][master][PATCH] uxen-guest-tools: inherit dos2unix to fix do_patch failure

Martin Jansa
 

I've found the cause of MODULE_LICENSE issue and sent updated PATCHv2, see:

Christopher can you please try to upstream these changes for newer kernels? Me and Bruce both failed to find up2date upstream repo, but you mentioned before that you have reported the issue in some upstream bugtracker (where you can possibly propose these changes).

I never used uxen-guest-tools, I was fixing it just to resolve build failures in world builds, so I haven't tested it in runtime at all.

Regards,

On Tue, Nov 30, 2021 at 4:36 PM Martin Jansa via lists.yoctoproject.org <Martin.Jansa=gmail.com@...> wrote:

On Thu, Jul 29, 2021 at 7:53 PM Christopher Clark <christopher.w.clark@...> wrote:
On Fri, Jul 23, 2021 at 9:55 AM Bruce Ashfield <bruce.ashfield@...> wrote:
>
> On Fri, Jul 23, 2021 at 9:29 AM Martin Jansa <Martin.Jansa@...> wrote:
> >
> > it builds ok with 5.4 in dunfell now, only gatesgarth with 5.8 and newer with 5.10 kernel are broken
> >
>
> I've applied your patch, and have pushed it to the repo.
>
> I'm also seeing the build failure now.
>
> I tried to bump the version of the package, but it still has the same
> kernel build issue. (my efforts are here:
> https://git.yoctoproject.org/cgit/cgit.cgi/meta-virtualization/commit/?h=master-test&id=3ae2e9b3036890968cb9b152d128db9b47f01c89)
>
> Christoper: did you want to take a look at the uprev / fix of the build ?

A quick update on this: I did take a look and repro'd the build
failure with the current Linux 5.10 kernel.
I've filed a ticket on the upstream project issue tracker with some
details and am waiting on a response.

Christopher

>
> Bruce
>
>
> > On Fri, Jul 23, 2021 at 2:54 PM Martin Jansa via lists.yoctoproject.org <Martin.Jansa=gmail.com@...> wrote:
> >>
> >> Now with do_patch fixed it fails a bit later in do_compile with:
> >>
> >> | make[1]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
> >> | make[1]: Entering directory '/OE/build/oe-core/tmp-glibc/work-shared/qemux86-64/kernel-source'
> >> | make[2]: Entering directory '/OE/build/oe-core/tmp-glibc/work-shared/qemux86-64/kernel-build-artifacts'
> >> |   CC [M]  /OE/build/oe-core/tmp-glibc/work/qemux86_64-oe-linux/uxen-guest-tools/4.1.7-r0/uxen-vmsupport-linux-4.1.7/uxenhc/hypercall.o
> >> | /OE/build/oe-core/tmp-glibc/work/qemux86_64-oe-linux/uxen-guest-tools/4.1.7-r0/uxen-vmsupport-linux-4.1.7/uxenhc/hypercall.c: In function 'uxen_hypercall_init':
> >> | /OE/build/oe-core/tmp-glibc/work/qemux86_64-oe-linux/uxen-guest-tools/4.1.7-r0/uxen-vmsupport-linux-4.1.7/uxenhc/hypercall.c:127:24: error: too many arguments to function '__vmalloc'
> >> |   127 |         uxen_hcbase =  __vmalloc(PAGE_SIZE, GFP_KERNEL, PAGE_KERNEL_EXEC);
> >> |       |                        ^~~~~~~~~
> >> | In file included from /OE/build/oe-core/tmp-glibc/work/qemux86_64-oe-linux/uxen-guest-tools/4.1.7-r0/uxen-vmsupport-linux-4.1.7/uxenhc/hypercall.c:9:
> >> | /OE/build/oe-core/tmp-glibc/work-shared/qemux86-64/kernel-source/include/linux/vmalloc.h:131:14: note: declared here
> >> |   131 | extern void *__vmalloc(unsigned long size, gfp_t gfp_mask);
> >> |       |              ^~~~~~~~~
> >> | In file included from /OE/build/oe-core/tmp-glibc/work-shared/qemux86-64/kernel-source/include/linux/module.h:21,
> >> |                  from /OE/build/oe-core/tmp-glibc/work/qemux86_64-oe-linux/uxen-guest-tools/4.1.7-r0/uxen-vmsupport-linux-4.1.7/uxenhc/hypercall.c:3:
> >> | /OE/build/oe-core/tmp-glibc/work/qemux86_64-oe-linux/uxen-guest-tools/4.1.7-r0/uxen-vmsupport-linux-4.1.7/uxenhc/hypercall.c: At top level:
> >> | /OE/build/oe-core/tmp-glibc/work-shared/qemux86-64/kernel-source/include/linux/module.h:182:43: error: expected ',' or ';' before 'KBUILD_MODFILE'
> >> |   182 | #define MODULE_FILE     MODULE_INFO(file, KBUILD_MODFILE);
> >> |       |                                           ^~~~~~~~~~~~~~
> >> | /OE/build/oe-core/tmp-glibc/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/build/oe-core/tmp-glibc/work-shared/qemux86-64/kernel-source/include/linux/module.h:182:25: note: in expansion of macro 'MODULE_INFO'
> >> |   182 | #define MODULE_FILE     MODULE_INFO(file, KBUILD_MODFILE);
> >> |       |                         ^~~~~~~~~~~
> >> | /OE/build/oe-core/tmp-glibc/work-shared/qemux86-64/kernel-source/include/linux/module.h:229:34: note: in expansion of macro 'MODULE_FILE'
> >> |   229 | #define MODULE_LICENSE(_license) MODULE_FILE MODULE_INFO(license, _license)
> >> |       |                                  ^~~~~~~~~~~
> >> | /OE/build/oe-core/tmp-glibc/work/qemux86_64-oe-linux/uxen-guest-tools/4.1.7-r0/uxen-vmsupport-linux-4.1.7/uxenhc/hypercall.c:156:1: note: in expansion of macro 'MODULE_LICENSE'
> >> |   156 | MODULE_LICENSE("GPL");
> >> |       | ^~~~~~~~~~~~~~
> >>
> >> at least with oe-core/master, will check with older kernel in dunfell next.
> >>
> >> On Fri, Jul 23, 2021 at 2:46 PM Martin Jansa via lists.yoctoproject.org <Martin.Jansa=gmail.com@...> wrote:
> >>>
> >>> * fixes:
> >>>   ERROR: uxen-guest-tools-4.1.7-r0 do_patch: Command Error: 'quilt --quiltrc /OE/build/oe-core/tmp-glibc/work/qemux86_64-oe-linux/uxen-guest-tools/4.1.7-r0/recipe-sysroot-native/etc/quiltrc push' exited with 0  Output:
> >>>   stdout: Applying patch fix-Makefile-for-OE-kernel-build.patch
> >>>   patching file Makefile
> >>>   Hunk #1 FAILED at 1 (different line endings).
> >>>   Hunk #2 FAILED at 19 (different line endings).
> >>>   2 out of 2 hunks FAILED -- rejects in file Makefile
> >>>   Patch fix-Makefile-for-OE-kernel-build.patch does not apply (enforce with -f)
> >>>
> >>> Signed-off-by: Martin Jansa <Martin.Jansa@...>
> >>> ---
> >>>  recipes-extended/uxen/uxen-guest-tools_4.1.7.bb | 2 +-
> >>>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>>
> >>> diff --git a/recipes-extended/uxen/uxen-guest-tools_4.1.7.bb b/recipes-extended/uxen/uxen-guest-tools_4.1.7.bb
> >>> index 757f1e3..4dcfe51 100644
> >>> --- a/recipes-extended/uxen/uxen-guest-tools_4.1.7.bb
> >>> +++ b/recipes-extended/uxen/uxen-guest-tools_4.1.7.bb
> >>> @@ -19,4 +19,4 @@ LIC_FILES_CHKSUM = "file://../Bromium-4.1.8-Open-Source-Software.pdf;md5=cf120df
> >>>
> >>>  S = "${WORKDIR}/uxen-vmsupport-linux-${PV}"
> >>>
> >>> -inherit module
> >>> +inherit module dos2unix
> >>> --
> >>> 2.30.2
> >>>
> >>>
> >>>
> >>>
> >>
> >>
> >>
> >
> >
> >
>
>
> --
> - Thou shalt not follow the NULL pointer, for chaos and madness await
> thee at its end
> - "Use the force Harry" - Gandalf, Star Trek II




[PATCHv2 2/2] uxen-guest-tools: fix -DMODULE not working when building uxenhc module

Martin Jansa
 

* undo the unnecessary and incomplete changes from 0001-vm-support-fix-buil=
d-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/uxe=
n-4.1.8-72a4af9/vm-support/linux/uxenhc/uxenhc.o

fix it properly in 0004-uxenhc-fix-DMODULE-not-working-on-module-build-co=
mma.patch

Signed-off-by: Martin Jansa <Martin.Jansa@...>
---
...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-bui=
ld-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 =3D -ENOMEM;
goto out;
-@@ -149,8 +154,11 @@ static void __exit uxen_hypercall_exit(void)
- {
- }
-=20
-+
-+#define KBUILD_MODFILE "uxenhc"
-+
- module_init(uxen_hypercall_init);
- module_exit(uxen_hypercall_exit);
-+MODULE_LICENSE("GPL");
- MODULE_AUTHOR("paulian.marinca@...");
- 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-wo=
rking-on-module-build-comma.patch
@@ -0,0 +1,56 @@
+From 732791cb353289e37448d84503a7d62ca156f29f Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@...>
+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=3Dbfd -fmacro-prefix-map=3D/OE/work/qemux8=
6_64-oe-linux/uxen-guest-tools/4.1.8-r0=3D/usr/src/debug/uxen-guest-tools/4=
.1.8-r0 -fdebug-prefix-map=3D/OE/work/qemux86_64-oe-li=
nux/uxen-guest-tools/4.1.8-r0=3D/usr/src/debug/uxen-guest-tools/4.1.8-r0 =
-fdebug-prefix-map=3D/OE/work/qemux86_64-oe-linux/uxen-g=
uest-tools/4.1.8-r0/recipe-sysroot=3D -fdebug-prefix-m=
ap=3D/OE/work/qemux86_64-oe-linux/uxen-guest-tools/4.1.8-r0/recipe-sysroot-=
native=3D -fdebug-prefix-map=3D/OE/work-shared/qemux86-64/kernel-source=3D=
/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/q=
emux86_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/uxe=
n-4.1.8-72a4af9/vm-support/linux/include/uxen -I/OE/work/qemux86_64-oe-linu=
x/uxen-guest-tools/4.1.8-r0/uxen-4.1.8-72a4af9/vm-support/linux/include/uxe=
n/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-sou=
rce/include/uapi -I./include/generated/uapi -include /OE/work-shared/qemux8=
6-64/kernel-source/include/linux/compiler-version.h -include /OE/work-share=
d/qemux86-64/kernel-source/include/linux/kconfig.h -include /OE/work-shared=
/qemux86-64/kernel-source/include/linux/compiler_types.h -D__KERNEL__ -fmac=
ro-prefix-map=3D/OE/work-shared/qemux86-64/kernel-source/=3D -Wall -Wundef =
-Werror=3Dstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common=
-fshort-wchar -fno-PIE -Werror=3Dimplicit-function-declaration -Werror=3Di=
mplicit-int -Werror=3Dreturn-type -Wno-format-security -std=3Dgnu89 -mno-ss=
e -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -fcf-protection=3Dnone -m64 -falig=
n-jumps=3D1 -falign-loops=3D1 -mno-80387 -mno-fp-ret-in-387 -mpreferred-sta=
ck-boundary=3D3 -mskip-rax-setup -march=3Dcore2 -mno-red-zone -mcmodel=3Dke=
rnel -Wno-sign-compare -fno-asynchronous-unwind-tables -mindirect-branch=3D=
thunk-extern -mindirect-branch-register -fno-jump-tables -fno-delete-null-p=
ointer-checks -Wno-frame-address -Wno-format-truncation -Wno-format-overflo=
w -Wno-address-of-packed-member -O2 -fno-allow-store-data-races -Wframe-lar=
ger-than=3D2048 -fstack-protector-strong -Wimplicit-fallthrough=3D5 -Wno-ma=
in -Wno-unused-but-set-variable -Wno-unused-const-variable -fno-omit-frame-=
pointer -fno-optimize-sibling-calls -fno-stack-clash-protection -pg -mrecor=
d-mcount -mfentry -DCC_USING_FENTRY -Wdeclaration-after-statement -Wvla -Wn=
o-pointer-sign -Wno-stringop-truncation -Wno-zero-length-bounds -Wno-array-=
bounds -Wno-stringop-overflow -Wno-restrict -Wno-maybe-uninitialized -fno-s=
trict-overflow -fno-stack-check -fconserve-stack -Werror=3Ddate-time -Werro=
r=3Dincompatible-pointer-types -Werror=3Ddesignated-init -Wno-packed-not-al=
igned -DLX_TARGET_STANDARDVM -g -Wall -I -DMODULE -DKBUILD_BASENAME=3D'"h=
ypercall"' -DKBUILD_MODNAME=3D'"uxenhc"' -D__KBUILD_MODNAME=3Dkmod_uxenhc -=
c -o /OE/work/qemux86_64-oe-linux/uxen-guest-tools/4.1.8-r0/uxen-4.1.8-72a4=
af9/vm-support/linux/uxenhc/hypercall.o /OE/work/qemux86_64-oe-linux/uxen-g=
uest-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/l=
inux/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 | =3D __MODULE_INFO_PREFIX __stringify(tag) "=3D" =
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-72a4af=
9/vm-support/linux/uxenhc/hypercall.c:161:1: note: in expansion of macro 'M=
ODULE_LICENSE'
+ 161 | MODULE_LICENSE("GPL");
+ | ^~~~~~~~~~~~~~
+
+Signed-off-by: Martin Jansa <Martin.Jansa@...>
+---
+ 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 +=3D uxenhc.o
+=20
+ uxenhc-y :=3D hypercall.o
+-CFLAGS_hypercall.o :=3D -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-exte=
nded/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 =3D " \
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=
\
"
=20
SRC_URI[uxen.sha384sum] =3D "be2233bc6506a23350d76c03ac28ea7ea381e1dc6ed5c=
e996e8ac71e6a3316fcaa2ed070c622618bd226f43a4d6db5d4"
--=20
2.32.0


[PATCHv2 1/2] uxen-guest-tools: fix build against kernels 5.15+

Martin Jansa
 

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

Signed-off-by: Martin Jansa <Martin.Jansa@...>
---
...-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@...>
+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@...>
+---
+ 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@...>
+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@...>
+---
+ 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


Re: [dunfell][gatesgarth][hardknott][master][PATCH] uxen-guest-tools: inherit dos2unix to fix do_patch failure

Martin Jansa
 

On Thu, Jul 29, 2021 at 7:53 PM Christopher Clark <christopher.w.clark@...> wrote:
On Fri, Jul 23, 2021 at 9:55 AM Bruce Ashfield <bruce.ashfield@...> wrote:
>
> On Fri, Jul 23, 2021 at 9:29 AM Martin Jansa <Martin.Jansa@...> wrote:
> >
> > it builds ok with 5.4 in dunfell now, only gatesgarth with 5.8 and newer with 5.10 kernel are broken
> >
>
> I've applied your patch, and have pushed it to the repo.
>
> I'm also seeing the build failure now.
>
> I tried to bump the version of the package, but it still has the same
> kernel build issue. (my efforts are here:
> https://git.yoctoproject.org/cgit/cgit.cgi/meta-virtualization/commit/?h=master-test&id=3ae2e9b3036890968cb9b152d128db9b47f01c89)
>
> Christoper: did you want to take a look at the uprev / fix of the build ?

A quick update on this: I did take a look and repro'd the build
failure with the current Linux 5.10 kernel.
I've filed a ticket on the upstream project issue tracker with some
details and am waiting on a response.

Christopher

>
> Bruce
>
>
> > On Fri, Jul 23, 2021 at 2:54 PM Martin Jansa via lists.yoctoproject.org <Martin.Jansa=gmail.com@...> wrote:
> >>
> >> Now with do_patch fixed it fails a bit later in do_compile with:
> >>
> >> | make[1]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
> >> | make[1]: Entering directory '/OE/build/oe-core/tmp-glibc/work-shared/qemux86-64/kernel-source'
> >> | make[2]: Entering directory '/OE/build/oe-core/tmp-glibc/work-shared/qemux86-64/kernel-build-artifacts'
> >> |   CC [M]  /OE/build/oe-core/tmp-glibc/work/qemux86_64-oe-linux/uxen-guest-tools/4.1.7-r0/uxen-vmsupport-linux-4.1.7/uxenhc/hypercall.o
> >> | /OE/build/oe-core/tmp-glibc/work/qemux86_64-oe-linux/uxen-guest-tools/4.1.7-r0/uxen-vmsupport-linux-4.1.7/uxenhc/hypercall.c: In function 'uxen_hypercall_init':
> >> | /OE/build/oe-core/tmp-glibc/work/qemux86_64-oe-linux/uxen-guest-tools/4.1.7-r0/uxen-vmsupport-linux-4.1.7/uxenhc/hypercall.c:127:24: error: too many arguments to function '__vmalloc'
> >> |   127 |         uxen_hcbase =  __vmalloc(PAGE_SIZE, GFP_KERNEL, PAGE_KERNEL_EXEC);
> >> |       |                        ^~~~~~~~~
> >> | In file included from /OE/build/oe-core/tmp-glibc/work/qemux86_64-oe-linux/uxen-guest-tools/4.1.7-r0/uxen-vmsupport-linux-4.1.7/uxenhc/hypercall.c:9:
> >> | /OE/build/oe-core/tmp-glibc/work-shared/qemux86-64/kernel-source/include/linux/vmalloc.h:131:14: note: declared here
> >> |   131 | extern void *__vmalloc(unsigned long size, gfp_t gfp_mask);
> >> |       |              ^~~~~~~~~
> >> | In file included from /OE/build/oe-core/tmp-glibc/work-shared/qemux86-64/kernel-source/include/linux/module.h:21,
> >> |                  from /OE/build/oe-core/tmp-glibc/work/qemux86_64-oe-linux/uxen-guest-tools/4.1.7-r0/uxen-vmsupport-linux-4.1.7/uxenhc/hypercall.c:3:
> >> | /OE/build/oe-core/tmp-glibc/work/qemux86_64-oe-linux/uxen-guest-tools/4.1.7-r0/uxen-vmsupport-linux-4.1.7/uxenhc/hypercall.c: At top level:
> >> | /OE/build/oe-core/tmp-glibc/work-shared/qemux86-64/kernel-source/include/linux/module.h:182:43: error: expected ',' or ';' before 'KBUILD_MODFILE'
> >> |   182 | #define MODULE_FILE     MODULE_INFO(file, KBUILD_MODFILE);
> >> |       |                                           ^~~~~~~~~~~~~~
> >> | /OE/build/oe-core/tmp-glibc/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/build/oe-core/tmp-glibc/work-shared/qemux86-64/kernel-source/include/linux/module.h:182:25: note: in expansion of macro 'MODULE_INFO'
> >> |   182 | #define MODULE_FILE     MODULE_INFO(file, KBUILD_MODFILE);
> >> |       |                         ^~~~~~~~~~~
> >> | /OE/build/oe-core/tmp-glibc/work-shared/qemux86-64/kernel-source/include/linux/module.h:229:34: note: in expansion of macro 'MODULE_FILE'
> >> |   229 | #define MODULE_LICENSE(_license) MODULE_FILE MODULE_INFO(license, _license)
> >> |       |                                  ^~~~~~~~~~~
> >> | /OE/build/oe-core/tmp-glibc/work/qemux86_64-oe-linux/uxen-guest-tools/4.1.7-r0/uxen-vmsupport-linux-4.1.7/uxenhc/hypercall.c:156:1: note: in expansion of macro 'MODULE_LICENSE'
> >> |   156 | MODULE_LICENSE("GPL");
> >> |       | ^~~~~~~~~~~~~~
> >>
> >> at least with oe-core/master, will check with older kernel in dunfell next.
> >>
> >> On Fri, Jul 23, 2021 at 2:46 PM Martin Jansa via lists.yoctoproject.org <Martin.Jansa=gmail.com@...> wrote:
> >>>
> >>> * fixes:
> >>>   ERROR: uxen-guest-tools-4.1.7-r0 do_patch: Command Error: 'quilt --quiltrc /OE/build/oe-core/tmp-glibc/work/qemux86_64-oe-linux/uxen-guest-tools/4.1.7-r0/recipe-sysroot-native/etc/quiltrc push' exited with 0  Output:
> >>>   stdout: Applying patch fix-Makefile-for-OE-kernel-build.patch
> >>>   patching file Makefile
> >>>   Hunk #1 FAILED at 1 (different line endings).
> >>>   Hunk #2 FAILED at 19 (different line endings).
> >>>   2 out of 2 hunks FAILED -- rejects in file Makefile
> >>>   Patch fix-Makefile-for-OE-kernel-build.patch does not apply (enforce with -f)
> >>>
> >>> Signed-off-by: Martin Jansa <Martin.Jansa@...>
> >>> ---
> >>>  recipes-extended/uxen/uxen-guest-tools_4.1.7.bb | 2 +-
> >>>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>>
> >>> diff --git a/recipes-extended/uxen/uxen-guest-tools_4.1.7.bb b/recipes-extended/uxen/uxen-guest-tools_4.1.7.bb
> >>> index 757f1e3..4dcfe51 100644
> >>> --- a/recipes-extended/uxen/uxen-guest-tools_4.1.7.bb
> >>> +++ b/recipes-extended/uxen/uxen-guest-tools_4.1.7.bb
> >>> @@ -19,4 +19,4 @@ LIC_FILES_CHKSUM = "file://../Bromium-4.1.8-Open-Source-Software.pdf;md5=cf120df
> >>>
> >>>  S = "${WORKDIR}/uxen-vmsupport-linux-${PV}"
> >>>
> >>> -inherit module
> >>> +inherit module dos2unix
> >>> --
> >>> 2.30.2
> >>>
> >>>
> >>>
> >>>
> >>
> >>
> >>
> >
> >
> >
>
>
> --
> - Thou shalt not follow the NULL pointer, for chaos and madness await
> thee at its end
> - "Use the force Harry" - Gandalf, Star Trek II


[PATCH] uxen-guest-tools: fix build against kernels 5.15+

Martin Jansa
 

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 <Martin.Jansa@...>
---
...-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

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..a8089f6
--- /dev/null
+++ b/recipes-extended/uxen/uxen-guest-tools/0002-vm-support-fix-build-for-kernel-s-5.15.patch
@@ -0,0 +1,47 @@
+From cc31e9648b76bfaa2f04825b5ef8c09fe79782f7 Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@...>
+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@...>
+---
+ 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;
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@...>
+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@...>
+---
+ 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


Re: [PATCH] singularity: fix build with automake-1.16.5

Bruce Ashfield
 

Looks good to me, fix confirmed on my builder.

Merged.

Bruce

On Tue, Nov 30, 2021 at 9:09 AM Martin Jansa <Martin.Jansa@...> wrote:

Signed-off-by: Martin Jansa <Martin.Jansa@...>
---
...nfigure.ac-drop-2nd-AM_INIT_AUTOMAKE.patch | 34 +++++++++++++++++++
.../singularity/singularity_git.bb | 1 +
2 files changed, 35 insertions(+)
create mode 100644 recipes-containers/singularity/singularity/0001-configure.ac-drop-2nd-AM_INIT_AUTOMAKE.patch

diff --git a/recipes-containers/singularity/singularity/0001-configure.ac-drop-2nd-AM_INIT_AUTOMAKE.patch b/recipes-containers/singularity/singularity/0001-configure.ac-drop-2nd-AM_INIT_AUTOMAKE.patch
new file mode 100644
index 0000000..d5744a2
--- /dev/null
+++ b/recipes-containers/singularity/singularity/0001-configure.ac-drop-2nd-AM_INIT_AUTOMAKE.patch
@@ -0,0 +1,34 @@
+From 13ee3e016490e74868b64e3a07dcccf9feafebdf Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@...>
+Date: Tue, 30 Nov 2021 05:59:06 -0800
+Subject: [PATCH] configure.ac: drop 2nd AM_INIT_AUTOMAKE
+
+* automake-1.16.5 introduced in oe-core:
+ https://git.openembedded.org/openembedded-core/commit/?id=851167b3a41b1728407d331c1666827fb730daa1
+ doesn't like this after:
+ http://git.savannah.gnu.org/cgit/automake.git/commit/?id=f4a3a70f69e1dbccb6578f39ef47835098a04624
+
+ and do_configure fails with:
+ configure.ac:38: error: AM_INIT_AUTOMAKE expanded multiple times
+
+ There is no point in upstreaming this, because singularity-2.3.1 is very old and
+ whole autotools support is removed in version 3 (currently 3.8.5) with:
+ https://github.com/hpcng/singularity/commit/a06e3d13a822080d7a9bc55085ee1bb32026a96e
+
+Signed-off-by: Martin Jansa <Martin.Jansa@...>
+---
+ configure.ac | 7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 8ffa5ab32..a5a35c43a 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -35,7 +35,6 @@ AC_GNU_SOURCE
+ AC_PROG_INSTALL
+ AC_PROG_LIBTOOL
+ AC_PROG_CC
+-AM_INIT_AUTOMAKE
+ AM_PROG_CC_C_O
+ AC_ENABLE_SHARED
+ AC_PROG_LIBTOOL(libtool)
diff --git a/recipes-containers/singularity/singularity_git.bb b/recipes-containers/singularity/singularity_git.bb
index f729657..321a9a6 100644
--- a/recipes-containers/singularity/singularity_git.bb
+++ b/recipes-containers/singularity/singularity_git.bb
@@ -12,6 +12,7 @@ LIC_FILES_CHKSUM = "file://COPYRIGHT.md;md5=be78c34e483dd7d8439358b1e024b294 \

SRC_URI = "git://github.com/singularityware/singularity.git;protocol=https;branch=master \
file://0001-Use-python3.patch \
+ file://0001-configure.ac-drop-2nd-AM_INIT_AUTOMAKE.patch \
"
PV = "2.3.1+git${SRCPV}"
SRCREV = "e214d4ebf0a1274b1c63b095fd55ae61c7e92947"
--
2.32.0



--
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II


Re: [PATCH] xvisor: set PV

Bruce Ashfield
 

On Tue, Nov 30, 2021 at 9:21 AM Martin Jansa <Martin.Jansa@...> wrote:

* 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
I had noticed this as well (I struggled on the commit message so just
went for 'tip') and had meant to circle back to it.

Thanks for the patch, it is now merged.

Bruce


Signed-off-by: Martin Jansa <Martin.Jansa@...>
---
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




--
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II


[PATCH] xvisor: set PV

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@...>
---
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


[PATCH] singularity: fix build with automake-1.16.5

Martin Jansa
 

Signed-off-by: Martin Jansa <Martin.Jansa@...>
---
...nfigure.ac-drop-2nd-AM_INIT_AUTOMAKE.patch | 34 +++++++++++++++++++
.../singularity/singularity_git.bb | 1 +
2 files changed, 35 insertions(+)
create mode 100644 recipes-containers/singularity/singularity/0001-configure.ac-drop-2nd-AM_INIT_AUTOMAKE.patch

diff --git a/recipes-containers/singularity/singularity/0001-configure.ac-drop-2nd-AM_INIT_AUTOMAKE.patch b/recipes-containers/singularity/singularity/0001-configure.ac-drop-2nd-AM_INIT_AUTOMAKE.patch
new file mode 100644
index 0000000..d5744a2
--- /dev/null
+++ b/recipes-containers/singularity/singularity/0001-configure.ac-drop-2nd-AM_INIT_AUTOMAKE.patch
@@ -0,0 +1,34 @@
+From 13ee3e016490e74868b64e3a07dcccf9feafebdf Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@...>
+Date: Tue, 30 Nov 2021 05:59:06 -0800
+Subject: [PATCH] configure.ac: drop 2nd AM_INIT_AUTOMAKE
+
+* automake-1.16.5 introduced in oe-core:
+ https://git.openembedded.org/openembedded-core/commit/?id=851167b3a41b1728407d331c1666827fb730daa1
+ doesn't like this after:
+ http://git.savannah.gnu.org/cgit/automake.git/commit/?id=f4a3a70f69e1dbccb6578f39ef47835098a04624
+
+ and do_configure fails with:
+ configure.ac:38: error: AM_INIT_AUTOMAKE expanded multiple times
+
+ There is no point in upstreaming this, because singularity-2.3.1 is very old and
+ whole autotools support is removed in version 3 (currently 3.8.5) with:
+ https://github.com/hpcng/singularity/commit/a06e3d13a822080d7a9bc55085ee1bb32026a96e
+
+Signed-off-by: Martin Jansa <Martin.Jansa@...>
+---
+ configure.ac | 7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 8ffa5ab32..a5a35c43a 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -35,7 +35,6 @@ AC_GNU_SOURCE
+ AC_PROG_INSTALL
+ AC_PROG_LIBTOOL
+ AC_PROG_CC
+-AM_INIT_AUTOMAKE
+ AM_PROG_CC_C_O
+ AC_ENABLE_SHARED
+ AC_PROG_LIBTOOL(libtool)
diff --git a/recipes-containers/singularity/singularity_git.bb b/recipes-containers/singularity/singularity_git.bb
index f729657..321a9a6 100644
--- a/recipes-containers/singularity/singularity_git.bb
+++ b/recipes-containers/singularity/singularity_git.bb
@@ -12,6 +12,7 @@ LIC_FILES_CHKSUM = "file://COPYRIGHT.md;md5=be78c34e483dd7d8439358b1e024b294 \

SRC_URI = "git://github.com/singularityware/singularity.git;protocol=https;branch=master \
file://0001-Use-python3.patch \
+ file://0001-configure.ac-drop-2nd-AM_INIT_AUTOMAKE.patch \
"
PV = "2.3.1+git${SRCPV}"
SRCREV = "e214d4ebf0a1274b1c63b095fd55ae61c7e92947"
--
2.32.0


Re: [meta-cloud-services][PATCH 1/3] openstack-image-compute: fix warning of operator append combined with +=

Bruce Ashfield
 

merged.

Bruce

In message: [meta-virtualization] [meta-cloud-services][PATCH 1/3] openstack-image-compute: fix warning of operator append combined with +=
on 20/11/2021 Yi Zhao wrote:

Fixes:
WARNING: openstack-image-compute.bb: IMAGE_ROOTFS_EXTRA_SPACE:append +=
is not a recommended operator combination, please replace it.

Signed-off-by: Yi Zhao <yi.zhao@...>
---
.../recipes-extended/images/openstack-image-compute.bb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta-openstack/recipes-extended/images/openstack-image-compute.bb b/meta-openstack/recipes-extended/images/openstack-image-compute.bb
index 15726fd..a725e2e 100644
--- a/meta-openstack/recipes-extended/images/openstack-image-compute.bb
+++ b/meta-openstack/recipes-extended/images/openstack-image-compute.bb
@@ -19,6 +19,6 @@ inherit monitor

# Ensure extra space for guest images, and rabbit MQ has a hard coded
# check for 2G of free space, so we use 3G as a starting point.
-IMAGE_ROOTFS_EXTRA_SPACE:append += "+ 3000000"
+IMAGE_ROOTFS_EXTRA_SPACE:append = " + 3000000"

# ROOTFS_POSTPROCESS_COMMAND += "remove_packaging_data_files ; "
--
2.25.1



Re: [m-c-s][PATCH] concurrent-ruby: 1.1.6 -> 1.1.9

Bruce Ashfield
 

merged.

Bruce

In message: [meta-virtualization][m-c-s][PATCH] concurrent-ruby: 1.1.6 -> 1.1.9
on 22/11/2021 kai wrote:

From: Kai Kang <kai.kang@...>

Upgrade concurrent-ruby from 1.1.6 to 1.1.9:

* it changed license file to txt, so the license file name and checksum changed
* remove 'tag=' from SRC_URI and use SRCREV instead

Signed-off-by: Kai Kang <kai.kang@...>
---
...urrent-ruby_1.1.6.bb => concurrent-ruby_1.1.9.bb} | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
rename meta-openstack/recipes-devtools/ruby/{concurrent-ruby_1.1.6.bb => concurrent-ruby_1.1.9.bb} (50%)

diff --git a/meta-openstack/recipes-devtools/ruby/concurrent-ruby_1.1.6.bb b/meta-openstack/recipes-devtools/ruby/concurrent-ruby_1.1.9.bb
similarity index 50%
rename from meta-openstack/recipes-devtools/ruby/concurrent-ruby_1.1.6.bb
rename to meta-openstack/recipes-devtools/ruby/concurrent-ruby_1.1.9.bb
index a328203e..e2c99d7d 100644
--- a/meta-openstack/recipes-devtools/ruby/concurrent-ruby_1.1.6.bb
+++ b/meta-openstack/recipes-devtools/ruby/concurrent-ruby_1.1.9.bb
@@ -2,11 +2,17 @@ SUMMARY = "Modern concurrency tools including agents, futures, promises, thread
HOMEPAGE = "http://www.concurrent-ruby.com"

LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://LICENSE.md;md5=fde65ae93d18826f70c6fe125aa04297"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=e319104fe1435b64fc0a67032db44f02"

-SRC_URI = "git://github.com/ruby-concurrency/concurrent-ruby.git;protocol=https;tag=v1.1.6\
- file://0001-Removed-check-for-concurrent_ruby.jar.patch"
+SRC_URI = "git://github.com/ruby-concurrency/concurrent-ruby.git;protocol=https;branch=master \
+ file://0001-Removed-check-for-concurrent_ruby.jar.patch \
+ "
+SRCREV = "52c08fca13cc3811673ea2f6fdb244a0e42e0ebe"

S = "${WORKDIR}/git"

+do_install:append () {
+ rmdir --ignore-fail-on-non-empty ${D}${libdir}/ruby/gems/${RUBY_GEM_VERSION}/plugins
+}
+
inherit ruby
--
2.17.1


461 - 480 of 7394