From nobody Fri Nov 18 01:21:47 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NCzXC46MNz4hlVv; Fri, 18 Nov 2022 01:21:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NCzXC2GLVz3rHX; Fri, 18 Nov 2022 01:21:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1668734507; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7QdAibN9mvKpgWGfWrN5wn/8d61U1uFtEhNhJhZ3i58=; b=Taas8fzIGcOkNrxDplmkvtdBEYJUa/u6hhA6dmsC9WqaMtenQa2RoMDoPmiJlHEXfXAH/b S8iNv4Hq922DiDoU5llY21wMCH8Yn4YBKRoXcMSlCdBBerFR9NVF90oeX9q4aBqrFozSUP hv71Wf5bfRT7GGSfSBc58/e00oeQsaRadx+vUVYxrM9ZPjVJx63daaJVyY9HseEZTwF85C 9VCzy6g0moSQwhO6aN9kzk7ft8siwRvmZcq93sK8meueJ4zr/nwherjIX7PJ/oW0oZBUhJ DdgwHA3yWei7sVzDdk4xhckCkmJ85/Rvy2k0c/VhPGySR7xQzse5osVPUu138w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1668734507; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7QdAibN9mvKpgWGfWrN5wn/8d61U1uFtEhNhJhZ3i58=; b=YGz6FUAgvqVFSAZFHqgm4TGZFZf4SUoLtZJf7zKJgESDeccajbs/ntTnRmcNR4cdHhbfkK moX8etzr8sOIE3Zlj1c1gFpV89ULrXeXBIAPrGBSYeexcJWmqTkE2fT1beSGWgVL7QvSBL i9RMS3szFNQ+ApZ4HW639dqW4X7+DIx+4MLrHPnbHpEpCPvaIO3B3Z8lo7xdIf58as0kOa r4IzGRJWFF3qJiC2Cu2ahBb8dSvqadOp2xywdrEOGBdJzW9qr37XB7SgerktiRtu0DXyYt bhZ6Zfa4wdFfinK+BEG5COMyBhWZav0Y6+2NaAU0lj94JK4u0yW7Yu4qP73sKw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1668734507; a=rsa-sha256; cv=none; b=o45EPbYYxk9u3IstGEWsMdbUgjfjV+vWEdqkIKBvd76H+z9z5FCI3KWTILIYGd8mqc5NJo z32djyFIr0mqt0OLxlt0z0puhHGs8xrvbcEUkVC4tfX/pirLQhGCp1qNwfnKGN2Mr0muck nxqikM2ZJD543wKuZuDPzZUSPZjiyLAFethlRquPuUkLOr5LuI9CUN3w3WQ6ECGD9CM94Z 0XLOKgm6ucGiZMUAGqhJ4Mc9wLl5cRPe6DNYNhMMZB7txy+K8Kk3S5UKkyRptAapzxJOQg l+/mA3wmauMu+r6uymnGva8TjPJtJdsksa1NHUM2QeC2aL8dJLX+cvH6OAEyng== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NCzXC114yz13W7; Fri, 18 Nov 2022 01:21:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2AI1LlRb077055; Fri, 18 Nov 2022 01:21:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2AI1Llgn077054; Fri, 18 Nov 2022 01:21:47 GMT (envelope-from git) Date: Fri, 18 Nov 2022 01:21:47 GMT Message-Id: <202211180121.2AI1Llgn077054@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kirk McKusick Subject: git: 37ddf393f85b - stable/13 - stand: Compile out the extensive superblock diagnostic messages for BIOS loader List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 37ddf393f85b2d70d34bb85f8ffad3cc2882d50a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=37ddf393f85b2d70d34bb85f8ffad3cc2882d50a commit 37ddf393f85b2d70d34bb85f8ffad3cc2882d50a Author: Warner Losh AuthorDate: 2022-08-12 17:08:36 +0000 Commit: Kirk McKusick CommitDate: 2022-11-18 01:19:41 +0000 stand: Compile out the extensive superblock diagnostic messages for BIOS loader The BIOS loader operates in a very constrained environment. The messages for the super block integrity tests take up about 12k of space. Compile them out for the BIOS loader, while leaving it intact for all other loaders that aren't space constrained. These aren't used in the 'super tiny' *boot* programs, so no adjustment is needed there. We reply on the fact that (a) i386 doesn't support 32-bit UEFI booting and (b) LIBSA_CPUARCH is "i386" when building on both i386 and when we're building the 32-bit libsa32 library. This saves about 12k of space for this constrained envrionment and will take a bit of the pressure off some machines where the loader has grown too big for their BIOS (see comments in i386/loader/Makefile for details). Sponsored by: Netflix Reviewed by: mckusick Differential Revision: https://reviews.freebsd.org/D36175 (cherry picked from commit 148211300870b3bd558bf70dc3bf7d7f78c657aa) --- stand/libsa/Makefile | 11 +++++++++++ sys/ufs/ffs/ffs_subr.c | 6 +++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/stand/libsa/Makefile b/stand/libsa/Makefile index 781194d0a28d..284aa5452fca 100644 --- a/stand/libsa/Makefile +++ b/stand/libsa/Makefile @@ -167,6 +167,17 @@ SRCS+= time.c .PATH: ${SRCTOP}/sys/ufs/ffs SRCS+=ffs_subr.c ffs_tables.c +# +# i386 has a constrained space for its /boot/loader, so compile out the +# extensive messages diagnosing bad superblocks. i386 doesn't support UEFI +# booting, so doing it always makes sense natively there. When we compile +# for 32-bit on amd64, LIBSA_CPUARCH is also i386 and we use libsa32 only +# for the BIOS /boot/loader which has the same constraints. +# +.if ${LIBSA_CPUARCH} == "i386" +CFLAGS.ffs_subr.c+= -DSTANDALONE_SMALL +.endif + CFLAGS.dosfs.c+= -I${LDRSRC} CFLAGS.tftp.c+= -I${LDRSRC} CFLAGS.ufs.c+= -I${LDRSRC} diff --git a/sys/ufs/ffs/ffs_subr.c b/sys/ufs/ffs/ffs_subr.c index 6b2bbf41c91b..01981c782499 100644 --- a/sys/ufs/ffs/ffs_subr.c +++ b/sys/ufs/ffs/ffs_subr.c @@ -323,7 +323,11 @@ readsuper(void *devfd, struct fs **fsp, off_t sblockloc, int isaltsblk, * Verify the filesystem values. */ #define ILOG2(num) (fls(num) - 1) -#define MPRINT if (prtmsg) printf +#ifdef STANDALONE_SMALL +#define MPRINT(...) do { } while (0) +#else +#define MPRINT(...) if (prtmsg) printf(__VA_ARGS__) +#endif /* * Print error messages when bad superblock values are found. */