From nobody Mon May 26 15:33:37 2025 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 4b5ftT3mpfz5wBcl; Mon, 26 May 2025 15:33:37 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4b5ftT25tbz43QH; Mon, 26 May 2025 15:33:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748273617; 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=6fMU9zBTsUFx/D3nW3m8D0BvUD6Q/EDWBgxGWynRI7I=; b=ql7dbrnO7CmREPjw010S/YkcwfRqXUuv1sw3XSMcAIk6w69BVD5NO7TnU25I0B1GsQEStl 1wGElqcdAtbFlyOBzykNqNih8YnZ2KmJPXgjKpWK/48IE/9SSYz8/f43HcBZgSghsSm0J3 u3kU7GZ0aPeAZ1ecAlo95ggOtaGRF9XSzs7aQyTgFBl41Hgg9jPoPH6RFIA3XmbEVLBl/2 DP0exe0ZGrziQxW38s6gnsX9gbSsrILEUsIMKJU3ka0fOICee4q0Em/mwh5ZhpCq7Ra0dh /WJfX9YEM/ZmNs7BD7WsgjtFdTIlNDsTh2N82xqzTomWJm2nKKkpHS/SAw7SNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748273617; 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=6fMU9zBTsUFx/D3nW3m8D0BvUD6Q/EDWBgxGWynRI7I=; b=uMM0d3xfmco1Yg2hykO9kF2wl3q0AN/a9EPWhwjoE9ncyce+QGgaRZ6ZpeRX05L4zSMnrH 4YUMUKSjOfqDXgtMqb7F09VPPIeOL5yP/le/KLkgBo08L+QZqohiwbKVoYe1pvXkMrSaLa lKSK6yR53cHxf7kIhqQLV/D3wbRMKjyMY3mpqLSkubxwdIoEyvBv/psffu5IgLaISwssb7 Av3NQSUxW97SrL8aE14iGIzjGZdaIrpvSzKdcOaspeOtYIDC+SjMUqDfivAoEGpN9mtQzX tFnUX1axZSpey0iaOsVsnzPlIk4cDJVl6b01dbeOgOvXii/piQYtnGgxyihXZQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748273617; a=rsa-sha256; cv=none; b=rP62ut/J3EwQktrhxAEW5tc6k/gBlUKagqjTT4UrsBjPJyYNqlnEMdRbaJlTlMOAnVQWEN TmEp4Vsh2coYOGUDnPefh9KVwdcLMa5Ire1kzNmdq9sEEhMGhbJ+i9sDWtgJvEKFgzf4sC SOsS6bbtpnZH5Y42VMyAE8BQEiPYmgP+A5C6yQRATPwRAAMQzB+noDYNQbTUdIZlTqgG74 n2IBvBwpfwf/Z4vByzVr2mTeosY5bP7GFxbHQmRnWNtbWZyTX9i6m46456mNwBMnZQefq1 vKSgTj8CbnVcGawOyIvd6aBhFDDTDTpxVGtGExXMytf9rp2ULV7oEVwDB+NQ4w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4b5ftT1Pj5z1BFD; Mon, 26 May 2025 15:33:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 54QFXbX2045194; Mon, 26 May 2025 15:33:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 54QFXbLL045191; Mon, 26 May 2025 15:33:37 GMT (envelope-from git) Date: Mon, 26 May 2025 15:33:37 GMT Message-Id: <202505261533.54QFXbLL045191@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: 5b90ffad8759 - main - stand/i386/zfsboot: Initialzie archsw at compile time. 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-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: 5b90ffad8759633aa79bc9736b1bb65e3a5248b7 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=5b90ffad8759633aa79bc9736b1bb65e3a5248b7 commit 5b90ffad8759633aa79bc9736b1bb65e3a5248b7 Author: Warner Losh AuthorDate: 2025-05-26 03:46:32 +0000 Commit: Warner Losh CommitDate: 2025-05-26 15:30:37 +0000 stand/i386/zfsboot: Initialzie archsw at compile time. Also, add a comment about the weird reason we even have an archsw here at all. tl;dr: zfs code uses archsw when it aught not, but this hack here is easier than fixing that code properly. Sponsored by: Netflix --- stand/i386/zfsboot/zfsboot.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/stand/i386/zfsboot/zfsboot.c b/stand/i386/zfsboot/zfsboot.c index 07bf31eac7a1..4c8eae9b65e5 100644 --- a/stand/i386/zfsboot/zfsboot.c +++ b/stand/i386/zfsboot/zfsboot.c @@ -131,7 +131,16 @@ static int parse_cmd(void); static char gelipw[GELI_PW_MAXLEN]; #endif -struct arch_switch archsw; /* MI/MD interface boundary */ +/* + * Only because the zfs code requires access through archsw, otherwise the + * 'boot' programs don't need archsw. This is less than ideal, but this + * workaround is easier than many of the alternatives. + */ +struct arch_switch archsw = { /* MI/MD interface boundary */ + .arch_getdev = i386_getdev, + .arch_zfs_probe = i386_zfs_probe, +}; + static char boot_devname[2 * ZFS_MAXNAMELEN + 8]; /* disk or pool:dataset */ struct devsw *devsw[] = { @@ -184,15 +193,6 @@ main(void) */ bcache_init(32768, 512); - archsw.arch_autoload = NULL; - archsw.arch_getdev = i386_getdev; - archsw.arch_copyin = NULL; - archsw.arch_copyout = NULL; - archsw.arch_readin = NULL; - archsw.arch_isainb = NULL; - archsw.arch_isaoutb = NULL; - archsw.arch_zfs_probe = i386_zfs_probe; - bootinfo.bi_version = BOOTINFO_VERSION; bootinfo.bi_size = sizeof(bootinfo); bootinfo.bi_basemem = bios_basemem / 1024;