From patchwork Sat Dec 6 17:25:51 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Dubois-Briand X-Patchwork-Id: 75978 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id BB705D3B7D1 for ; Sat, 6 Dec 2025 17:26:22 +0000 (UTC) Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.11356.1765041978137901991 for ; Sat, 06 Dec 2025 09:26:19 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@bootlin.com header.s=dkim header.b=n3Zqwi4l; spf=pass (domain: bootlin.com, ip: 185.171.202.116, mailfrom: mathieu.dubois-briand@bootlin.com) Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id ECB15C19665 for ; Sat, 6 Dec 2025 17:25:52 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 7A3CF606AC; Sat, 6 Dec 2025 17:26:16 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id B37AC102F1D00; Sat, 6 Dec 2025 18:26:15 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1765041976; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=yjjvwRq2Q37kwkcom1WS5vmct1YrnUvXxWg7OxROgPc=; b=n3Zqwi4loXr1OhjEc+qG/IfKZZ+rIAf7darMa12sJLSPBYT2pexuE3UOQAL31sVxA3UbDe /GOsv43u2IYYgR8Bt4bhO3w7URLOJW0eVNOuPVTYbsxuMlHlAs3FIwUl475+ES0HNr55gi MHK35BRVl73TCWETNHsK/fpwc3AyczvL+XHtwBIskhYcv35BAj694si8pLxG2JtqnoyDm+ fyQq7qqxKjsCCNgvZOMxHi1sxtz0Usu2LUkXECIC5g2qqpPaMVeFKCBCBWvxPCtUct/cgo NBvpTJj6k3NAwEgpj5Cs9rWj+d119Nn+NS2oe3+iJalACv1yI63d2p7hVCZW9Q== From: Mathieu Dubois-Briand Date: Sat, 06 Dec 2025 18:25:51 +0100 Subject: [PATCH 1/2] qemu: upgrade 10.0.6 -> 10.0.7 MIME-Version: 1.0 Message-Id: <20251206-mathieu-qemu-image-sizes-v1-1-144f17f417a3@bootlin.com> References: <20251206-mathieu-qemu-image-sizes-v1-0-144f17f417a3@bootlin.com> In-Reply-To: <20251206-mathieu-qemu-image-sizes-v1-0-144f17f417a3@bootlin.com> To: openembedded-core@lists.openembedded.org Cc: Thomas Petazzoni , Jon Mason , Mathieu Dubois-Briand X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1765041973; l=1972; i=mathieu.dubois-briand@bootlin.com; s=20241219; h=from:subject:message-id; bh=QglmrWgGDhGAkDJwrsZHo9FrhYsV7DZmsv53Nzh/XUA=; b=k/pHIs4DVDB2Fb9mvizgCEWdMLDzWWqSzDtgsunHdb6PUEF/eONc11G4sKagJgfOzDA2N5jeH bOkRk7RkP+tDxb4U2NJYER/jgY+wZRMy7m3dFrV4uZEtcf8nGf1Pg3/ X-Developer-Key: i=mathieu.dubois-briand@bootlin.com; a=ed25519; pk=1PVTmzPXfKvDwcPUzG0aqdGoKZJA3b9s+3DqRlm0Lww= X-Last-TLS-Session-Version: TLSv1.3 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Sat, 06 Dec 2025 17:26:22 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/227368 Signed-off-by: Mathieu Dubois-Briand --- .../qemu/{qemu-native_10.0.6.bb => qemu-native_10.0.7.bb} | 0 .../qemu/{qemu-system-native_10.0.6.bb => qemu-system-native_10.0.7.bb} | 0 meta/recipes-devtools/qemu/qemu.inc | 2 +- meta/recipes-devtools/qemu/{qemu_10.0.6.bb => qemu_10.0.7.bb} | 0 4 files changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/recipes-devtools/qemu/qemu-native_10.0.6.bb b/meta/recipes-devtools/qemu/qemu-native_10.0.7.bb similarity index 100% rename from meta/recipes-devtools/qemu/qemu-native_10.0.6.bb rename to meta/recipes-devtools/qemu/qemu-native_10.0.7.bb diff --git a/meta/recipes-devtools/qemu/qemu-system-native_10.0.6.bb b/meta/recipes-devtools/qemu/qemu-system-native_10.0.7.bb similarity index 100% rename from meta/recipes-devtools/qemu/qemu-system-native_10.0.6.bb rename to meta/recipes-devtools/qemu/qemu-system-native_10.0.7.bb diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc index 3ed5dcc671ad..e02ebd656751 100644 --- a/meta/recipes-devtools/qemu/qemu.inc +++ b/meta/recipes-devtools/qemu/qemu.inc @@ -38,7 +38,7 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \ UPSTREAM_CHECK_URI = "https://www.qemu.org" UPSTREAM_CHECK_REGEX = "qemu-(?P\d+(\.\d+)+)\.tar" -SRC_URI[sha256sum] = "c7c40c4b166871e775804e97fce4da65665d1cc93a5c6c9e2ede9d9ee992e7a0" +SRC_URI[sha256sum] = "faeea5d45a4d9bdde60716814eafadac4286f8a03ce757be632671e0eaa4ce0b" CVE_STATUS[CVE-2007-0998] = "not-applicable-config: The VNC server can expose host files uder some circumstances. We don't enable it by default." diff --git a/meta/recipes-devtools/qemu/qemu_10.0.6.bb b/meta/recipes-devtools/qemu/qemu_10.0.7.bb similarity index 100% rename from meta/recipes-devtools/qemu/qemu_10.0.6.bb rename to meta/recipes-devtools/qemu/qemu_10.0.7.bb From patchwork Sat Dec 6 17:25:52 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mathieu Dubois-Briand X-Patchwork-Id: 75977 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id B4C1DD3B7DA for ; Sat, 6 Dec 2025 17:26:22 +0000 (UTC) Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.11348.1765041979573737187 for ; Sat, 06 Dec 2025 09:26:20 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@bootlin.com header.s=dkim header.b=vsGlw7UJ; spf=pass (domain: bootlin.com, ip: 185.246.84.56, mailfrom: mathieu.dubois-briand@bootlin.com) Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 6D8C81A1FC0 for ; Sat, 6 Dec 2025 17:26:17 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 39C09606AC; Sat, 6 Dec 2025 17:26:17 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 75C23102F2205; Sat, 6 Dec 2025 18:26:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1765041976; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=d3HX2OBq4jdgaG5hRh7PtbCvSC7JVO56d9RCxlnz7TY=; b=vsGlw7UJN9nXhQDWQifb59cYonU4/3JnOL59JU3jEwQTsVeCRCAOGdSvGMm+ULT85c5ITa lNmI6pyOeTQJY6JMORDZtzHR/4hybLT4Dgt5Q4V1bJDKJwqIgloGYJwMgRcrDvNziFxH+j dhrNllXfUVLwI6mgu4IRQm6ya37TLD6+wKiLs9OxyA/riQ49x/3WhKzKTHaCoJFBXC32jS cBMXcCVQHIV8D4j/MiRAPXP0xTk/P+gpWbGprvbGXR8mz9lrHOCJXJG+3h4/lSUA3edwag on3JmPrCmpmwOrz3HsceszMpPUlP8Yh2BpmKwDdOrOaQIXrdYpNtsi+66KQsWQ== From: Mathieu Dubois-Briand Date: Sat, 06 Dec 2025 18:25:52 +0100 Subject: [PATCH 2/2] qemu: backport block image size check fix MIME-Version: 1.0 Message-Id: <20251206-mathieu-qemu-image-sizes-v1-2-144f17f417a3@bootlin.com> References: <20251206-mathieu-qemu-image-sizes-v1-0-144f17f417a3@bootlin.com> In-Reply-To: <20251206-mathieu-qemu-image-sizes-v1-0-144f17f417a3@bootlin.com> To: openembedded-core@lists.openembedded.org Cc: Thomas Petazzoni , Jon Mason , Mathieu Dubois-Briand X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1765041973; l=7010; i=mathieu.dubois-briand@bootlin.com; s=20241219; h=from:subject:message-id; bh=px8l1ZHYFeThRWHSBpuXp/j8aczrmpfaUxtD0RHY/5s=; b=Q6YQayVt4PxvkIiMmR91sfNdp1YhaTLKmRsMRlWIkvXZtvH9jMd9SLdvSe41cHJKJoY5cP9ZY Q79gefkp4rEB/FJMgZf7k7Ei4BvEq9rqyEuW6PRVwU5a29vB3nx/B6x X-Developer-Key: i=mathieu.dubois-briand@bootlin.com; a=ed25519; pk=1PVTmzPXfKvDwcPUzG0aqdGoKZJA3b9s+3DqRlm0Lww= X-Last-TLS-Session-Version: TLSv1.3 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Sat, 06 Dec 2025 17:26:22 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/227369 Backport qemu patch relaxing size requirements on sdcard sizes, allowing to use sizes that are not powers of 2, as long as they are above the SDSC max capacity (2GiB). Signed-off-by: Mathieu Dubois-Briand --- meta/recipes-devtools/qemu/qemu.inc | 1 + ...rd-Fix-size-check-for-backing-block-image.patch | 126 +++++++++++++++++++++ 2 files changed, 127 insertions(+) diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc index e02ebd656751..63414196fa15 100644 --- a/meta/recipes-devtools/qemu/qemu.inc +++ b/meta/recipes-devtools/qemu/qemu.inc @@ -31,6 +31,7 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \ file://0008-Define-MAP_SYNC-and-MAP_SHARED_VALIDATE-on-needed-li.patch \ file://0010-configure-lookup-meson-exutable-from-PATH.patch \ file://0011-qemu-Ensure-pip-and-the-python-venv-aren-t-used-for-.patch \ + file://0012-hw-sd-sdcard-Fix-size-check-for-backing-block-image.patch \ file://qemu-guest-agent.init \ file://qemu-guest-agent.udev \ " diff --git a/meta/recipes-devtools/qemu/qemu/0012-hw-sd-sdcard-Fix-size-check-for-backing-block-image.patch b/meta/recipes-devtools/qemu/qemu/0012-hw-sd-sdcard-Fix-size-check-for-backing-block-image.patch new file mode 100644 index 000000000000..a8e570db335a --- /dev/null +++ b/meta/recipes-devtools/qemu/qemu/0012-hw-sd-sdcard-Fix-size-check-for-backing-block-image.patch @@ -0,0 +1,126 @@ +From be0a5f477ae2c73d80ade595f28783d85e1ef3e0 Mon Sep 17 00:00:00 2001 +From: Jan Kiszka +Date: Sun, 24 Aug 2025 09:18:33 +0200 +Subject: [PATCH 10/10] hw/sd/sdcard: Fix size check for backing block image +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Alignment rules apply the the individual partitions (user, boot, later +on also RPMB) and depend both on the size of the image and the type of +the device. Up to and including 2GB, the power-of-2 rule applies to the +user data area. For larger images, multiples of 512 sectors must be used +for eMMC and multiples of 512K for SD-cards. Fix the check accordingly +and also detect if the image is too small to even hold the boot +partitions. + +Signed-off-by: Jan Kiszka +Reviewed-by: Cédric Le Goater +Reviewed-by: Philippe Mathieu-Daudé +Reviewed-by: Warner Losh +Message-ID: <591f6d8a9dc86428723cb6876df6e717cc41a70e.1762261430.git.jan.kiszka@siemens.com> +Tested-by: Cédric Le Goater +Signed-off-by: Philippe Mathieu-Daudé +Upstream-Status: Backport [https://gitlab.com/qemu-project/qemu/-/commit/a362b19a39e458256cc7e3acd0dc7825b0389b48] +Signed-off-by: Mathieu Dubois-Briand +--- + hw/sd/sd.c | 67 ++++++++++++++++++++++++++++++++++++++---------------- + 1 file changed, 47 insertions(+), 20 deletions(-) + +diff --git a/hw/sd/sd.c b/hw/sd/sd.c +index e541c57f8c3c..db86849b8512 100644 +--- a/hw/sd/sd.c ++++ b/hw/sd/sd.c +@@ -2675,9 +2675,32 @@ static void sd_instance_finalize(Object *obj) + timer_free(sd->ocr_power_timer); + } + ++static void sd_blk_size_error(SDState *sd, int64_t blk_size, ++ int64_t blk_size_aligned, const char *rule, ++ Error **errp) ++{ ++ const char *dev_type = sd_is_emmc(sd) ? "eMMC" : "SD card"; ++ char *blk_size_str; ++ ++ blk_size_str = size_to_str(blk_size); ++ error_setg(errp, "Invalid %s size: %s", dev_type, blk_size_str); ++ g_free(blk_size_str); ++ ++ blk_size_str = size_to_str(blk_size_aligned); ++ error_append_hint(errp, ++ "%s size has to be %s, e.g. %s.\n" ++ "You can resize disk images with" ++ " 'qemu-img resize '\n" ++ "(note that this will lose data if you make the" ++ " image smaller than it currently is).\n", ++ dev_type, rule, blk_size_str); ++ g_free(blk_size_str); ++} ++ + static void sd_realize(DeviceState *dev, Error **errp) + { + SDState *sd = SDMMC_COMMON(dev); ++ int64_t blk_size = -ENOMEDIUM; + int ret; + + switch (sd->spec_version) { +@@ -2690,32 +2713,36 @@ static void sd_realize(DeviceState *dev, Error **errp) + } + + if (sd->blk) { +- int64_t blk_size; +- + if (!blk_supports_write_perm(sd->blk)) { + error_setg(errp, "Cannot use read-only drive as SD card"); + return; + } + + blk_size = blk_getlength(sd->blk); +- if (blk_size > 0 && !is_power_of_2(blk_size)) { +- int64_t blk_size_aligned = pow2ceil(blk_size); +- char *blk_size_str; +- +- blk_size_str = size_to_str(blk_size); +- error_setg(errp, "Invalid SD card size: %s", blk_size_str); +- g_free(blk_size_str); +- +- blk_size_str = size_to_str(blk_size_aligned); +- error_append_hint(errp, +- "SD card size has to be a power of 2, e.g. %s.\n" +- "You can resize disk images with" +- " 'qemu-img resize '\n" +- "(note that this will lose data if you make the" +- " image smaller than it currently is).\n", +- blk_size_str); +- g_free(blk_size_str); +- ++ } ++ if (blk_size >= 0) { ++ blk_size -= sd->boot_part_size * 2; ++ if (blk_size > SDSC_MAX_CAPACITY) { ++ if (sd_is_emmc(sd) && ++ !QEMU_IS_ALIGNED(blk_size, 1 << HWBLOCK_SHIFT)) { ++ int64_t blk_size_aligned = ++ ((blk_size >> HWBLOCK_SHIFT) + 1) << HWBLOCK_SHIFT; ++ sd_blk_size_error(sd, blk_size, blk_size_aligned, ++ "multiples of 512", errp); ++ return; ++ } else if (!sd_is_emmc(sd) && ++ !QEMU_IS_ALIGNED(blk_size, 512 * KiB)) { ++ int64_t blk_size_aligned = ((blk_size >> 19) + 1) << 19; ++ sd_blk_size_error(sd, blk_size, blk_size_aligned, ++ "multiples of 512K", errp); ++ return; ++ } ++ } else if (blk_size > 0 && !is_power_of_2(blk_size)) { ++ sd_blk_size_error(sd, blk_size, pow2ceil(blk_size), "a power of 2", ++ errp); ++ return; ++ } else if (blk_size < 0) { ++ error_setg(errp, "eMMC image smaller than boot partitions"); + return; + } + +-- +2.47.3 +