On Sun Aug 2, 2026 at 5:10 AM CEST, Babanpreet Singh wrote:
> 0002-linux-user-Replace-use-of-lfs64-related-functions-an.patch removes the
> TARGET_F_GETLK64, TARGET_F_SETLK64 and TARGET_F_SETLKW64 cases from
> target_to_host_fcntl_cmd(), along with the struct target_flock64
> conversions. Those are guest ABI, not host libc spellings, so every 32-bit
> guest calling fcntl64() to lock a file now gets -TARGET_EINVAL; under
> qemu-arm SQLite reports "disk I/O error".
>
> Backport ac1bbe8ca46c ("linux-user/syscall.c: drop 64 suffix from flock64
> &Co", 9.2.0), which makes the same musl-driven change without dropping the
> guest side, and remove the hunks it supersedes from the local patch.
>
> [YOCTO #16326]
>
> AI-Generated: Uses Claude (claude-opus-5)
> Signed-off-by: Babanpreet Singh <[email protected]>
> ---
> Only scarthgap is affected. master and wrynose carry qemu 11.0.3 and 10.2.0
> respectively, both of which contain ac1bbe8ca46c, and neither still carries
> 0002-linux-user-Replace-use-of-lfs64-related-functions-an.patch, so there is
> no master commit to backport from and nothing to send there first.
>
> Verified by building qemu 8.2.7 with the current and proposed patch stacks
> and running a 32-bit ARM test program under each resulting qemu-arm:
> F_SETLK64, F_GETLK64, F_SETLKW64 and a lock at a 5 GiB offset all return
> EINVAL before the change and succeed after it, with plain 32-bit F_SETLK
> unaffected either way. bitbake qemu-native also builds clean on scarthgap
> with the new stack.
>
>  meta/recipes-devtools/qemu/qemu.inc           |   1 +
>  ...all.c-drop-64-suffix-from-flock64-Co.patch | 225 +++++++++++++++
>  ...ce-use-of-lfs64-related-functions-an.patch | 265 +-----------------
>  3 files changed, 228 insertions(+), 263 deletions(-)
>  create mode 100644 
> meta/recipes-devtools/qemu/qemu/0001-linux-user-syscall.c-drop-64-suffix-from-flock64-Co.patch
>
> diff --git a/meta/recipes-devtools/qemu/qemu.inc 
> b/meta/recipes-devtools/qemu/qemu.inc
> index 46cc7cb5cb0..91fd6df3e12 100644
> --- a/meta/recipes-devtools/qemu/qemu.inc
> +++ b/meta/recipes-devtools/qemu/qemu.inc
> @@ -30,6 +30,7 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \
>             
> file://0008-tests-meson.build-use-relative-path-to-refer-to-file.patch \
>             
> file://0009-Define-MAP_SYNC-and-MAP_SHARED_VALIDATE-on-needed-li.patch \
>             
> file://0010-hw-pvrdma-Protect-against-buggy-or-malicious-guest-d.patch \
> +           
> file://0001-linux-user-syscall.c-drop-64-suffix-from-flock64-Co.patch \
>             
> file://0002-linux-user-Replace-use-of-lfs64-related-functions-an.patch \
>             file://fixedmeson.patch \
>             file://no-pip.patch \
> diff --git 
> a/meta/recipes-devtools/qemu/qemu/0001-linux-user-syscall.c-drop-64-suffix-from-flock64-Co.patch
>  
> b/meta/recipes-devtools/qemu/qemu/0001-linux-user-syscall.c-drop-64-suffix-from-flock64-Co.patch
> new file mode 100644
> index 00000000000..6ebe2b895db
> --- /dev/null
> +++ 
> b/meta/recipes-devtools/qemu/qemu/0001-linux-user-syscall.c-drop-64-suffix-from-flock64-Co.patch
> @@ -0,0 +1,225 @@
> +From ac1bbe8ca46c550b3ad99c85744119a3ace7b4f4 Mon Sep 17 00:00:00 2001
> +From: Michael Tokarev <[email protected]>
> +Date: Thu, 29 Aug 2024 09:39:50 +0300
> +Subject: [PATCH] linux-user/syscall.c: drop 64 suffix from flock64 &Co
> +
> +Since we are always building with LFS enabled, in particular
> +with -D_FILE_OFFSET_BITS=64, we should always have struct flock
> +mapped to the 64bit variant (with off64_t), and F_GETLK mapped
> +to F_GETLK64 etc, automatically.
> +
> +So there should be no need to explicitly use the "64" suffix
> +for these things anymore.
> +
> +Also fix a misleading comment near safe_fcntl telling us to
> +always use flock64 (since v2.6.0-1311-g435da5e7092a "linux-user:
> +Use safe_syscall wrapper for fcntl").
> +
> +Reference: https://gitlab.com/qemu-project/qemu/-/issues/2215
> +Signed-off-by: Michael Tokarev <[email protected]>
> +Reviewed-by: Richard Henderson <[email protected]>
> +
> +Upstream-Status: Backport 
> [https://gitlab.com/qemu-project/qemu/-/commit/ac1bbe8ca46c550b3ad99c85744119a3ace7b4f4]
> +---
> + linux-user/syscall.c | 92 
> ++++++++++++++++++++--------------------------------
> + 1 file changed, 40 insertions(+), 52 deletions(-)
> +
> [...]
> + 
> diff --git 
> a/meta/recipes-devtools/qemu/qemu/0002-linux-user-Replace-use-of-lfs64-related-functions-an.patch
>  
> b/meta/recipes-devtools/qemu/qemu/0002-linux-user-Replace-use-of-lfs64-related-functions-an.patch
> index ceae67be644..b10a76090b8 100644
> --- 
> a/meta/recipes-devtools/qemu/qemu/0002-linux-user-Replace-use-of-lfs64-related-functions-an.patch
> +++ 
> b/meta/recipes-devtools/qemu/qemu/0002-linux-user-Replace-use-of-lfs64-related-functions-an.patch
> @@ -13,234 +13,13 @@ Upstream-Status: Submitted 
> [https://lists.gnu.org/archive/html/qemu-devel/2022-1
> [...]

Hello,

I'm sorry but something look not right to me here.

I don't understand how you can modify a 0002 by backporting 0001... Was
Khem patch reverted? In that case, I think we better remove it and re-do
the backport with non-reverted patches.

Also, Khem's patch is merged now, can you fix the Upstream-status if we
end up keeping it?

Thanks!
-- 
Yoann Congal
Smile ECS
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#244733): 
https://lists.openembedded.org/g/openembedded-core/message/244733
Mute This Topic: https://lists.openembedded.org/mt/120559057/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to