From nobody Mon Mar 23 23:30:31 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of seabios.org designates 78.46.105.101 as permitted sender) client-ip=78.46.105.101; envelope-from=seabios-bounces@seabios.org; helo=coreboot.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of seabios.org designates 78.46.105.101 as permitted sender) smtp.mailfrom=seabios-bounces@seabios.org; arc=fail (BodyHash is different from the expected one); dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from coreboot.org (mail.coreboot.org [78.46.105.101]) by mx.zohomail.com with SMTPS id 177396954827040.44115300927638; Thu, 19 Mar 2026 18:19:08 -0700 (PDT) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTPA id 71926500E3F; Fri, 20 Mar 2026 01:19:04 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) [209.85.214.174]) by coreboot.org (Postfix) with ESMTP id 89312500E32 for ; Fri, 20 Mar 2026 01:16:22 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) d9443c01a7336-2b062069f80so1089685ad.0 for ; Thu, 19 Mar 2026 18:16:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1773969380; cv=none; d=google.com; s=arc-20240605; b=ZgBQKpe45RtKW3gmhbws2NRMXRbm5IpLmJSzcXl81g1BzhC3/p0Nlum9pjYvBlJf7R Zb6NMHtlaObimkLmKCb+lvZoIedulggqF7XQxz1pVu3RBYtgeOIGo6mo7wJFpMPu9D3F xZXLpMl7fVSO7ieQpNNEKTqTTLDfAcmfPHBZTY5sjxokrtltsHbI2sbbf3FwlHVvc0IF 0vX5pMnrPU1rXK/5ffLSghqhhL00S7XxURXxdSvrDCWu+Ea+/W51Pd3VlenlSzdE0uUK yUoGIm9AALzeLgIR13DpYCTbyg9YIm0FIj/8ogAKVCuUqhg5RIh2GRUxjS76YpOh0Ede YTkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=to:subject:message-id:date:from:mime-version:dkim-signature; bh=2AJWFikrZ02vByAgNhxQlnjyMXzdsluvDK/6EkEooMc=; fh=Ojiz1Ls82Hh2+087o5dkFgqBcCQ1ySy8hFuOrpUxsHk=; b=Mb8OfWlKLnydmAh5/i4pwPPX0NzSXJnu1pq50gFonophgMvAUYfmZpvPMyBC90l/KX SkOjdzftCG/WXjiBV2RDx3STtJ57nyDNzKk71e7+ZzlcUsPjtKYO4g0C9WxsVRLO6+ey YGkBXXDXv2zYvWhzgvZBH9iw8bIYyVQGTkYGODIpWQ3UNptAwhAS/YcQf49PZtGtVGZr /ITBT5PWLuCJtUqoQqx/TWWMVRR6q46NPLXM4vWxKxSgIgAr6qyAjdkStp/FINFe7bdG ErTEUV3yihoAT4s9c70dDKHvlh0oxVkD+nPxDfDq5ajtX627xgy+HFH86DFnBoxVMzd1 yg7w==; darn=seabios.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773969380; x=1774574180; darn=seabios.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=2AJWFikrZ02vByAgNhxQlnjyMXzdsluvDK/6EkEooMc=; b=RGkBys3Zrm2Zt/7DjzLPVWumSPaJkvjBN1UDYb5fCCV4Wwkja0hZgbTU8Fq+9AP2xc 2bLg/vhA3nNx4RcjexLhRmQsIvBOVkJM+qx8ID6ZsoOYz6LsEtjwNUayGQEmEKcJHsZy +X/OEeJ/QNZlzaA55MEdlOl4O0YqMYwJckGhkD2kwj/CXyqcM2B9L6QSkx555EsTz7l4 tdvcgtxzHejt2chx+tHHiQo++8eeYfbfwIusJPBB5rrjm9OKeT6EWZEgeNwegPcdKQT5 wkgSG+Nx5DsT6ZyK6APDlRz1RB9XC3Z++p3l5MMpUkmADSnTk2s8e9c9Bp8HpJ1UUwGO zexg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773969380; x=1774574180; h=to:subject:message-id:date:from:mime-version:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=2AJWFikrZ02vByAgNhxQlnjyMXzdsluvDK/6EkEooMc=; b=FvX2VDz7TOf991qPBFkocI5kKeFdjqgJmdJshbiJn1qydvoKzGBAMn+/vAeySJUMCI pWFlYUUaRS4i4DsqCPtZjOxrWYkpo8YaftVnLkf4xHXnbOUCWsjqFuMpSoSE5+Jhhyam wrgosKYjZI1vW6dfejucWYsZxkjVURL0+rlFP/OvaWMrJnVhaUmii5IgSDl8jJqY1+ek 6L5sPhL4k7nQ4cv1ZkTNALxu6kgOg3ikAYR0A7rg+Eh0NPdGubE/+g/B/fKYYwA1y3BO g9z0292hnP9jbi1uLcsBaDq2F0yj6WZgYzFT4CBLn0d1f+08HFFsasW8v64O0oqq4NBJ b/nw== X-Gm-Message-State: AOJu0YyE318GMPwHzt8xKJf23H0CGfJ2TXR6zZBbF1KwsMEGkiczw2kk IxEr2L2oJU4OtwO2nW7voR0ZUi98QtP4ZpC9ckFNyz2NdL9Xgj4zc7x8nm3q7pMJsTchEqnFOfy R1oWuuE7/E9EGjTT5VM6gg4XeQel3iGLbusVvnL8= X-Gm-Gg: ATEYQzwUfMFuF7AAjIYCufh7bljZhIdreS6YHNBsBXuiMqT0HUDvnY0s/00mohjZcvv cKrSDaHBmLwXpqjwZ7XrctfL9Iwmfon2+SSBySsrR4Cwvrux1j1LeBvYSSHcvwXIp7Y2MMupfYN jGS1+RvvOONHqvbhjwdLqhtYaD2BQJOvt0WdF2K3+Tag052IGguD7KficTwvI8kbgijOdesLhrm T2yFl1b2Ox/WD/+XiHg6yilpFQINI1XzTzrX6d7uN7mYy8k1AIiG35gKHnfkuK8jAPtnbNLq02p CkkOM3nbhAaJA6RhqZRD4/zp2rM/1bIDcOxRb9hcnVpmZibuzyy9G5WZD4MvSwbAZxXWRA== X-Received: by 2002:a17:902:e811:b0:2ae:6d9e:ed57 with SMTP id d9443c01a7336-2b0827393efmr10996735ad.21.1773969380272; Thu, 19 Mar 2026 18:16:20 -0700 (PDT) MIME-Version: 1.0 From: Mike Banon Date: Fri, 20 Mar 2026 04:16:09 +0300 X-Gm-Features: AaiRm51dc5VL9TBNFN7B42fp8ahgraIwGeVpCmft0icAwrXfkPAG2GVrwmLsu58 Message-ID: To: seabios@seabios.org Message-ID-Hash: 2M7PZ4N4ADXA44AZ3YTORUFFYLXG4OJE X-Message-ID-Hash: 2M7PZ4N4ADXA44AZ3YTORUFFYLXG4OJE X-MailFrom: mikebdp2@gmail.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-seabios.seabios.org-0; header-match-seabios.seabios.org-1; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.11b1 Precedence: list Subject: [SeaBIOS] [PATCH] scripts: Increase BUILD_MIN_BIOSTABLE for auto-sized and 128KB ROMs List-Id: SeaBIOS mailing list Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: + X-Spam-Level: * Authentication-Results: coreboot.org; auth=pass smtp.auth=mailman@coreboot.org smtp.mailfrom=seabios-bounces@seabios.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1773969550473154100 Content-Type: text/plain; charset="utf-8" [PATCH] scripts: Increase BUILD_MIN_BIOSTABLE for auto-sized and 128KB ROMs When CONFIG_ROM_SIZE is left at 0 (auto), checkrom.py will automatically determine the ROM size based on the actual binary size (up to 256KB). However, layoutrom.py only increased BUILD_MIN_BIOSTABLE to 8192 when CONFIG_ROM_SIZE was explicitly set to 256 or larger. This meant that if the code grew large enough to require a 256KB ROM, layoutrom.py would still use the smaller 2048-byte F-segment reserve, potentially causing resource allocation problems in case of a big number of boot entries. Also, 128KB ROMs should have a larger 4096-byte F-segment reserve. Fix this erroneous behavior for non-specified CONFIG_ROM_SIZE case by calculating the total raw size of all sections that will be placed in the ROM. This raw sum underestimates the final binary size by roughly 5% due to alignment padding and relocation tables, so if it exceeds 64KB we can reliably conclude the final ROM will be at least 128KB and set BUILD_MIN_BIOSTABLE =3D 4096; if it exceeds 128KB the final ROM will be 256KB and we set BUILD_MIN_BIOSTABLE =3D 8192, matching the behavior for explicitly configured 128KB and 256KB ROMs. Signed-off-by: Mike Banon --- scripts/layoutrom.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/scripts/layoutrom.py b/scripts/layoutrom.py index abebf021..4fe75ceb 100755 --- a/scripts/layoutrom.py +++ b/scripts/layoutrom.py @@ -651,10 +651,6 @@ def main(): # Read kconfig config file config =3D scanconfig(cfgfile) - # larger roms have more room in the f-segment due to moving out 32bit = code - if config.get('CONFIG_ROM_SIZE') >=3D 256: - BUILD_MIN_BIOSTABLE =3D 8192 - # Figure out which sections to keep. allsections =3D info16[0] + info32seg[0] + info32flat[0] symbols =3D {'16': info16[1], '32seg': info32seg[1], '32flat': info32f= lat[1]} @@ -670,6 +666,20 @@ def main(): keepsections =3D findReachable(anchorsections, checkKeep, symbols) sections =3D [section for section in allsections if section in keepsec= tions] + # larger roms have more room in the f-segment due to moving out 32bit = code + if config.get('CONFIG_ROM_SIZE') >=3D 128: + BUILD_MIN_BIOSTABLE =3D 4096 + if config.get('CONFIG_ROM_SIZE') >=3D 256: + BUILD_MIN_BIOSTABLE =3D 8192 + if config.get('CONFIG_ROM_SIZE') =3D=3D 0: + sections_size =3D 0 + for section in sections: + sections_size +=3D section.size + if sections_size > 64 * 1024: + BUILD_MIN_BIOSTABLE =3D 4096 + if sections_size > 128 * 1024: + BUILD_MIN_BIOSTABLE =3D 8192 + # Separate 32bit flat into runtime, init, and special variable parts anchorsections =3D [ section for section in sections --=20 2.53.0 _______________________________________________ SeaBIOS mailing list -- seabios@seabios.org To unsubscribe send an email to seabios-leave@seabios.org