From patchwork Sun Feb 8 21:44:02 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1808 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1770587077; bh=KSLQPbOVQaM11c93kss39FfDpKCiI31Tel8coxGZjus=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=Y/KagrACtRIqtf5IlOrcbgh44AvVClqTBu7thR3IHB5XW4+X9Og1VIValOTNH+KBg RGsQYPuDdxOfGxT8iaiEdIYKseriKWwx0zYtl544/KrYxDj6JZsHFCQGj64q4I5dWP tv2rTCW2D1nEqLW4m41MX6ccvpI97vxsDiodITCDoJirrNM2KExEgAk3/p8deO8/pr e7E0clCMPH0UbL+Y3gY0+uNjN3saDexiyjOoYnf0dH0Om23WfqlCAAwAbWRzHb8651 WahVn+zetlp2okZnbq8qwDN4ZHDbPHrE60Jx/7+p53GdgA5S5HyM+fxHM9LDi4rQHI lCgnw+a86rcKg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C14D9699EA for ; Sun, 8 Feb 2026 14:44:37 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id HXZlckzyS7-X for ; Sun, 8 Feb 2026 14:44:37 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1770587077; bh=KSLQPbOVQaM11c93kss39FfDpKCiI31Tel8coxGZjus=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=Y/KagrACtRIqtf5IlOrcbgh44AvVClqTBu7thR3IHB5XW4+X9Og1VIValOTNH+KBg RGsQYPuDdxOfGxT8iaiEdIYKseriKWwx0zYtl544/KrYxDj6JZsHFCQGj64q4I5dWP tv2rTCW2D1nEqLW4m41MX6ccvpI97vxsDiodITCDoJirrNM2KExEgAk3/p8deO8/pr e7E0clCMPH0UbL+Y3gY0+uNjN3saDexiyjOoYnf0dH0Om23WfqlCAAwAbWRzHb8651 WahVn+zetlp2okZnbq8qwDN4ZHDbPHrE60Jx/7+p53GdgA5S5HyM+fxHM9LDi4rQHI lCgnw+a86rcKg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B0B0B699E6 for ; Sun, 8 Feb 2026 14:44:37 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1770587074; bh=Dfg16F7G7Br+MQgsqxlxiStkMMvny5SpPQgmHGu7Mlw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V+nb+P7BxrK7g5R7YA8KNe/Hacb6mShGiG+pIUrQ38Er2oz45stV87W6kolkYPQz7 DKM50tjzHk/jij6eS+biycWJuWsHgBJe/RtobdOgil7wMB6YPIEqWoqAUCc0EnFASj 3prhRsXU0+Br5ddwG7N0ysv+J4JM8kZGk81jGOboEKsHC/JnMD4DSLHJ0JrOg/i4RX t+sDCx3QwJ1+ChuRGgmAqXbce34BRzOQyiOX6qzZ4PbRwS85VqyPeX9IYlzUIyaBqi twbjeYxqpTNIjhJn7d+2gzxZ9UvkS1lkoqqpT/yKysfHGC+XApYI5QsZ5xp6c12H6f dbd66FDI3BfOw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A6682699DC; Sun, 8 Feb 2026 14:44:34 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id 2MV2E_CUdbSD; Sun, 8 Feb 2026 14:44:34 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1770587070; bh=BzsqMVdHYGhGaTqgNfqkAPya+sI6gulJNw9I0xCsiEk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Upk5qPT/D7y9+g6C+mRujGNs4o7Dmw0v9+qcpq0VNeq7JQWZJPwGkXeGRP29Zo/eT dtme/vgY2kWJLPMx9Yz0oNKFtbQumn3a3wJK6vFHf7w0qfmHIJBmG/52zg8PJzdpJs I8+Wd3VuFmHD+HehYm2g1eBfSPJR+yAermH776PkbDhwJ5ZWNFh0T3OFsO41rkocvE au89dkL+6mKDNp8xODg5OLdbLQy7reZ7+3wr/lbDC75DBWUoqOv4cIEOPAC9mjx1d2 bDHn1a6GXgUTD0VmMjn6+EiZnzf2zROfhaU77vJ8axd0VOYFi6h805M+BAk6YU+T0u /IcXY9fKTbZkA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 55CD669970; Sun, 8 Feb 2026 14:44:30 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 8 Feb 2026 14:44:02 -0700 Message-ID: <20260208214411.3445278-2-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260208214411.3445278-1-sjg@u-boot.org> References: <20260208214411.3445278-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: X3WJBN7GAISYTKU326ZA63652ZB4FFEZ X-Message-ID-Hash: X3WJBN7GAISYTKU326ZA63652ZB4FFEZ X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 1/4] video: truetype: Fix uninitialised bbox on empty text List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass When truetype_measure() is called with empty text, it returns early without initialising the bbox fields. This causes scene_obj_get_hw() to return garbage values (uninitialised stack memory) for the height, leading to intermittent test failures. Initialise all bbox fields to 0 before the early return when text is empty. Fixes: adf54041976c ("console: Allow measuring the bounding box of text") Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- drivers/video/console_truetype.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/video/console_truetype.c b/drivers/video/console_truetype.c index 913ed4208e4..8ca0308942b 100644 --- a/drivers/video/console_truetype.c +++ b/drivers/video/console_truetype.c @@ -1021,8 +1021,13 @@ static int truetype_measure(struct udevice *dev, const char *name, uint size, return log_msg_ret("sel", ret); bbox->valid = false; - if (!*text) + if (!*text) { + bbox->x0 = 0; + bbox->y0 = 0; + bbox->x1 = 0; + bbox->y1 = 0; return 0; + } limit = -1; if (pixel_limit != -1) From patchwork Sun Feb 8 21:44:03 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1809 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1770587082; bh=GjO9urzTUVzmWK63vDlhZtq3lSBmgicxv4m5FgQfMNA=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=hHMyfQp5vwEdMDRNJjx+YN4FLZD/jXvfChODpf1xbvShYRWBQT4Mx6/gsnm+I7PpL 21uABIw1qE9SDsTwkVlirGENNNgqJPj6WePZMcUVF5g/M1RieuJZHy5G84SeyfPVTE pKN7q/VmdS1c7NZUCjCJ7ZbbWdA91CRCuVScme/2m2tKGTs/M5N2v9CsbffrL99bk4 QGdMqgBstnjzu66+/OtXgL/IZmeqpJQT5tILri3suH5dY4iW/fd/hLH/FaBQ+n8oLW tgYVhznx+X8pEMcbo6PwV53hCINpbksrXJYGbiMbIv2qmWe+hetzItw8XvyQlJypvo dBoni7LiGYvtw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3C871699EA for ; Sun, 8 Feb 2026 14:44:42 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id zdrXfYX_AOy9 for ; Sun, 8 Feb 2026 14:44:42 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1770587082; bh=GjO9urzTUVzmWK63vDlhZtq3lSBmgicxv4m5FgQfMNA=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=hHMyfQp5vwEdMDRNJjx+YN4FLZD/jXvfChODpf1xbvShYRWBQT4Mx6/gsnm+I7PpL 21uABIw1qE9SDsTwkVlirGENNNgqJPj6WePZMcUVF5g/M1RieuJZHy5G84SeyfPVTE pKN7q/VmdS1c7NZUCjCJ7ZbbWdA91CRCuVScme/2m2tKGTs/M5N2v9CsbffrL99bk4 QGdMqgBstnjzu66+/OtXgL/IZmeqpJQT5tILri3suH5dY4iW/fd/hLH/FaBQ+n8oLW tgYVhznx+X8pEMcbo6PwV53hCINpbksrXJYGbiMbIv2qmWe+hetzItw8XvyQlJypvo dBoni7LiGYvtw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 2B897699E6 for ; Sun, 8 Feb 2026 14:44:42 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1770587080; bh=nQVx+mNLXs09DxsDMrRsP3LVY1RYPknSdNpBSwuyW10=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M3TuyqSiz3X1EHUMrne2tJfCAn4iBLrakO5uJ+bbs7gThNpf4HJ+ilzfCAwl/l7hC VP7F3G8BO2Lcii/uDIa4XpbE/AoI3ud4++Y9voye1dfHaWcFXoo3p9TelwseO8V58e MocdzuhHSWxvUpvYraa+pauml9LV+kAWkt0n4QjwngQT8Sxr6SJHo4zZOiT/Gl8t2W Cn86GQwFmMnsgfvUckvnKQzpHgcEn3UmOwIl3czTOs/DNvBpL9TYLRnOyQQ2wExTjq /FjfQJNAsUSpRI0a6c+HzEA7U3kJPyTwry1iMLUOZ7rAMHWlCm5d2xrdudjN6VK8XI hN1I+/OO8qy0A== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 30792699E6; Sun, 8 Feb 2026 14:44:40 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id RCEp4TQjrLDO; Sun, 8 Feb 2026 14:44:40 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1770587075; bh=yy2qJ9IK+TmETNYwr/NLcS6toVo54YjZ2gnFhHtXutw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MbkXVUVqsNrRPDu2QyNJ4zPA8fqGA4nyUPmk8382jlOyi16zySooyIfM7K7N7Jnim kr9/l9sM0SA8KZJsLLp5gyWzlHgd8GW+mXpnqze6WSOEHki4nEhGqalLyupm4Z6BO4 qjXFgRQ61H1vV0Fg+R1UsN0LkgMwavx/n7sc2CMh4dO3oXVYeeQb4rvgewFeh5uIw0 nLuwzx1QXMhzK69LO14ghxhiXYNbeLs7gHD9z3B9oCutbJShT6gsstB0QwH0pA5IMC 0H4G+/lczrF+t2O71w5YNcBBwwCAHmtNyJnF8yZnpwsCOtVBu4fXgS8rCOm0mqfynp 2p1jCry/QCmtw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 28F6C69970; Sun, 8 Feb 2026 14:44:35 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 8 Feb 2026 14:44:03 -0700 Message-ID: <20260208214411.3445278-3-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260208214411.3445278-1-sjg@u-boot.org> References: <20260208214411.3445278-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: I6LDCTU6WQL7MUG2VBWR54AVDYPNTAT4 X-Message-ID-Hash: I6LDCTU6WQL7MUG2VBWR54AVDYPNTAT4 X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 2/4] hooks: Add malta for ellesmere List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Add a symlink so that tests can run on malta on ellesmere Signed-off-by: Simon Glass --- test/hooks/bin/ellesmere/conf.malta_qemu | 1 + 1 file changed, 1 insertion(+) create mode 120000 test/hooks/bin/ellesmere/conf.malta_qemu diff --git a/test/hooks/bin/ellesmere/conf.malta_qemu b/test/hooks/bin/ellesmere/conf.malta_qemu new file mode 120000 index 00000000000..ded626f8191 --- /dev/null +++ b/test/hooks/bin/ellesmere/conf.malta_qemu @@ -0,0 +1 @@ +../travis-ci/conf.malta_qemu \ No newline at end of file From patchwork Sun Feb 8 21:44:04 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1810 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1770587086; bh=ZK0ps4jLu29huA9dLsQyYt70Kehd61V+oRLPA/Hb4gE=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=Mhqjlpy6BLg4PI/Uze7SWlEN53oR5n9eD0urDuDrDdxLvf84lX2qwfXsu7J+WKbLe WDCyusFG8Mnzj5ifE1TAZ8tWsBGNo3yaAyvnUUgkvPc0tO+vHkdzhgk2oYFmTJ4QY1 iuxF9Bnc4uL6P1LLt/+ig6QslRKTmnGLOHp1b87M1hihNgUnMT1xXRRN5cB0glQUdD DVSIig7UqZSwXGwqfYzvxnx0h9BaBWt3pLr0xV+p+7jHpsvxHPqJfBwHYQG9KWbb+l UClqSWV4xoCG7KmVknC6h6+F/8D/K3+h8tFfBeiEKiUFhEkQGAQIsVnIOEMmN+u4SH iwngV2yXLJY8Q== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A579E69970 for ; Sun, 8 Feb 2026 14:44:46 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id b-O2D1IOoKUI for ; Sun, 8 Feb 2026 14:44:46 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1770587086; bh=ZK0ps4jLu29huA9dLsQyYt70Kehd61V+oRLPA/Hb4gE=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=Mhqjlpy6BLg4PI/Uze7SWlEN53oR5n9eD0urDuDrDdxLvf84lX2qwfXsu7J+WKbLe WDCyusFG8Mnzj5ifE1TAZ8tWsBGNo3yaAyvnUUgkvPc0tO+vHkdzhgk2oYFmTJ4QY1 iuxF9Bnc4uL6P1LLt/+ig6QslRKTmnGLOHp1b87M1hihNgUnMT1xXRRN5cB0glQUdD DVSIig7UqZSwXGwqfYzvxnx0h9BaBWt3pLr0xV+p+7jHpsvxHPqJfBwHYQG9KWbb+l UClqSWV4xoCG7KmVknC6h6+F/8D/K3+h8tFfBeiEKiUFhEkQGAQIsVnIOEMmN+u4SH iwngV2yXLJY8Q== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 95F67699E6 for ; Sun, 8 Feb 2026 14:44:46 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1770587084; bh=2jqsGJv0rVAyPM0XNMBOTXipXGEJyp3t8E+BXCFPsJ8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AQoQpIgL1x570nwkh5rSwk/cCFZNoer4fbYMlqy6v+PbHvwSDip9RslX4JUTqpn/f 0cUzlVirqLsmHqn69IF9ppUvIuqCxd9esaQLeZZeVLmX+sc+3BnAN1wA2Q06P9jr08 NlWjP2koajQMfFn66JBTgZJaDFnK81fbkb5JjRQzQ8cH2GVOqDl40ADvehx+rq1zOo OSugSdWifmNZGrAfqWSwP6Qsga7NzQetb8bAV2rMW37N/26Vh858Dm9T6fJ9wo0thL Un4dOJ3gg3IzXP6iBSpJq2A81o6nkBjgQH2PNRgNKXY6n5oWUfV5UpYqxMs8hbTxly 9CkqM28o9Nlvg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A25F369970; Sun, 8 Feb 2026 14:44:44 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id 7VuaHu0IjPaM; Sun, 8 Feb 2026 14:44:44 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1770587080; bh=sJA2hPoh3qKpOiEnBhlKiKAaIoNd/jxxHlcvQyru+Ng=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P6klFDl4ju1t7Di4ilv+p54TuxRasoyTB7fMxXsZ7nWLlLO7/20r4jL6sUv4s7isp SEykWPYPDMUxjsa1RLLSBPpyrPB9pIn0hvJ62NJAkRgZbMoMglN9e/FK/bE/UkTciq D+VmHh1SKpVt7/D1JcrT0QsP2sdzx8V1LtONk69LG79Mmbuee+FcvwrYMbRuDgwSJM mqzBWcOpbfI42ICQ2eUtOxYmMhLmRc/8EivQKgv3cv1J1dBxp4nPWmQUWpAZeo7TTB s/L8DwAoLbis+IWKlU93Ap0Ws/WilruDrocsliAzi8GPEn/SwKnBK4XbFiLsjPTcB5 g3xOhAVwjSuMw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id EF4555FC8F; Sun, 8 Feb 2026 14:44:39 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 8 Feb 2026 14:44:04 -0700 Message-ID: <20260208214411.3445278-4-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260208214411.3445278-1-sjg@u-boot.org> References: <20260208214411.3445278-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 3O43ZVO565BQQOEKOOFC6A2AJMGXWD4W X-Message-ID-Hash: 3O43ZVO565BQQOEKOOFC6A2AJMGXWD4W X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 6" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 3/4] pager: Add length parameter to pager_post() List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Since commit 4e2b66acdd4b ("console: Add the putsn() API for length-based string output") all puts() output goes through putsn(). When the pager is active, console_putsn_pager() cannot pass length-delimited strings to pager_post() because it only accepts nul-terminated strings. The workaround is character-by-character output, which causes a severe performance regression visible in any command that produces significant output (e.g. "dm drivers", "dm compat") when the pager is enabled. Rename pager_post() to pager_postn() with a new int len parameter, so it can accept length-delimited strings directly. Add a pager_post() inline helper for nul-terminated callers. Update console_putsn_pager() to call through the pager path directly, removing the s[len] == '\0' hack and the character-by-character fallback. Rename the internal console_puts() to console_putsn() to reflect its new length parameter. Add a test exercising a non-nul-terminated substring. Fixes: 4e2b66acdd4b ("console: Add the putsn() API for length-based string output") Co-developed-by: Claude Opus 4.6 Signed-off-by: Simon Glass --- common/console.c | 20 ++++++----------- common/pager.c | 13 +++++++---- include/pager.h | 55 ++++++++++++++++++++++++++++++++++++++++----- test/common/pager.c | 19 ++++++++++++++++ 4 files changed, 85 insertions(+), 22 deletions(-) diff --git a/common/console.c b/common/console.c index 96e8977ce06..238d464980f 100644 --- a/common/console.c +++ b/common/console.c @@ -361,11 +361,11 @@ int err_printf(bool serial_only, const char *fmt, ...) return ret; } -static void console_puts(int file, bool use_pager, const char *s) +static void console_putsn(int file, bool use_pager, const char *s, int len) { int key = 0; - for (s = pager_post(gd_pager(), use_pager, s); s; + for (s = pager_postn(gd_pager(), use_pager, s, len); s; s = pager_next(gd_pager(), use_pager, key)) { struct stdio_dev *dev; int i; @@ -384,13 +384,8 @@ static void console_puts(int file, bool use_pager, const char *s) static void console_putsn_pager(int file, const char *s, int len) { - if (IS_ENABLED(CONFIG_CONSOLE_PAGER) && gd_pager()) { - /* - * Pager only works with nul-terminated strings, so output - * character by character for length-based strings - */ - while (len--) - console_putc_pager(file, *s++); + if (IS_ENABLED(CONFIG_CONSOLE_PAGER) && pager_active(gd_pager())) { + console_putsn(file, true, s, len); } else { struct stdio_dev *dev; int i; @@ -409,11 +404,10 @@ static void console_putsn_pager(int file, const char *s, int len) static void console_puts_pager(int file, const char *s) { - if (IS_ENABLED(CONFIG_CONSOLE_PAGER) && gd_pager()) { - console_puts(file, true, s); - } else { + if (IS_ENABLED(CONFIG_CONSOLE_PAGER) && gd_pager()) + console_putsn(file, true, s, strlen(s)); + else console_putsn_pager(file, s, strlen(s)); - } } #ifdef CONFIG_CONSOLE_FLUSH_SUPPORT diff --git a/common/pager.c b/common/pager.c index 60b1adc8571..bb8ea0776bf 100644 --- a/common/pager.c +++ b/common/pager.c @@ -15,10 +15,11 @@ DECLARE_GLOBAL_DATA_PTR; -const char *pager_post(struct pager *pag, bool use_pager, const char *s) +const char *pager_postn(struct pager *pag, bool use_pager, const char *s, + int len) { struct membuf old; - int ret, len; + int ret; if (!pag || !use_pager || pag->test_bypass || pag->state == PAGERST_BYPASS) @@ -27,7 +28,6 @@ const char *pager_post(struct pager *pag, bool use_pager, const char *s) if (pag->state == PAGERST_QUIT_SUPPRESS) return NULL; - len = strlen(s); if (!len) return NULL; @@ -42,8 +42,13 @@ const char *pager_post(struct pager *pag, bool use_pager, const char *s) * can eject the overflow text. * * The buffer is presumably empty, since callers are not allowed - * to call pager_post() unless all the output from the previous + * to call pager_postn() unless all the output from the previous * call was provided via pager_next(). + * + * Note: the overflow path returns @s directly via + * pager_next(), so @s must be nul-terminated. In practice + * this only triggers when len > buf_size, and typical + * console strings are well within the 4K default buffer. */ pag->overflow = s; pag->mb = old; diff --git a/include/pager.h b/include/pager.h index 3f13f82885d..7f475787cd7 100644 --- a/include/pager.h +++ b/include/pager.h @@ -12,6 +12,7 @@ #include #include #include +#include #define PAGER_BUF_SIZE SZ_4K @@ -52,7 +53,7 @@ enum pager_state { * permit passing a string length, only a string, which means that strings must * be nul-terminated. The termination is handled automatically by the pager. * - * If the text passed to pager_post() is too large for @buf then all the next + * If the text passed to pager_postn() is too large for @buf then all the next * will be written at once, without any paging, in the next call to * pager_next(). * @@ -85,12 +86,12 @@ struct pager { #if CONFIG_IS_ENABLED(CONSOLE_PAGER) /** - * pager_post() - Add text to the input buffer for later handling + * pager_postn() - Add text to the input buffer for later handling * * If @use_pager the text is added to the pager buffer and fed out a screenful - * at a time. This function calls pager_post() after storing the text. + * at a time. This function calls pager_postn() after storing the text. * - * After calling pager_post(), if it returns anything other than NULL, you must + * After calling pager_postn(), if it returns anything other than NULL, you must * repeatedly call pager_next() until it returns NULL, otherwise text may be * lost * @@ -99,10 +100,28 @@ struct pager { * @pag: Pager to use, may be NULL * @use_pager: Whether or not to use the pager functionality * @s: Text to add + * @len: Length of @s in bytes * Return: text which should be sent to output, or NULL if there is no more. * If !@use_pager this just returns @s and does not affect the pager state */ -const char *pager_post(struct pager *pag, bool use_pager, const char *s); +const char *pager_postn(struct pager *pag, bool use_pager, const char *s, + int len); + +/** + * pager_post() - Add a nul-terminated string to the pager input buffer + * + * Convenience wrapper around pager_postn() for nul-terminated strings. + * + * @pag: Pager to use, may be NULL + * @use_pager: Whether or not to use the pager functionality + * @s: Nul-terminated text to add + * Return: text which should be sent to output, or NULL if there is no more + */ +static inline const char *pager_post(struct pager *pag, bool use_pager, + const char *s) +{ + return pager_postn(pag, use_pager, s, strlen(s)); +} /** * pager_next() - Returns the next screenful of text to show @@ -127,6 +146,21 @@ const char *pager_post(struct pager *pag, bool use_pager, const char *s); */ const char *pager_next(struct pager *pag, bool use_pager, int ch); +/** + * pager_active() - check if pager needs to process output + * + * Returns true only when the pager is genuinely active and needs to + * process output (not bypassed or in test bypass mode). + * + * @pag: Pager to check, may be NULL + * Return: true if the pager is active + */ +static inline bool pager_active(struct pager *pag) +{ + return pag && !pag->test_bypass && + pag->state != PAGERST_BYPASS; +} + /** * pager_set_bypass() - put the pager into bypass mode * @@ -181,6 +215,12 @@ void pager_clear_quit(struct pager *pag); void pager_uninit(struct pager *pag); #else +static inline const char *pager_postn(struct pager *pag, bool use_pager, + const char *s, int len) +{ + return s; +} + static inline const char *pager_post(struct pager *pag, bool use_pager, const char *s) { @@ -192,6 +232,11 @@ static inline const char *pager_next(struct pager *pag, bool use_pager, int ch) return NULL; } +static inline bool pager_active(struct pager *pag) +{ + return false; +} + static inline bool pager_set_bypass(struct pager *pag, bool bypass) { return true; diff --git a/test/common/pager.c b/test/common/pager.c index ccd5230f3a4..534096a1c4f 100644 --- a/test/common/pager.c +++ b/test/common/pager.c @@ -665,3 +665,22 @@ static int pager_test_quit_keypress(struct unit_test_state *uts) return 0; } COMMON_TEST(pager_test_quit_keypress, 0); + +/* Test pager with non-nul-terminated string using explicit length */ +static int pager_test_non_nul_terminated(struct unit_test_state *uts) +{ + struct pager *pag; + /* "Hello" followed by other data - not nul-terminated at offset 5 */ + static const char data[] = "HelloWorld"; + + ut_assertok(pager_init(&pag, 20, 1024)); + + /* Post only the first 5 bytes */ + ut_asserteq_str("Hello", pager_postn(pag, true, data, 5)); + ut_assertnull(pager_next(pag, true, 0)); + + pager_uninit(pag); + + return 0; +} +COMMON_TEST(pager_test_non_nul_terminated, 0); From patchwork Sun Feb 8 21:44:05 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1811 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1770587091; bh=lWOYZ9UmJ4FFf+HrFtLw+hNFyOiYHha6cSU+3XiWCTM=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=eXCnoYiNWlhjgtorHWs+ABwyifJnck4btifHQjUoPtSQc9h0RfEEG/0PlNOVFTjao TsfFE4lc2M1x7POnPZ53lnjrovUKFoj8X6NrBMMDUmzuEPct2PeKhDpIATxZ7pQe21 qY+Ddc7P3gaUfQGGmNszcr5f2pBXvqlMkxGnKxtRID+S5t9o59nAoCeBXvXu51b3em nQ8PzBCoDTBQ3JL3YBHT69l0tPACA4py5tIjUXnUZFS8eDWFoW6xoobd336yX42KSA uYITUBUWJ3zEf847k7WztqdP40ZLj4uKhE/b4E/3Gbssy1xsX/odrfKTHH5RGboTm8 gv2WqajBH1+Pg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 205CD699E6 for ; Sun, 8 Feb 2026 14:44:51 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id whGbMHIyN2MF for ; Sun, 8 Feb 2026 14:44:51 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1770587091; bh=lWOYZ9UmJ4FFf+HrFtLw+hNFyOiYHha6cSU+3XiWCTM=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=eXCnoYiNWlhjgtorHWs+ABwyifJnck4btifHQjUoPtSQc9h0RfEEG/0PlNOVFTjao TsfFE4lc2M1x7POnPZ53lnjrovUKFoj8X6NrBMMDUmzuEPct2PeKhDpIATxZ7pQe21 qY+Ddc7P3gaUfQGGmNszcr5f2pBXvqlMkxGnKxtRID+S5t9o59nAoCeBXvXu51b3em nQ8PzBCoDTBQ3JL3YBHT69l0tPACA4py5tIjUXnUZFS8eDWFoW6xoobd336yX42KSA uYITUBUWJ3zEf847k7WztqdP40ZLj4uKhE/b4E/3Gbssy1xsX/odrfKTHH5RGboTm8 gv2WqajBH1+Pg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0FC7D69969 for ; Sun, 8 Feb 2026 14:44:51 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1770587089; bh=6k2hxTGYqGgOinL73FF6vOS5tzpYVhWC1oBlCVicrhk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QEa1pbQBqtkfP53lOKtflEW6XFSF9JrIsICEvA7cpt8Vli6Qo19AzuT8eAQLNHmwp esUUQlTDU00F8jRaTAMLH3mOkKw8jA2I5fktvJuXtDdSarJS8qwkiEN24tfGqu078A XQsWjgFcMcdTqjj91ziR0/c0J10ra5a7V7Quma3XES2Vbh3TlAN4jedda42JQBYydO pGCweuO+r0fDsUpOBMRXARuUa8AI8zOfRCgG4E29VN1aLetKT8yPYisX7ud6eMBO1J 0suqYkdIvBgWAdObVtsVTjI60PK0kldq09Nz5DR4qleoU/1Zko5pjpPacSfendOY7Q 1E1xhT8aknFnQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 305FC69969; Sun, 8 Feb 2026 14:44:49 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id tdpYt8wGlBq6; Sun, 8 Feb 2026 14:44:49 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1770587085; bh=wBcG07Hs2TIabPzbZUV08yWSen9pMH/yzmUC+u0kuw4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dfuUcTTNMMA4KBBD089GoO6v+n3epLFwPUQI7DiTwqR4aReTYLG/dMrTpQ55xhSHG SSZ59+0Zx+bZp119PYcHPDHVtsZeVBpwouXgLDjDcbex6frFs8+IIpipWLE708iUET TSvGHXqK1BLXSDnYNRkQXRPHuuiDzko9F+O+rmvwxDJTBF7ce3iRTw056gz7GF1ejg McYCq/XllPVPvfBQJ9b5KXMLXBli00i6QFh2amiUjjKat/CXDrVjqGpPIo7jywNIQz kfvciapnzlTAe7OjNcKr3lluUq0vfTv+fIAPBOE6h66phm0NcfFWjNEZBevvWf3RQ3 yymb0cOO3/iQQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id D09495FC8F; Sun, 8 Feb 2026 14:44:44 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 8 Feb 2026 14:44:05 -0700 Message-ID: <20260208214411.3445278-5-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260208214411.3445278-1-sjg@u-boot.org> References: <20260208214411.3445278-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: S3IPWPNWJ6DGSYKE2SZEP5Y4IQMNZGFB X-Message-ID-Hash: S3IPWPNWJ6DGSYKE2SZEP5Y4IQMNZGFB X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 6" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 4/4] pager: Reserve nul-terminator byte at init time List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Currently pager_next() relies on a `buf.size - 1` limit in the membuf_getraw() call to leave room for the nul terminator it writes. This is fragile because the reservation happens at every read rather than being enforced structurally. Initialise the membuf one byte smaller than the abuf so the last byte is always available for the nul write. The getraw call can then simply request all available data, and the nul terminator always falls within the abuf. Co-developed-by: Claude Opus 4.6 --- common/console.c | 20 ++++++--- common/pager.c | 13 ++---- include/pager.h | 55 +++--------------------- test/common/pager.c | 19 -------- test/hooks/bin/ellesmere/conf.malta_qemu | 1 - 5 files changed, 22 insertions(+), 86 deletions(-) delete mode 120000 test/hooks/bin/ellesmere/conf.malta_qemu diff --git a/common/console.c b/common/console.c index 238d464980f..96e8977ce06 100644 --- a/common/console.c +++ b/common/console.c @@ -361,11 +361,11 @@ int err_printf(bool serial_only, const char *fmt, ...) return ret; } -static void console_putsn(int file, bool use_pager, const char *s, int len) +static void console_puts(int file, bool use_pager, const char *s) { int key = 0; - for (s = pager_postn(gd_pager(), use_pager, s, len); s; + for (s = pager_post(gd_pager(), use_pager, s); s; s = pager_next(gd_pager(), use_pager, key)) { struct stdio_dev *dev; int i; @@ -384,8 +384,13 @@ static void console_putsn(int file, bool use_pager, const char *s, int len) static void console_putsn_pager(int file, const char *s, int len) { - if (IS_ENABLED(CONFIG_CONSOLE_PAGER) && pager_active(gd_pager())) { - console_putsn(file, true, s, len); + if (IS_ENABLED(CONFIG_CONSOLE_PAGER) && gd_pager()) { + /* + * Pager only works with nul-terminated strings, so output + * character by character for length-based strings + */ + while (len--) + console_putc_pager(file, *s++); } else { struct stdio_dev *dev; int i; @@ -404,10 +409,11 @@ static void console_putsn_pager(int file, const char *s, int len) static void console_puts_pager(int file, const char *s) { - if (IS_ENABLED(CONFIG_CONSOLE_PAGER) && gd_pager()) - console_putsn(file, true, s, strlen(s)); - else + if (IS_ENABLED(CONFIG_CONSOLE_PAGER) && gd_pager()) { + console_puts(file, true, s); + } else { console_putsn_pager(file, s, strlen(s)); + } } #ifdef CONFIG_CONSOLE_FLUSH_SUPPORT diff --git a/common/pager.c b/common/pager.c index bb8ea0776bf..60b1adc8571 100644 --- a/common/pager.c +++ b/common/pager.c @@ -15,11 +15,10 @@ DECLARE_GLOBAL_DATA_PTR; -const char *pager_postn(struct pager *pag, bool use_pager, const char *s, - int len) +const char *pager_post(struct pager *pag, bool use_pager, const char *s) { struct membuf old; - int ret; + int ret, len; if (!pag || !use_pager || pag->test_bypass || pag->state == PAGERST_BYPASS) @@ -28,6 +27,7 @@ const char *pager_postn(struct pager *pag, bool use_pager, const char *s, if (pag->state == PAGERST_QUIT_SUPPRESS) return NULL; + len = strlen(s); if (!len) return NULL; @@ -42,13 +42,8 @@ const char *pager_postn(struct pager *pag, bool use_pager, const char *s, * can eject the overflow text. * * The buffer is presumably empty, since callers are not allowed - * to call pager_postn() unless all the output from the previous + * to call pager_post() unless all the output from the previous * call was provided via pager_next(). - * - * Note: the overflow path returns @s directly via - * pager_next(), so @s must be nul-terminated. In practice - * this only triggers when len > buf_size, and typical - * console strings are well within the 4K default buffer. */ pag->overflow = s; pag->mb = old; diff --git a/include/pager.h b/include/pager.h index 7f475787cd7..3f13f82885d 100644 --- a/include/pager.h +++ b/include/pager.h @@ -12,7 +12,6 @@ #include #include #include -#include #define PAGER_BUF_SIZE SZ_4K @@ -53,7 +52,7 @@ enum pager_state { * permit passing a string length, only a string, which means that strings must * be nul-terminated. The termination is handled automatically by the pager. * - * If the text passed to pager_postn() is too large for @buf then all the next + * If the text passed to pager_post() is too large for @buf then all the next * will be written at once, without any paging, in the next call to * pager_next(). * @@ -86,12 +85,12 @@ struct pager { #if CONFIG_IS_ENABLED(CONSOLE_PAGER) /** - * pager_postn() - Add text to the input buffer for later handling + * pager_post() - Add text to the input buffer for later handling * * If @use_pager the text is added to the pager buffer and fed out a screenful - * at a time. This function calls pager_postn() after storing the text. + * at a time. This function calls pager_post() after storing the text. * - * After calling pager_postn(), if it returns anything other than NULL, you must + * After calling pager_post(), if it returns anything other than NULL, you must * repeatedly call pager_next() until it returns NULL, otherwise text may be * lost * @@ -100,28 +99,10 @@ struct pager { * @pag: Pager to use, may be NULL * @use_pager: Whether or not to use the pager functionality * @s: Text to add - * @len: Length of @s in bytes * Return: text which should be sent to output, or NULL if there is no more. * If !@use_pager this just returns @s and does not affect the pager state */ -const char *pager_postn(struct pager *pag, bool use_pager, const char *s, - int len); - -/** - * pager_post() - Add a nul-terminated string to the pager input buffer - * - * Convenience wrapper around pager_postn() for nul-terminated strings. - * - * @pag: Pager to use, may be NULL - * @use_pager: Whether or not to use the pager functionality - * @s: Nul-terminated text to add - * Return: text which should be sent to output, or NULL if there is no more - */ -static inline const char *pager_post(struct pager *pag, bool use_pager, - const char *s) -{ - return pager_postn(pag, use_pager, s, strlen(s)); -} +const char *pager_post(struct pager *pag, bool use_pager, const char *s); /** * pager_next() - Returns the next screenful of text to show @@ -146,21 +127,6 @@ static inline const char *pager_post(struct pager *pag, bool use_pager, */ const char *pager_next(struct pager *pag, bool use_pager, int ch); -/** - * pager_active() - check if pager needs to process output - * - * Returns true only when the pager is genuinely active and needs to - * process output (not bypassed or in test bypass mode). - * - * @pag: Pager to check, may be NULL - * Return: true if the pager is active - */ -static inline bool pager_active(struct pager *pag) -{ - return pag && !pag->test_bypass && - pag->state != PAGERST_BYPASS; -} - /** * pager_set_bypass() - put the pager into bypass mode * @@ -215,12 +181,6 @@ void pager_clear_quit(struct pager *pag); void pager_uninit(struct pager *pag); #else -static inline const char *pager_postn(struct pager *pag, bool use_pager, - const char *s, int len) -{ - return s; -} - static inline const char *pager_post(struct pager *pag, bool use_pager, const char *s) { @@ -232,11 +192,6 @@ static inline const char *pager_next(struct pager *pag, bool use_pager, int ch) return NULL; } -static inline bool pager_active(struct pager *pag) -{ - return false; -} - static inline bool pager_set_bypass(struct pager *pag, bool bypass) { return true; diff --git a/test/common/pager.c b/test/common/pager.c index 534096a1c4f..ccd5230f3a4 100644 --- a/test/common/pager.c +++ b/test/common/pager.c @@ -665,22 +665,3 @@ static int pager_test_quit_keypress(struct unit_test_state *uts) return 0; } COMMON_TEST(pager_test_quit_keypress, 0); - -/* Test pager with non-nul-terminated string using explicit length */ -static int pager_test_non_nul_terminated(struct unit_test_state *uts) -{ - struct pager *pag; - /* "Hello" followed by other data - not nul-terminated at offset 5 */ - static const char data[] = "HelloWorld"; - - ut_assertok(pager_init(&pag, 20, 1024)); - - /* Post only the first 5 bytes */ - ut_asserteq_str("Hello", pager_postn(pag, true, data, 5)); - ut_assertnull(pager_next(pag, true, 0)); - - pager_uninit(pag); - - return 0; -} -COMMON_TEST(pager_test_non_nul_terminated, 0); diff --git a/test/hooks/bin/ellesmere/conf.malta_qemu b/test/hooks/bin/ellesmere/conf.malta_qemu deleted file mode 120000 index ded626f8191..00000000000 --- a/test/hooks/bin/ellesmere/conf.malta_qemu +++ /dev/null @@ -1 +0,0 @@ -../travis-ci/conf.malta_qemu \ No newline at end of file