From nobody Mon Mar 23 23:27:25 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 1773940080012603.8266001261202; Thu, 19 Mar 2026 10:08:00 -0700 (PDT) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTPA id 77BDF500E04; Thu, 19 Mar 2026 17:07:56 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) [209.85.210.181]) by coreboot.org (Postfix) with ESMTP id 20EA6500D40 for ; Thu, 19 Mar 2026 17:07:36 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) d2e1a72fcca58-8298fad2063so538930b3a.3 for ; Thu, 19 Mar 2026 10:07:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1773940053; cv=none; d=google.com; s=arc-20240605; b=MopTJGbrry/hPxt5nNcDfMFojzkU0vuXAOnlMLxR6jtn4/SrP7lHIliUKAn44np2cb m9LfDL+5ZixgXhWnRzu5jH4qM1gzaN9mNx/0l9Z9Q+anQZhRIbHTvR2jWMMzpd6qHjA2 ZKNpVHfUMj9jbdNwliJDTu0UJjaf/XWqEa78g0TUnK6O3NewqlAEaoERPcbK7VEGn8d1 bAoJnBzXKAKp+7g/BBl1po5Rjam5Gu0b+6KLim6EOLq1jyTjct2SgMrwNrRS+H90u75v Xy3FqTlFKWGPllXGRxQYjzHvzzxQobFzkW2FHtgoOEJmSBLoE9bWe6mH3CFcCP4FDhNf b0cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:to:subject:message-id:date:from :mime-version:dkim-signature; bh=4n0TXS1HkAxmaW0HchDRJ1A5EnuALop+dePYkwGeELo=; fh=Ojiz1Ls82Hh2+087o5dkFgqBcCQ1ySy8hFuOrpUxsHk=; b=O6h8jkoZziCd8T5IjA7WJRePM6ZxmaIAeRAo6xs0WVLBzjnY0X6a7brGzsoFwvJux1 CnEkXVjR2Gh/WSJb7S95nH83jMn8UvZhCpZ6+Il3A32I18vzmVVEG4iSQi9RK9TxZBp/ ZMrINrpN8/lG0Fo10922qI1x4kGqc80qWyvWCFPlCuzK3T3C9G6Q1XWbtT9pPboC8dUb kj1LEzUzpJWFTLRw/JMkcfpYxICB590jwRY81kL/SkWgs5YK1GbDhkao+2SQnUc5CX6w SjCtR74GjLv3quxbIUn0/j4tOQ2KDGYmiI07sIVvYbKx63QAS1zz3U/iMGzUMQJ2KTiA EDJw==; 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=1773940053; x=1774544853; darn=seabios.org; h=content-transfer-encoding:to:subject:message-id:date:from :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=4n0TXS1HkAxmaW0HchDRJ1A5EnuALop+dePYkwGeELo=; b=KxWS6prldZzuotZQMaxRw6ScNrPDzkPO2dkEvDKpfqEL8RmYtMbDSrVy6nd8nsV4tg qc2NCp/Ug2ACiyV07iQz3KchUnHh5hs5GYxzSxStSc+bXeBtSaEBe3ZKYCm2+3lbHQta +g599URZWWM0Sb91DzIh3FYlHHtKB/AqYgl8eQ0IgUetLH7a0hwSQJJXCV3TTQ/txNXa 1jcP/+j9BPTpmdEFsbxpvj79+C/rwyzV4r28KaJSfI+KhqANRjOz45U3jLj12D3+qSIH wOR9lC7B0M7cS7+WF/BSPMylcbn20fCSG1v3gY518Wvq75QPjei3YMJe6/KmhNtrFquA HsLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773940053; x=1774544853; h=content-transfer-encoding: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=4n0TXS1HkAxmaW0HchDRJ1A5EnuALop+dePYkwGeELo=; b=RXJOnjV1Lpspbxpfc/NYiuuejTN85mDS0/9xLJuwVZzyuuxPWBFUfJLIwbdBnNLrph X89LrWzZrpzB/RGz3QPDROJuAnwkWOzTEff9Avyt2xKsM4a26slLUfDjU4tW6D19+Lsu R6nNxViNF1km4LndSexjfsx09eyWy7WawvPpM3rFggOMB2EA8faKvc/b+5OH/BwSKm9d J7Y4UFg7mgIMYdTajCGwX2q9TyjF4XMX8tcaTBr4u2BGOVBjg7sW3Gw8DziFaSPKmw7H Ebbr18GeBUU9h/o5X5brYPNCMt7qO+dGyv3ZsSeL29Wo+HAyWL80ZN+W7Iz1wenSRYXq 1Fkw== X-Gm-Message-State: AOJu0YzrMXzn7eqBDGSRgAO/BS1dm2NtAn5K6YuGPPLRwxqi2/+UirLm pKhz4TTjVfQitK6wIZZYn9c5vZtfIfj8K7g1WO+qxqjPkgvik7zRfFOyi5Iv667A8zhyE7/Wx3K MoGDoawWXhWCtVmfwNSL9O+FKsayCi2eHRt6l4Hw= X-Gm-Gg: ATEYQzwvSPQjF3DG2AMnF1/DgpIlwCEekptCOeXMxXuGJFSTH37ssHUGbYaCuAL1JQ2 3H2qLlk9wKQ9dK5DnGreU87RkX85XXc8MgW+epDZ9B27lY1lhcWH4f6AsRddJXRBv1eHIjpFQzM kXFn3uWv8lFKykM0Yx/Y9bAy8xf8miS74wDRdHBmItbOn+0N94FiSdJk7N3kk/lqa3Fs2ck0Ow9 m1D9Qyndoq0ilFrGcQVw+2A+19C6gS6+aOKvJ2ZGMDHX3KJ5NgUWoCycXuAK7Eebi0B0JPNJQvV VB7OmJ+gnJWjsh5EqtQYzDYFZ9iXoevn2V4zfClacifqjDlVbCF7x5OfdONyqASq6jd3rg== X-Received: by 2002:a05:6a00:3e02:b0:82a:71ea:3df1 with SMTP id d2e1a72fcca58-82a8c23902amr66111b3a.21.1773940053056; Thu, 19 Mar 2026 10:07:33 -0700 (PDT) MIME-Version: 1.0 From: Mike Banon Date: Thu, 19 Mar 2026 20:07:21 +0300 X-Gm-Features: AaiRm53L5hg4K9T4YwkBtCKab5yAo0bDMN1p6ltL1_x8Ft392h0-O9Tylfve0Vs Message-ID: To: seabios@seabios.org Message-ID-Hash: 753T47Q2GAOX7Z2BI2KMJP6UA7RD7GUZ X-Message-ID-Hash: 753T47Q2GAOX7Z2BI2KMJP6UA7RD7GUZ 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 ROMs List-Id: SeaBIOS mailing list Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="utf-8" 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: 1773940081610154100 [PATCH] scripts: Increase BUILD_MIN_BIOSTABLE for auto-sized 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=E2=80=91byte F=E2=80=91segment reserve, potentia= lly causing resource allocation problems in case of a big number of boot entries. 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 128KB we can reliably conclude the final ROM will be 256KB. In that case set BUILD_MIN_BIOSTABLE =3D 8192, matching the behavior for an explicitly configured 256KB ROM. Signed-off-by: Mike Banon --- scripts/layoutrom.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/scripts/layoutrom.py b/scripts/layoutrom.py index abebf021..7f33d4b4 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,16 @@ 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 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 > 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