Date   

Re: [PATCH 1/3] xen-tools: Load xen related kernel modules during system boot

Christopher Clark
 

On Wed, Dec 8, 2021 at 6:35 PM Khem Raj <raj.khem@...> wrote:

On Wed, Dec 8, 2021 at 6:24 PM Christopher Clark <christopher.w.clark@...> wrote:
On Wed, Dec 8, 2021 at 5:10 AM Bertrand Marquis <bertrand.marquis@...> wrote:
Hi Kamil,

> On 8 Dec 2021, at 10:44, Kamil Dziezyk via lists.yoctoproject.org <kamil.dziezyk=arm.com@...> wrote:
>
> This patch changes the location of xen.conf file, that contains list of kernel
> modules to be loaded during system boot, to "${nonarch_libdir}". This is done
> by removing '--with-systemd-modules-load=' flag from EXTRA_OECONF variable.
>
> Previous path based on "${systemd_unitdir}" was not considered by default by
> systemd-modules-load.service.

ok, it does look like there's a fix that should be made here, thanks. It took a bit of following to see what's involved, so:

There are two recipes in meta-openembedded that do use ${nonarch_libdir} for this, but the systemd package itself doesn't: the recipe has ${exec_prefix}/lib/modules-load.d instead, and there's a systemd patch that applies ${exec_prefix}/lib/modules-load.d too; but then in oe-core, bitbake.conf defines: nonarch_libdir = "${exec_prefix}/lib"
so the end result should work in the default configuration.

Khem: should the OE Core systemd recipe and patch be using ${nonarch_libdir} too? Or should the recipes that package modules.d config files place them via ${exec_prefix}/lib ?

I think nonarch_libdir is right option here 

Thanks, Khem.

Kamil: Is there any reason that you chose to drop specifying the install directory via the flags passed to EXTRA_OECONF?
ie. An alternative would be: rather than remove the "--with-systemd-modules-load" flag, you could update it to use the correct location:
    ${nonarch_libdir}/modules-load.d
so that if exec_prefix or nonarch_libdir are ever overridden to a non-default value, the config file will still be placed correctly.

Christopher


 

thanks

Christopher

 
>
> Signed-off-by: Kamil Dziezyk <kamil.dziezyk@...>
Reviewed-by: Bertrand Marquis <bertrand.marquis@...>

Cheers
Bertrand

> ---
> recipes-extended/xen/xen-tools.inc | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/recipes-extended/xen/xen-tools.inc b/recipes-extended/xen/xen-tools.inc
> index d831941..6b99040 100644
> --- a/recipes-extended/xen/xen-tools.inc
> +++ b/recipes-extended/xen/xen-tools.inc
> @@ -653,10 +653,10 @@ FILES:${PN}-xm = "\
>     "
>
> FILES:${PN}-xencommons += "\
> +    ${nonarch_libdir}/modules-load.d/xen.conf \
>     ${sysconfdir}/default/xencommons \
>     ${sysconfdir}/init.d/xencommons \
>     ${sysconfdir}/xen/scripts/launch-xenstore \
> -    ${systemd_unitdir}/modules-load.d/xen.conf \
>     ${systemd_unitdir}/system/proc-xen.mount \
>     ${systemd_unitdir}/system/xen-qemu-dom0-disk-backend.service \
>     ${systemd_unitdir}/system/xenconsoled.service \
> @@ -744,7 +744,6 @@ SYSTEMD_SERVICE:${PN}-xendomains = "xendomains.service"
>
> EXTRA_OECONF += " \
>     --with-systemd=${systemd_unitdir}/system \
> -    --with-systemd-modules-load=${systemd_unitdir}/modules-load.d \
>     --with-initddir=${INIT_D_DIR} \
>     --with-sysconfig-leaf-dir=default \
>     --with-system-qemu=${bindir}/qemu-system-i386 \
> --
> 2.17.1
>
>
>
>





Re: [PATCH 1/3] xen-tools: Load xen related kernel modules during system boot

Christopher Clark
 

On Wed, Dec 8, 2021 at 5:10 AM Bertrand Marquis <bertrand.marquis@...> wrote:
Hi Kamil,

> On 8 Dec 2021, at 10:44, Kamil Dziezyk via lists.yoctoproject.org <kamil.dziezyk=arm.com@...> wrote:
>
> This patch changes the location of xen.conf file, that contains list of kernel
> modules to be loaded during system boot, to "${nonarch_libdir}". This is done
> by removing '--with-systemd-modules-load=' flag from EXTRA_OECONF variable.
>
> Previous path based on "${systemd_unitdir}" was not considered by default by
> systemd-modules-load.service.

ok, it does look like there's a fix that should be made here, thanks. It took a bit of following to see what's involved, so:

There are two recipes in meta-openembedded that do use ${nonarch_libdir} for this, but the systemd package itself doesn't: the recipe has ${exec_prefix}/lib/modules-load.d instead, and there's a systemd patch that applies ${exec_prefix}/lib/modules-load.d too; but then in oe-core, bitbake.conf defines: nonarch_libdir = "${exec_prefix}/lib"
so the end result should work in the default configuration.

Khem: should the OE Core systemd recipe and patch be using ${nonarch_libdir} too? Or should the recipes that package modules.d config files place them via ${exec_prefix}/lib ?

thanks

Christopher

 
>
> Signed-off-by: Kamil Dziezyk <kamil.dziezyk@...>
Reviewed-by: Bertrand Marquis <bertrand.marquis@...>

Cheers
Bertrand

> ---
> recipes-extended/xen/xen-tools.inc | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/recipes-extended/xen/xen-tools.inc b/recipes-extended/xen/xen-tools.inc
> index d831941..6b99040 100644
> --- a/recipes-extended/xen/xen-tools.inc
> +++ b/recipes-extended/xen/xen-tools.inc
> @@ -653,10 +653,10 @@ FILES:${PN}-xm = "\
>     "
>
> FILES:${PN}-xencommons += "\
> +    ${nonarch_libdir}/modules-load.d/xen.conf \
>     ${sysconfdir}/default/xencommons \
>     ${sysconfdir}/init.d/xencommons \
>     ${sysconfdir}/xen/scripts/launch-xenstore \
> -    ${systemd_unitdir}/modules-load.d/xen.conf \
>     ${systemd_unitdir}/system/proc-xen.mount \
>     ${systemd_unitdir}/system/xen-qemu-dom0-disk-backend.service \
>     ${systemd_unitdir}/system/xenconsoled.service \
> @@ -744,7 +744,6 @@ SYSTEMD_SERVICE:${PN}-xendomains = "xendomains.service"
>
> EXTRA_OECONF += " \
>     --with-systemd=${systemd_unitdir}/system \
> -    --with-systemd-modules-load=${systemd_unitdir}/modules-load.d \
>     --with-initddir=${INIT_D_DIR} \
>     --with-sysconfig-leaf-dir=default \
>     --with-system-qemu=${bindir}/qemu-system-i386 \
> --
> 2.17.1
>
>
>
>





[PATCH 3/3] MAINTAINERS: add xtf and the raspberry pi dynamic layer for Xen

Christopher Clark
 

Add the more recent Xen-related recipes to the list.

Signed-off-by: Christopher Clark <christopher.w.clark@...>
---
MAINTAINERS | 2 ++
1 file changed, 2 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 1bb9a24..4b41bad 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -32,3 +32,5 @@ M: Christopher Clark <christopher.w.clark@...>
F: recipes-extended/xen/
F: recipes-extended/uxen/
F: recipes-extended/images/*xen*.bb
+F: recipes-extended/images/xtf*.bb
+F: dynamic-layers/raspberrypi/
--
2.25.1


[PATCH 2/3] xen-tools: upgrade RSUGGESTS to RRECOMMENDS for ifupdown

Christopher Clark
 

Xen's networking for guests is typically configured using bridges and
the standalone ifupdown package, which contains a more capable version
of the tool than busybox, is needed to configure them, so:

Increase the recommendation strength from RSUGGESTS to RRECOMMENDS to
bring the package in by default, which fixes networking for images built
with packaging formats that follow RRECOMMENDS but not RSUGGESTS.

I should've paid closer attention to Corey's recommendation for this, so:
Suggested-by: Corey Minyard <cminyard@...>

Signed-off-by: Christopher Clark <christopher.w.clark@...>
---
recipes-extended/xen/xen-tools.inc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/recipes-extended/xen/xen-tools.inc b/recipes-extended/xen/xen-tools.inc
index d831941..ca924f4 100644
--- a/recipes-extended/xen/xen-tools.inc
+++ b/recipes-extended/xen/xen-tools.inc
@@ -94,7 +94,7 @@ RDEPENDS:${PN}-scripts-network = "\
${PN}-volatiles \
"

-RSUGGESTS:${PN}-scripts-network = "\
+RRECOMMENDS:${PN}-scripts-network = "\
ifupdown \
"

--
2.25.1


[PATCH 1/3] xen: drop patch to workaround prelink on aarch64

Christopher Clark
 

prelink is no longer default enabled and has been recommended to be
disabled since OE-core f9719cc1.

Signed-off-by: Christopher Clark <christopher.w.clark@...>
---
...xen-arm64-implement-atomic-fetch-add.patch | 50 -------------------
recipes-extended/xen/xen_4.14.bb | 1 -
recipes-extended/xen/xen_4.15.bb | 1 -
recipes-extended/xen/xen_git.bb | 1 -
4 files changed, 53 deletions(-)
delete mode 100644 recipes-extended/xen/files/xen-arm64-implement-atomic-fetch-add.patch

diff --git a/recipes-extended/xen/files/xen-arm64-implement-atomic-fetch-add.patch b/recipes-extended/xen/files/xen-arm64-implement-atomic-fetch-add.patch
deleted file mode 100644
index 6e957a5..0000000
--- a/recipes-extended/xen/files/xen-arm64-implement-atomic-fetch-add.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Christopher Clark <christopher.w.clark@...>
-Date: Fri, 26 June 2020 16:34:00 -0800
-Subject: [PATCH] xen: implement atomic op to fix arm64 compilation
-
-Xen's ARM implementation of arch_fetch_and_add since f9cc3cd9
-uses a builtin, despite the build being performed with -fno-builtin.
-With gcc 10.1.0, this now breaks prelinking spinlock.c, so
-implement the one atomic operation that is required with logic
-derived from Linux's atomic_ll_sc.h: ATOMIC_FETCH_OP and comparison with
-the binary produced with and without the patch with gcc 9.2.0.
-
-Signed-off-by: Christopher Clark <christopher.w.clark@...>
-diff --git a/xen/include/asm-arm/system.h b/xen/include/asm-arm/system.h
-index e5d062667d..c46dd3ac71 100644
---- a/xen/include/asm-arm/system.h
-+++ b/xen/include/asm-arm/system.h
-@@ -55,7 +55,32 @@ static inline int local_abort_is_enabled(void)
- return !(flags & PSR_ABT_MASK);
- }
-
-+#ifdef CONFIG_ARM_64
-+
-+/* see atomic_ll_sc.h: ATOMIC_FETCH_OP(name, mb, acq, rel, cl, op, asm_op, constraint) */
-+static inline int arch_fetch_and_add(unsigned int *ptr, unsigned long i)
-+{
-+ int register lptr asm("x0");
-+ int register result asm("w1");
-+ int register newval asm("w2");
-+ int register status asm("w3");
-+
-+ asm volatile(
-+ " mov %[lptr], %[ptr]\n"
-+ "1: ldxr %w[result], [%[lptr]]\n"
-+ " add %w[newval], %w[result], %w[i]\n"
-+ " stlxr %w[status], %w[newval], [%[lptr]]\n"
-+ " cbnz %w[status], 1b\n"
-+ " dmb ish\n"
-+ : [result] "=&r" (result), [lptr] "=&r" (lptr), [newval] "=&r" (newval), [status] "=&r" (status), [i] "+r" (i), "+Q" (*ptr)
-+ : [ptr] "r" (ptr), "r" (i)
-+ : "memory");
-+
-+ return result;
-+}
-+#else
- #define arch_fetch_and_add(x, v) __sync_fetch_and_add(x, v)
-+#endif
-
- extern struct vcpu *__context_switch(struct vcpu *prev, struct vcpu *next);
-
diff --git a/recipes-extended/xen/xen_4.14.bb b/recipes-extended/xen/xen_4.14.bb
index 0d7d20b..267db16 100644
--- a/recipes-extended/xen/xen_4.14.bb
+++ b/recipes-extended/xen/xen_4.14.bb
@@ -6,7 +6,6 @@ XEN_BRANCH ?= "stable-${XEN_REL}"

SRC_URI = " \
git://xenbits.xen.org/xen.git;branch=${XEN_BRANCH} \
- file://xen-arm64-implement-atomic-fetch-add.patch \
file://0001-menuconfig-mconf-cfg-Allow-specification-of-ncurses-location.patch \
"

diff --git a/recipes-extended/xen/xen_4.15.bb b/recipes-extended/xen/xen_4.15.bb
index 0cfaf0c..1b87ae8 100644
--- a/recipes-extended/xen/xen_4.15.bb
+++ b/recipes-extended/xen/xen_4.15.bb
@@ -6,7 +6,6 @@ XEN_BRANCH ?= "stable-${XEN_REL}"

SRC_URI = " \
git://xenbits.xen.org/xen.git;branch=${XEN_BRANCH} \
- file://xen-arm64-implement-atomic-fetch-add.patch \
file://0001-menuconfig-mconf-cfg-Allow-specification-of-ncurses-location.patch \
"

diff --git a/recipes-extended/xen/xen_git.bb b/recipes-extended/xen/xen_git.bb
index 20227e0..e014733 100644
--- a/recipes-extended/xen/xen_git.bb
+++ b/recipes-extended/xen/xen_git.bb
@@ -6,7 +6,6 @@ XEN_BRANCH ?= "master"

SRC_URI = " \
git://xenbits.xen.org/xen.git;branch=${XEN_BRANCH} \
- file://xen-arm64-implement-atomic-fetch-add.patch \
file://0001-menuconfig-mconf-cfg-Allow-specification-of-ncurses-location.patch \
"

--
2.25.1


Re: [PATCH 3/3] grub-efi: Add xen_boot support when 'xen' is in DISTRO_FEATURES for aarch64

Bertrand Marquis
 

Hi Kamil,

On 8 Dec 2021, at 10:44, Kamil Dziezyk via lists.yoctoproject.org <kamil.dziezyk=arm.com@...> wrote:

Signed-off-by: Kamil Dziezyk <kamil.dziezyk@...>
Reviewed-by: Bertrand Marquis <bertrand.marquis@...>

But an empty commit message is not something that I like (more for next time, no need to change this patch).

Cheers
Bertrand
---
recipes-bsp/grub/grub-efi_%.bbappend | 1 +
recipes-bsp/grub/grub-efi_xen.inc | 1 +
2 files changed, 2 insertions(+)
create mode 100644 recipes-bsp/grub/grub-efi_%.bbappend
create mode 100644 recipes-bsp/grub/grub-efi_xen.inc

diff --git a/recipes-bsp/grub/grub-efi_%.bbappend b/recipes-bsp/grub/grub-efi_%.bbappend
new file mode 100644
index 0000000..df2b688
--- /dev/null
+++ b/recipes-bsp/grub/grub-efi_%.bbappend
@@ -0,0 +1 @@
+require ${@bb.utils.contains('DISTRO_FEATURES', 'xen', '${BPN}_xen.inc', '', d)}
diff --git a/recipes-bsp/grub/grub-efi_xen.inc b/recipes-bsp/grub/grub-efi_xen.inc
new file mode 100644
index 0000000..5aa0958
--- /dev/null
+++ b/recipes-bsp/grub/grub-efi_xen.inc
@@ -0,0 +1 @@
+GRUB_BUILDIN:append:aarch64 = "${@bb.utils.contains('DISTRO_FEATURES', 'xen', ' xen_boot', '', d)}"
--
2.17.1




Re: [PATCH 2/3] xen: Clear TUNE_CCARGS for Xen build for aarch64 machines

Bertrand Marquis
 

Hi Kamil,

On 8 Dec 2021, at 10:44, Kamil Dziezyk via lists.yoctoproject.org <kamil.dziezyk=arm.com@...> wrote:

Xen build may fail for arm machines that have enabled extra flags,
that can be enabled only for specific architecture version, e.g. armv8-2a.

Signed-off-by: Kamil Dziezyk <kamil.dziezyk@...>
Reviewed-by: Bertrand Marquis <bertrand.marquis@...>

Cheers
Bertrand

---
recipes-extended/xen/xen.inc | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/recipes-extended/xen/xen.inc b/recipes-extended/xen/xen.inc
index d3c7a7d..9ac82ef 100644
--- a/recipes-extended/xen/xen.inc
+++ b/recipes-extended/xen/xen.inc
@@ -102,6 +102,11 @@ EXTRA_CFLAGS_XEN_CORE="${DEBUG_PREFIX_MAP}"
# EXTRA_CFLAGS_XEN_TOOLS: so clear TUNE_CCARGS on x86 to prevent that.
TUNE_CCARGS:x86-64=""

+# - The Xen build for aarch64 systems with HVM-mode enabled may include
+# architecture specific flags '-march=*' which causes build failure, so clear
+# TUNE_CCARGS on aarch64 to prevent that.
+TUNE_CCARGS:aarch64=""
+
# - Yocto supplies the _FORTIFY_SOURCE flag via CC/CPP/CXX but then passes the
# optimization -O via C*FLAGS which is problematic when the CFLAGS are cleared
# within the build because compilation fails with the compiler stating
--
2.17.1




Re: [PATCH 1/3] xen-tools: Load xen related kernel modules during system boot

Bertrand Marquis
 

Hi Kamil,

On 8 Dec 2021, at 10:44, Kamil Dziezyk via lists.yoctoproject.org <kamil.dziezyk=arm.com@...> wrote:

This patch changes the location of xen.conf file, that contains list of kernel
modules to be loaded during system boot, to "${nonarch_libdir}". This is done
by removing '--with-systemd-modules-load=' flag from EXTRA_OECONF variable.

Previous path based on "${systemd_unitdir}" was not considered by default by
systemd-modules-load.service.

Signed-off-by: Kamil Dziezyk <kamil.dziezyk@...>
Reviewed-by: Bertrand Marquis <bertrand.marquis@...>

Cheers
Bertrand

---
recipes-extended/xen/xen-tools.inc | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/recipes-extended/xen/xen-tools.inc b/recipes-extended/xen/xen-tools.inc
index d831941..6b99040 100644
--- a/recipes-extended/xen/xen-tools.inc
+++ b/recipes-extended/xen/xen-tools.inc
@@ -653,10 +653,10 @@ FILES:${PN}-xm = "\
"

FILES:${PN}-xencommons += "\
+ ${nonarch_libdir}/modules-load.d/xen.conf \
${sysconfdir}/default/xencommons \
${sysconfdir}/init.d/xencommons \
${sysconfdir}/xen/scripts/launch-xenstore \
- ${systemd_unitdir}/modules-load.d/xen.conf \
${systemd_unitdir}/system/proc-xen.mount \
${systemd_unitdir}/system/xen-qemu-dom0-disk-backend.service \
${systemd_unitdir}/system/xenconsoled.service \
@@ -744,7 +744,6 @@ SYSTEMD_SERVICE:${PN}-xendomains = "xendomains.service"

EXTRA_OECONF += " \
--with-systemd=${systemd_unitdir}/system \
- --with-systemd-modules-load=${systemd_unitdir}/modules-load.d \
--with-initddir=${INIT_D_DIR} \
--with-sysconfig-leaf-dir=default \
--with-system-qemu=${bindir}/qemu-system-i386 \
--
2.17.1




[PATCH 2/3] xen: Clear TUNE_CCARGS for Xen build for aarch64 machines

Kamil Dziezyk
 

Xen build may fail for arm machines that have enabled extra flags,
that can be enabled only for specific architecture version, e.g. armv8-2a.

Signed-off-by: Kamil Dziezyk <kamil.dziezyk@...>
---
recipes-extended/xen/xen.inc | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/recipes-extended/xen/xen.inc b/recipes-extended/xen/xen.inc
index d3c7a7d..9ac82ef 100644
--- a/recipes-extended/xen/xen.inc
+++ b/recipes-extended/xen/xen.inc
@@ -102,6 +102,11 @@ EXTRA_CFLAGS_XEN_CORE="${DEBUG_PREFIX_MAP}"
# EXTRA_CFLAGS_XEN_TOOLS: so clear TUNE_CCARGS on x86 to prevent that.
TUNE_CCARGS:x86-64=""

+# - The Xen build for aarch64 systems with HVM-mode enabled may include
+# architecture specific flags '-march=*' which causes build failure, so clear
+# TUNE_CCARGS on aarch64 to prevent that.
+TUNE_CCARGS:aarch64=""
+
# - Yocto supplies the _FORTIFY_SOURCE flag via CC/CPP/CXX but then passes the
# optimization -O via C*FLAGS which is problematic when the CFLAGS are cleared
# within the build because compilation fails with the compiler stating
--
2.17.1


[PATCH 3/3] grub-efi: Add xen_boot support when 'xen' is in DISTRO_FEATURES for aarch64

Kamil Dziezyk
 

Signed-off-by: Kamil Dziezyk <kamil.dziezyk@...>
---
recipes-bsp/grub/grub-efi_%.bbappend | 1 +
recipes-bsp/grub/grub-efi_xen.inc | 1 +
2 files changed, 2 insertions(+)
create mode 100644 recipes-bsp/grub/grub-efi_%.bbappend
create mode 100644 recipes-bsp/grub/grub-efi_xen.inc

diff --git a/recipes-bsp/grub/grub-efi_%.bbappend b/recipes-bsp/grub/grub-efi_%.bbappend
new file mode 100644
index 0000000..df2b688
--- /dev/null
+++ b/recipes-bsp/grub/grub-efi_%.bbappend
@@ -0,0 +1 @@
+require ${@bb.utils.contains('DISTRO_FEATURES', 'xen', '${BPN}_xen.inc', '', d)}
diff --git a/recipes-bsp/grub/grub-efi_xen.inc b/recipes-bsp/grub/grub-efi_xen.inc
new file mode 100644
index 0000000..5aa0958
--- /dev/null
+++ b/recipes-bsp/grub/grub-efi_xen.inc
@@ -0,0 +1 @@
+GRUB_BUILDIN:append:aarch64 = "${@bb.utils.contains('DISTRO_FEATURES', 'xen', ' xen_boot', '', d)}"
--
2.17.1


[PATCH 1/3] xen-tools: Load xen related kernel modules during system boot

Kamil Dziezyk
 

This patch changes the location of xen.conf file, that contains list of kernel
modules to be loaded during system boot, to "${nonarch_libdir}". This is done
by removing '--with-systemd-modules-load=' flag from EXTRA_OECONF variable.

Previous path based on "${systemd_unitdir}" was not considered by default by
systemd-modules-load.service.

Signed-off-by: Kamil Dziezyk <kamil.dziezyk@...>
---
recipes-extended/xen/xen-tools.inc | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/recipes-extended/xen/xen-tools.inc b/recipes-extended/xen/xen-tools.inc
index d831941..6b99040 100644
--- a/recipes-extended/xen/xen-tools.inc
+++ b/recipes-extended/xen/xen-tools.inc
@@ -653,10 +653,10 @@ FILES:${PN}-xm = "\
"

FILES:${PN}-xencommons += "\
+ ${nonarch_libdir}/modules-load.d/xen.conf \
${sysconfdir}/default/xencommons \
${sysconfdir}/init.d/xencommons \
${sysconfdir}/xen/scripts/launch-xenstore \
- ${systemd_unitdir}/modules-load.d/xen.conf \
${systemd_unitdir}/system/proc-xen.mount \
${systemd_unitdir}/system/xen-qemu-dom0-disk-backend.service \
${systemd_unitdir}/system/xenconsoled.service \
@@ -744,7 +744,6 @@ SYSTEMD_SERVICE:${PN}-xendomains = "xendomains.service"

EXTRA_OECONF += " \
--with-systemd=${systemd_unitdir}/system \
- --with-systemd-modules-load=${systemd_unitdir}/modules-load.d \
--with-initddir=${INIT_D_DIR} \
--with-sysconfig-leaf-dir=default \
--with-system-qemu=${bindir}/qemu-system-i386 \
--
2.17.1


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

Christopher Clark
 

On Tue, Nov 30, 2021 at 8:52 AM Martin Jansa <martin.jansa@...> wrote:

Hi Martin, Bruce

Apologies for taking a long time to reply to the work on the uxen tools and thanks to both of you for your patches.


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

Ack, and I agree, I would like to get this fixed upstream to retire the patches. The issue tracker is https://github.com/uxen-virt/uxen/issues and I'll add a reference to that to the recipe in my next update to it.
 

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.

Ack - thanks for addressing the build issue. I've now studied the patches, the uxen tools driver code and code in Linux, and believe that some additional changes may be necessary for the newer kernels - I will look into that (I will need a bit of time, with holidays, end of year etc. - hope that's ok).

Christopher

 

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




Re: [hardknott][PATCH] oci-runtime-spec: fix url

Bruce Ashfield
 

On Fri, Dec 3, 2021 at 9:36 AM Stefan Müller-Klieser
<s.mueller-klieser@...> wrote:

On 03.12.21 15:07, Bruce Ashfield wrote:
Since we already have these changes in master, this is fundamentally a
cherrypick / backport request.
true, I did not follow, sorry


There are a couple of larger/group patches for the protocol and branch
changes, but there's an individual one for the switch to main.

I cherry-picked and modified everything, and pushed it to
hardknott-next .. have a look and let me know if anything needs
adjustment.
I just put hardknott-next in the build and it looks good. That is all I
needed. Thanks a lot for the quick reply and the quick fix! Have a good
weekend!
Good enough for me! I've pushed -next to hardknott.

Bruce


Cheers, Stefan


Bruce

On Fri, Dec 3, 2021 at 8:04 AM Stefan Mueller-Klieser
<S.Mueller-Klieser@...> wrote:

Upstream renamed master to main and github will remove the git protocol.

Signed-off-by: Stefan Müller-Klieser <s.mueller-klieser@...>
---
recipes-containers/oci-runtime-spec/oci-runtime-spec_git.bb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/recipes-containers/oci-runtime-spec/oci-runtime-spec_git.bb b/recipes-containers/oci-runtime-spec/oci-runtime-spec_git.bb
index c4083c09d818..99f309772310 100644
--- a/recipes-containers/oci-runtime-spec/oci-runtime-spec_git.bb
+++ b/recipes-containers/oci-runtime-spec/oci-runtime-spec_git.bb
@@ -7,7 +7,7 @@ LIC_FILES_CHKSUM = "file://src/${PKG_NAME}/LICENSE;md5=b355a61a394a504dacde901c9
SRCNAME = "runtime-spec"

PKG_NAME = "github.com/opencontainers/${SRCNAME}"
-SRC_URI = "git://${PKG_NAME}.git;destsuffix=git/src/${PKG_NAME}"
+SRC_URI = "git://${PKG_NAME}.git;branch=main;protocol=https;destsuffix=git/src/${PKG_NAME}"

SRCREV = "78ab98c0761136f84e6e21b24b4dcd0be68ab782"
PV = "v1.0.1+git${SRCPV}"
--
2.20.1



--
Dipl.-Phys. Stefan Müller-Klieser
-Gruppenleiter Software-
Tel.: +49 (0)6131 9221-0
s.mueller-klieser@...
www.phytec.de

Sie finden uns auch auf: Facebook, LinkedIn, Xing, YouTube

PHYTEC Messtechnik GmbH | Robert-Koch-Str. 39 | 55129 Mainz, Germany
Geschäftsführer: Dipl.-Ing. Michael Mitezki, Dipl.-Ing. Bodo Huber |
Handelsregister Mainz HRB 4656 | Finanzamt Mainz| St.Nr. 266500608, DE
149059855
This E-Mail may contain confidential or privileged information. If you
are not the intended recipient (or have received this E-Mail in error)
please notify the sender immediately and destroy this E-Mail. Any
unauthorized copying, disclosure or distribution of the material in
this E-Mail is strictly forbidden.


--
- 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: [hardknott][PATCH] oci-runtime-spec: fix url

Stefan Mueller-Klieser
 

On 03.12.21 15:07, Bruce Ashfield wrote:
Since we already have these changes in master, this is fundamentally a
cherrypick / backport request.
true, I did not follow, sorry


There are a couple of larger/group patches for the protocol and branch
changes, but there's an individual one for the switch to main.

I cherry-picked and modified everything, and pushed it to
hardknott-next .. have a look and let me know if anything needs
adjustment.
I just put hardknott-next in the build and it looks good. That is all I
needed. Thanks a lot for the quick reply and the quick fix! Have a good
weekend!

Cheers, Stefan


Bruce

On Fri, Dec 3, 2021 at 8:04 AM Stefan Mueller-Klieser
<S.Mueller-Klieser@...> wrote:

Upstream renamed master to main and github will remove the git protocol.

Signed-off-by: Stefan Müller-Klieser <s.mueller-klieser@...>
---
recipes-containers/oci-runtime-spec/oci-runtime-spec_git.bb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/recipes-containers/oci-runtime-spec/oci-runtime-spec_git.bb b/recipes-containers/oci-runtime-spec/oci-runtime-spec_git.bb
index c4083c09d818..99f309772310 100644
--- a/recipes-containers/oci-runtime-spec/oci-runtime-spec_git.bb
+++ b/recipes-containers/oci-runtime-spec/oci-runtime-spec_git.bb
@@ -7,7 +7,7 @@ LIC_FILES_CHKSUM = "file://src/${PKG_NAME}/LICENSE;md5=b355a61a394a504dacde901c9
SRCNAME = "runtime-spec"

PKG_NAME = "github.com/opencontainers/${SRCNAME}"
-SRC_URI = "git://${PKG_NAME}.git;destsuffix=git/src/${PKG_NAME}"
+SRC_URI = "git://${PKG_NAME}.git;branch=main;protocol=https;destsuffix=git/src/${PKG_NAME}"

SRCREV = "78ab98c0761136f84e6e21b24b4dcd0be68ab782"
PV = "v1.0.1+git${SRCPV}"
--
2.20.1


--
Dipl.-Phys. Stefan Müller-Klieser
-Gruppenleiter Software-
Tel.: +49 (0)6131 9221-0
s.mueller-klieser@...
www.phytec.de

Sie finden uns auch auf: Facebook, LinkedIn, Xing, YouTube

PHYTEC Messtechnik GmbH | Robert-Koch-Str. 39 | 55129 Mainz, Germany
Geschäftsführer: Dipl.-Ing. Michael Mitezki, Dipl.-Ing. Bodo Huber |
Handelsregister Mainz HRB 4656 | Finanzamt Mainz| St.Nr. 266500608, DE
149059855
This E-Mail may contain confidential or privileged information. If you
are not the intended recipient (or have received this E-Mail in error)
please notify the sender immediately and destroy this E-Mail. Any
unauthorized copying, disclosure or distribution of the material in
this E-Mail is strictly forbidden.


Re: [hardknott][PATCH] oci-runtime-spec: fix url

Bruce Ashfield
 

Since we already have these changes in master, this is fundamentally a
cherrypick / backport request.

There are a couple of larger/group patches for the protocol and branch
changes, but there's an individual one for the switch to main.

I cherry-picked and modified everything, and pushed it to
hardknott-next .. have a look and let me know if anything needs
adjustment.

Bruce

On Fri, Dec 3, 2021 at 8:04 AM Stefan Mueller-Klieser
<S.Mueller-Klieser@...> wrote:

Upstream renamed master to main and github will remove the git protocol.

Signed-off-by: Stefan Müller-Klieser <s.mueller-klieser@...>
---
recipes-containers/oci-runtime-spec/oci-runtime-spec_git.bb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/recipes-containers/oci-runtime-spec/oci-runtime-spec_git.bb b/recipes-containers/oci-runtime-spec/oci-runtime-spec_git.bb
index c4083c09d818..99f309772310 100644
--- a/recipes-containers/oci-runtime-spec/oci-runtime-spec_git.bb
+++ b/recipes-containers/oci-runtime-spec/oci-runtime-spec_git.bb
@@ -7,7 +7,7 @@ LIC_FILES_CHKSUM = "file://src/${PKG_NAME}/LICENSE;md5=b355a61a394a504dacde901c9
SRCNAME = "runtime-spec"

PKG_NAME = "github.com/opencontainers/${SRCNAME}"
-SRC_URI = "git://${PKG_NAME}.git;destsuffix=git/src/${PKG_NAME}"
+SRC_URI = "git://${PKG_NAME}.git;branch=main;protocol=https;destsuffix=git/src/${PKG_NAME}"

SRCREV = "78ab98c0761136f84e6e21b24b4dcd0be68ab782"
PV = "v1.0.1+git${SRCPV}"
--
2.20.1




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


[hardknott][PATCH] oci-runtime-spec: fix url

Stefan Mueller-Klieser
 

Upstream renamed master to main and github will remove the git protocol.

Signed-off-by: Stefan Müller-Klieser <s.mueller-klieser@...>
---
recipes-containers/oci-runtime-spec/oci-runtime-spec_git.bb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/recipes-containers/oci-runtime-spec/oci-runtime-spec_git.bb b/recipes-containers/oci-runtime-spec/oci-runtime-spec_git.bb
index c4083c09d818..99f309772310 100644
--- a/recipes-containers/oci-runtime-spec/oci-runtime-spec_git.bb
+++ b/recipes-containers/oci-runtime-spec/oci-runtime-spec_git.bb
@@ -7,7 +7,7 @@ LIC_FILES_CHKSUM = "file://src/${PKG_NAME}/LICENSE;md5=b355a61a394a504dacde901c9
SRCNAME = "runtime-spec"

PKG_NAME = "github.com/opencontainers/${SRCNAME}"
-SRC_URI = "git://${PKG_NAME}.git;destsuffix=git/src/${PKG_NAME}"
+SRC_URI = "git://${PKG_NAME}.git;branch=main;protocol=https;destsuffix=git/src/${PKG_NAME}"

SRCREV = "78ab98c0761136f84e6e21b24b4dcd0be68ab782"
PV = "v1.0.1+git${SRCPV}"
--
2.20.1


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

Bruce Ashfield
 

In message: [meta-virtualization] [PATCH] qemu-package-split.inc: Correct a typo
on 01/12/2021 Peter Kjellerstedt wrote:

I had noticed this myself, and swear that I fixed it .. but I can't
find any trace of the change now.

This is merged.

Bruce

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: [hardknott][PATCH 01/13] uxen: update guest tools to 4.1.8

Bruce Ashfield
 

all 13 are merged to hardknott.

Bruce

In message: [meta-virtualization][hardknott][PATCH 01/13] uxen: update guest tools to 4.1.8
on 01/12/2021 Martin Jansa wrote:

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


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

Bruce Ashfield
 

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

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


[hardknott][PATCH 13/13] dev86: don't require dev86-native to build dev86

Martin Jansa
 

From: Ross Burton <ross@...>

Instead of installing binaries and patching the makefiles to run external commands, simply
build ifdef using BUILD_CC instead of CC.

This patch is now upstreamable, the recipe is less complicated, and nativesdk works.

Signed-off-by: Ross Burton <ross.burton@...>
Signed-off-by: Bruce Ashfield <bruce.ashfield@...>
---
...efg-from-dev86-native-instead-of-tar.patch | 36 -------------------
recipes-extended/dev86/dev86/cross.patch | 29 +++++++++++++++
recipes-extended/dev86/dev86_git.bb | 12 ++-----
3 files changed, 32 insertions(+), 45 deletions(-)
delete mode 100644 recipes-extended/dev86/dev86/0002-Makefile-use-ifdefg-from-dev86-native-instead-of-tar.patch
create mode 100644 recipes-extended/dev86/dev86/cross.patch

diff --git a/recipes-extended/dev86/dev86/0002-Makefile-use-ifdefg-from-dev86-native-instead-of-tar.patch b/recipes-extended/dev86/dev86/0002-Makefile-use-ifdefg-from-dev86-native-instead-of-tar.patch
deleted file mode 100644
index 52d5d59..0000000
--- a/recipes-extended/dev86/dev86/0002-Makefile-use-ifdefg-from-dev86-native-instead-of-tar.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From 9b347a5ee9604d4ec972506328ee44a0d8eb1bf0 Mon Sep 17 00:00:00 2001
-From: Martin Jansa <Martin.Jansa@...>
-Date: Fri, 14 May 2021 06:32:02 -0700
-Subject: [PATCH] Makefile: use ifdefg from dev86-native instead of target
-
-* recipe is restricted to:
- COMPATIBLE_HOST = "(i.86|x86_64).*-linux"
- so it's less likely to reproduce invalid combination of
- host and target, but I guess if you have aarch64 build
- machine and build for x86 then it might fail as for Bruce:
-
-| ./ifdefg -MU makefile.in >tmp.mak
-| /bin/sh: 1: ./ifdefg: not found
-| make[1]: *** [Makefile:46: make.fil] Error 127
-
- use ifdefg from native build to increase chances that it
- will be compatible with your host system
-
-Signed-off-by: Martin Jansa <Martin.Jansa@...>
----
- Makefile | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/Makefile b/Makefile
-index 8a61b65..7fdf861 100644
---- a/Makefile
-+++ b/Makefile
-@@ -43,7 +43,7 @@ realclean:
- -for X in */; do cd $$X && make clean; cd $(WD); done
-
- make.fil: $(IFDEFNAME) makefile.in
-- ./$(IFDEFNAME) -MU $(IFDEFOPTS) makefile.in >tmp.mak
-+ $(IFDEFNAME) -MU $(IFDEFOPTS) makefile.in >tmp.mak
- echo > tmp.sed
- [ "$(BINDIR)" != "//bin" ] || echo >> tmp.sed "s:%BINDIR%:/bin:"
- [ "$(LIBDIR)" != "//lib/bcc" ] || echo >> tmp.sed "s:%LIBDIR%:/lib/bcc:"
diff --git a/recipes-extended/dev86/dev86/cross.patch b/recipes-extended/dev86/dev86/cross.patch
new file mode 100644
index 0000000..041a8d3
--- /dev/null
+++ b/recipes-extended/dev86/dev86/cross.patch
@@ -0,0 +1,29 @@
+Build ifdef using BUILD_CC, not CC.
+
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <ross.burton@...>
+
+diff --git a/Makefile b/Makefile
+index 8a61b65..99f41de 100644
+--- a/Makefile
++++ b/Makefile
+@@ -22,6 +22,10 @@ CFLAGS= -O
+ IFDEFNAME= ifdef
+ WD=$(shell pwd)
+
++BUILD_CC ?= $(CC)
++BUILD_CFLAGS ?= $(CFLAGS)
++BUILD_LDFLAGS ?= $(LDFLAGS)
++
+ # Some makes take the last of a list as the default ...
+ all: make.fil
+ PATH="`pwd`/bin:$$PATH" $(MAKE) -f make.fil VERSION=$(VERSION) TOPDIR=`pwd` $@
+@@ -65,7 +69,7 @@ make.fil: $(IFDEFNAME) makefile.in
+ @rm -f tmp.mak tmp.sed
+
+ $(IFDEFNAME): ifdef.c
+- $(CC) $(IFDEFARCH) $(CFLAGS) $(IFDEFFLAGS) $(LDFLAGS) -o $(IFDEFNAME) ifdef.c
++ $(BUILD_CC) $(IFDEFARCH) $(BUILD_CFLAGS) $(IFDEFFLAGS) $(BUILD_LDFLAGS) -o $(IFDEFNAME) ifdef.c
+
+ uninstall:
+ @echo 'Sorry, no go; it was just wrong.'
diff --git a/recipes-extended/dev86/dev86_git.bb b/recipes-extended/dev86/dev86_git.bb
index ad7a0df..838918a 100644
--- a/recipes-extended/dev86/dev86_git.bb
+++ b/recipes-extended/dev86/dev86_git.bb
@@ -11,16 +11,14 @@ SRC_URI = "git://github.com/jbruchon/${BPN}.git;protocol=https \
file://0001-cpp-Makefile-respect-LDFLAGS-when-building-bcc-cpp.patch \
file://0003-cpp-update-token1.tok-to-make-new-gperf-happy-regen..patch \
file://0004-regen-token2.h-token1.h-with-gperf-3.1.patch \
-"
-SRC_URI_append_class-target = " \
- file://0002-Makefile-use-ifdefg-from-dev86-native-instead-of-tar.patch \
+ file://cross.patch \
"

S = "${WORKDIR}/git"

-DEPENDS = "gperf-native dev86-native"
+DEPENDS = "gperf-native"

-BBCLASSEXTEND = "native"
+BBCLASSEXTEND = "native nativesdk"
EXTRA_OEMAKE = "VERSION=${BASE_PV} PREFIX=${prefix} DIST=${D} LDFLAGS='${LDFLAGS}' INEXE=''"

do_compile() {
@@ -41,8 +39,4 @@ do_install() {
ln -s ../lib/bcc/bcc-cc1 ${D}${prefix}/bin/bcc-cc1
}

-do_install_append_class-native() {
- install -v -m 755 ${B}/ifdefg ${D}${bindir}
-}
-
FILES_${PN} += "${libdir}/bcc"
--
2.32.0

441 - 460 of 7404