All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kvmtool: Backport patch for musl compatibility
@ 2025-11-26  8:50 jaeyoon.jung
  2025-12-02  5:02 ` [meta-virtualization] " Bruce Ashfield
  0 siblings, 1 reply; 2+ messages in thread
From: jaeyoon.jung @ 2025-11-26  8:50 UTC (permalink / raw)
  To: meta-virtualization; +Cc: Jaeyoon Jung

From: Jaeyoon Jung <jaeyoon.jung@lge.com>

The fix is needed for SRCREV used in Styhead and older.

Signed-off-by: Jaeyoon Jung <jaeyoon.jung@lge.com>
---
 ...e.h-inclusion-for-musl-compatibility.patch | 51 +++++++++++++++++++
 recipes-extended/kvmtool/kvmtool_git.bb       |  1 +
 2 files changed, 52 insertions(+)
 create mode 100644 recipes-extended/kvmtool/files/0004-remove-wordsize.h-inclusion-for-musl-compatibility.patch

diff --git a/recipes-extended/kvmtool/files/0004-remove-wordsize.h-inclusion-for-musl-compatibility.patch b/recipes-extended/kvmtool/files/0004-remove-wordsize.h-inclusion-for-musl-compatibility.patch
new file mode 100644
index 00000000..1fdbca72
--- /dev/null
+++ b/recipes-extended/kvmtool/files/0004-remove-wordsize.h-inclusion-for-musl-compatibility.patch
@@ -0,0 +1,51 @@
+From 0592f8f829c843ff5cb2d108c309e32f4f6f5379 Mon Sep 17 00:00:00 2001
+From: Andre Przywara <andre.przywara@arm.com>
+Date: Thu, 1 Aug 2024 12:10:54 +0100
+Subject: [PATCH] remove wordsize.h inclusion (for musl compatibility)
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The wordsize.h header file and the __WORDSIZE definition do not seem
+to be universal, the musl libc for instance has the definition in a
+different header file. This breaks compilation of kvmtool against musl.
+
+The two leading underscores suggest a compiler-internal symbol anyway, so
+let's just remove that particular macro usage entirely, and replace it
+with the number we really want: the size of a "long" type.
+
+Reported-by: J. Neuschäfer <j.neuschaefer@gmx.net>
+Signed-off-by: Andre Przywara <andre.przywara@arm.com>
+Reviewed-by: Alexandru Elisei <alexandru.elisei@arm.com>
+Link: https://lore.kernel.org/r/20240801111054.818765-1-andre.przywara@arm.com
+Signed-off-by: Will Deacon <will@kernel.org>
+Upstream-Status: Backport [https://git.kernel.org/pub/scm/linux/kernel/git/will/kvmtool.git/commit/?id=0592f8f829c843ff5cb2d108c309e32f4f6f5379]
+---
+ include/linux/bitops.h | 6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+diff --git a/include/linux/bitops.h b/include/linux/bitops.h
+index ae33922..ee8fd56 100644
+--- a/include/linux/bitops.h
++++ b/include/linux/bitops.h
+@@ -1,15 +1,13 @@
+ #ifndef _KVM_LINUX_BITOPS_H_
+ #define _KVM_LINUX_BITOPS_H_
+ 
+-#include <bits/wordsize.h>
+-
+ #include <linux/kernel.h>
+ #include <linux/compiler.h>
+ #include <asm/hweight.h>
+ 
+-#define BITS_PER_LONG __WORDSIZE
+ #define BITS_PER_BYTE           8
+-#define BITS_TO_LONGS(nr)       DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long))
++#define BITS_PER_LONG           (BITS_PER_BYTE * sizeof(long))
++#define BITS_TO_LONGS(nr)       DIV_ROUND_UP(nr, BITS_PER_LONG)
+ 
+ #define BIT_WORD(nr)		((nr) / BITS_PER_LONG)
+ 
+-- 
+2.47.2
+
diff --git a/recipes-extended/kvmtool/kvmtool_git.bb b/recipes-extended/kvmtool/kvmtool_git.bb
index 141fb02d..a171129f 100644
--- a/recipes-extended/kvmtool/kvmtool_git.bb
+++ b/recipes-extended/kvmtool/kvmtool_git.bb
@@ -14,6 +14,7 @@ SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/will/kvmtool.git;branch
            file://0001-kvmtool-9p-fixed-compilation-error.patch \
            file://0002-kvmtool-add-EXTRA_CFLAGS-variable.patch \
            file://0003-kvmtool-Werror-disabled.patch \
+           file://0004-remove-wordsize.h-inclusion-for-musl-compatibility.patch \
            "
 
 SRCREV = "4d2c017f41533b0e51e00f689050c26190a15318"
-- 
2.47.2



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

* Re: [meta-virtualization] [PATCH] kvmtool: Backport patch for musl compatibility
  2025-11-26  8:50 [PATCH] kvmtool: Backport patch for musl compatibility jaeyoon.jung
@ 2025-12-02  5:02 ` Bruce Ashfield
  0 siblings, 0 replies; 2+ messages in thread
From: Bruce Ashfield @ 2025-12-02  5:02 UTC (permalink / raw)
  To: jaeyoon.jung; +Cc: meta-virtualization

I see that you figured out the branch name needs to be in the
subject  in [] to make things mergeable.

I tweaked the commit message as well, since there's no sense
reference release names in the commit messages.

Same for the scarthgap patch.

Bruce

In message: [meta-virtualization] [PATCH] kvmtool: Backport patch for musl compatibility
on 26/11/2025 Jaeyoon Jung (LGE) via lists.yoctoproject.org wrote:

> From: Jaeyoon Jung <jaeyoon.jung@lge.com>
> 
> The fix is needed for SRCREV used in Styhead and older.
> 
> Signed-off-by: Jaeyoon Jung <jaeyoon.jung@lge.com>
> ---
>  ...e.h-inclusion-for-musl-compatibility.patch | 51 +++++++++++++++++++
>  recipes-extended/kvmtool/kvmtool_git.bb       |  1 +
>  2 files changed, 52 insertions(+)
>  create mode 100644 recipes-extended/kvmtool/files/0004-remove-wordsize.h-inclusion-for-musl-compatibility.patch
> 
> diff --git a/recipes-extended/kvmtool/files/0004-remove-wordsize.h-inclusion-for-musl-compatibility.patch b/recipes-extended/kvmtool/files/0004-remove-wordsize.h-inclusion-for-musl-compatibility.patch
> new file mode 100644
> index 00000000..1fdbca72
> --- /dev/null
> +++ b/recipes-extended/kvmtool/files/0004-remove-wordsize.h-inclusion-for-musl-compatibility.patch
> @@ -0,0 +1,51 @@
> +From 0592f8f829c843ff5cb2d108c309e32f4f6f5379 Mon Sep 17 00:00:00 2001
> +From: Andre Przywara <andre.przywara@arm.com>
> +Date: Thu, 1 Aug 2024 12:10:54 +0100
> +Subject: [PATCH] remove wordsize.h inclusion (for musl compatibility)
> +MIME-Version: 1.0
> +Content-Type: text/plain; charset=UTF-8
> +Content-Transfer-Encoding: 8bit
> +
> +The wordsize.h header file and the __WORDSIZE definition do not seem
> +to be universal, the musl libc for instance has the definition in a
> +different header file. This breaks compilation of kvmtool against musl.
> +
> +The two leading underscores suggest a compiler-internal symbol anyway, so
> +let's just remove that particular macro usage entirely, and replace it
> +with the number we really want: the size of a "long" type.
> +
> +Reported-by: J. Neusch�fer <j.neuschaefer@gmx.net>
> +Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> +Reviewed-by: Alexandru Elisei <alexandru.elisei@arm.com>
> +Link: https://lore.kernel.org/r/20240801111054.818765-1-andre.przywara@arm.com
> +Signed-off-by: Will Deacon <will@kernel.org>
> +Upstream-Status: Backport [https://git.kernel.org/pub/scm/linux/kernel/git/will/kvmtool.git/commit/?id=0592f8f829c843ff5cb2d108c309e32f4f6f5379]
> +---
> + include/linux/bitops.h | 6 ++----
> + 1 file changed, 2 insertions(+), 4 deletions(-)
> +
> +diff --git a/include/linux/bitops.h b/include/linux/bitops.h
> +index ae33922..ee8fd56 100644
> +--- a/include/linux/bitops.h
> ++++ b/include/linux/bitops.h
> +@@ -1,15 +1,13 @@
> + #ifndef _KVM_LINUX_BITOPS_H_
> + #define _KVM_LINUX_BITOPS_H_
> + 
> +-#include <bits/wordsize.h>
> +-
> + #include <linux/kernel.h>
> + #include <linux/compiler.h>
> + #include <asm/hweight.h>
> + 
> +-#define BITS_PER_LONG __WORDSIZE
> + #define BITS_PER_BYTE           8
> +-#define BITS_TO_LONGS(nr)       DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long))
> ++#define BITS_PER_LONG           (BITS_PER_BYTE * sizeof(long))
> ++#define BITS_TO_LONGS(nr)       DIV_ROUND_UP(nr, BITS_PER_LONG)
> + 
> + #define BIT_WORD(nr)		((nr) / BITS_PER_LONG)
> + 
> +-- 
> +2.47.2
> +
> diff --git a/recipes-extended/kvmtool/kvmtool_git.bb b/recipes-extended/kvmtool/kvmtool_git.bb
> index 141fb02d..a171129f 100644
> --- a/recipes-extended/kvmtool/kvmtool_git.bb
> +++ b/recipes-extended/kvmtool/kvmtool_git.bb
> @@ -14,6 +14,7 @@ SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/will/kvmtool.git;branch
>             file://0001-kvmtool-9p-fixed-compilation-error.patch \
>             file://0002-kvmtool-add-EXTRA_CFLAGS-variable.patch \
>             file://0003-kvmtool-Werror-disabled.patch \
> +           file://0004-remove-wordsize.h-inclusion-for-musl-compatibility.patch \
>             "
>  
>  SRCREV = "4d2c017f41533b0e51e00f689050c26190a15318"
> -- 
> 2.47.2
> 

> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#9459): https://lists.yoctoproject.org/g/meta-virtualization/message/9459
> Mute This Topic: https://lists.yoctoproject.org/mt/116482849/1050810
> Group Owner: meta-virtualization+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/meta-virtualization/unsub [bruce.ashfield@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
> 



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

end of thread, other threads:[~2025-12-02  5:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-26  8:50 [PATCH] kvmtool: Backport patch for musl compatibility jaeyoon.jung
2025-12-02  5:02 ` [meta-virtualization] " Bruce Ashfield

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.