From 069d2dfd86e8ba6cc6bcf21d908d87319ac1fcde Mon Sep 17 00:00:00 2001 From: Mark Hatle Date: Thu, 25 Jan 2024 15:03:54 -0600 Subject: qemu: Allow native and nativesdk versions on Linux older then 4.17 Linux kernel 4.17 introduced two new mmap flags, MAP_FIXED_NOREPLACE and MAP_SHARED_VALIDATE. Starting with QEMU 8.1, these flags are now used and required for proper system operation. In order to build and run on a system older then 4.17, we need to emulate this new behavior. Not having a newer kernel could result in the mmap memory being allocated in a way that will cause failures without QEMU checking for these conditions. Note, memory allocation issues are rare in my experience so this is more of a 'just-in-case' behavior. SDK_OLDEST_KERNEL is currently set to 3.2.0, the only way this can claim that qemu works in an SDK is by checking the return values to emulate the expected behavior. (From OE-Core rev: 4eb0a83c7851e2eb6d7890a130dfe50f37ff8ac9) Signed-off-by: Mark Hatle Signed-off-by: Mark Hatle Signed-off-by: Alexandre Belloni Signed-off-by: Richard Purdie --- meta/recipes-devtools/qemu/qemu.inc | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'meta/recipes-devtools/qemu/qemu.inc') diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc index bc6ce0bb38..14b975db30 100644 --- a/meta/recipes-devtools/qemu/qemu.inc +++ b/meta/recipes-devtools/qemu/qemu.inc @@ -40,6 +40,18 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \ " UPSTREAM_CHECK_REGEX = "qemu-(?P\d+(\.\d+)+)\.tar" +# SDK_OLDEST_KERNEL is set below 4.17, which is the minimum version required by QEMU >= 8.1 +# This is due to two MMAP flags being used at certain points +SRC_URI:append:class-nativesdk = " \ + file://0011-linux-user-workaround-for-missing-MAP_FIXED_NOREPLAC.patch \ + file://0012-linux-user-workaround-for-missing-MAP_SHARED_VALIDAT.patch \ + " + +# Support building and using native version on pre 4.17 kernels +SRC_URI:append:class-native = " \ + file://0011-linux-user-workaround-for-missing-MAP_FIXED_NOREPLAC.patch \ + file://0012-linux-user-workaround-for-missing-MAP_SHARED_VALIDAT.patch \ + " SRC_URI[sha256sum] = "bf00d2fa12010df8b0ade93371def58e632cb32a6bfdc5f5a0ff8e6a1fb1bf32" -- cgit v1.2.3-54-g00ecf