From nobody Sat Aug 13 03:49:21 2022 X-Original-To: dev-commits-src-main@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 4M4RPG0t8Kz4Z1lh; Sat, 13 Aug 2022 03:49:22 +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 4M4RPG0Rvfz3hWf; Sat, 13 Aug 2022 03:49:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660362562; 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=UXkV9z8NvZqr5LWvUCLLAgPq978MUvF06rcnX6V+tO8=; b=RkDKFbrXsuq2DibhgB+enpQ62Q0ookXd4MD9p/FiFb5wQiUjFeLRS+x+uf8Nf3V7QPGRXV SK+CnJ8M8rAAp/uXsLCo1cQRerp3qp28yphrhLih/1mZ7uz1J+Fp+NDq2+U/jsq86K1/BB 7Q4cJgdijDSQgDr1nIsOxdLEFmXtmSIY0k0JzVKI+HExsRPJVFBdXJayLQqNLShYoyesm2 THF+iAtvvjxn+lkAqRIzTzaLxYLuYuKQrhBJF2mN4phHaJyjBR97XiQk/u3QNMffsIvbxA QAKl6IYdx5O6eSd2Bm+671+Rz9g5XqS0PiV8O+fp+/KrpuQ3DYo0X2JGCmkOBQ== 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 4M4RPF6FFWzxKB; Sat, 13 Aug 2022 03:49:21 +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 27D3nLvp032754; Sat, 13 Aug 2022 03:49:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 27D3nL3l032752; Sat, 13 Aug 2022 03:49:21 GMT (envelope-from git) Date: Sat, 13 Aug 2022 03:49:21 GMT Message-Id: <202208130349.27D3nL3l032752@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 148211300870 - main - stand: Compile out the extensive superblock diagnostic messages for BIOS loader List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 148211300870b3bd558bf70dc3bf7d7f78c657aa Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660362562; 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=UXkV9z8NvZqr5LWvUCLLAgPq978MUvF06rcnX6V+tO8=; b=EIrDnQnktqe43P2Pq8H4BT7cmIdLwiwrlOgzCtS+s9h1KC6G6+uTqDYNjXWnc9hOxjYyfy Igp4udHxyAzXLXzRysUulK401Isna5HhCmh2c7RL+Pfo8L+1eJhqwclcxaDReU3x09spmI 04jfj5fBE45pTMb9NZ88BFBockCH6jrpNXiCozIpUJirxHPvE7RgEiN3QcHLkVE2/fdUA3 7+AhmNsBJUDn5B92yQOM4FNBUpv7A7fqanB+frAQ6JpsVl3w2bxvrrn21Xa0fjhYlCoJT1 ivrl+2RJOcaXdiGI2H6D2qhBFBZD548ICklfIKBPOTGqBA6in7aqUjCP780lqw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1660362562; a=rsa-sha256; cv=none; b=lFLeNE6Z+AzOv3hazL8j+rYfekIWFWWFz+KFcqr5Tm06xDnopGJ8FlVCS91eF6LTmWf3zs sJ4Vhg5rORlfKCOltAZK1t6qX/Us6B0NerbYk2lbNDRJUq0mFqEfhCpdiuslSESSO+ER0n RWkYRDoO9onaMiBsPmfJrrFCmHND49M7+RL/82VcAkPmRCmygCqBhJFqpq3jWooZ+SESvv kz2D50oOqDtwXME+MyeCjiRmec+NQbZE9WgPBp8I7P/1F5KfMwToj241kbDHEb3UHkW6vu sBLlje9leuIeuXMC8I7aVD4f4T6KUjWvThRdbsutJQEYNDxJhV+1PayLxW67tQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=148211300870b3bd558bf70dc3bf7d7f78c657aa commit 148211300870b3bd558bf70dc3bf7d7f78c657aa Author: Warner Losh AuthorDate: 2022-08-12 17:08:36 +0000 Commit: Warner Losh CommitDate: 2022-08-13 03:48:17 +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 --- 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 dc35fe007506..14b38298c3f0 100644 --- a/stand/libsa/Makefile +++ b/stand/libsa/Makefile @@ -170,6 +170,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.gzipfs.c+= ${ZLIB_CFLAGS} CFLAGS.pkgfs.c+= ${ZLIB_CFLAGS} CFLAGS.bzipfs.c+= -I${SRCTOP}/contrib/bzip2 -DBZ_NO_STDIO -DBZ_NO_COMPRESS diff --git a/sys/ufs/ffs/ffs_subr.c b/sys/ufs/ffs/ffs_subr.c index 8768c5588def..c6043765cfb0 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 flags, * 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 #define FCHK(lhs, op, rhs, fmt) \ if (lhs op rhs) { \ MPRINT("UFS%d superblock failed: %s (" #fmt ") %s %s (" \