From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1lMotB-0000uZ-9K for mharc-grub-devel@gnu.org; Thu, 18 Mar 2021 05:24:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36742) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lMot9-0000rM-R7 for grub-devel@gnu.org; Thu, 18 Mar 2021 05:24:19 -0400 Received: from painless-a.thn.aa.net.uk ([2001:8b0:62::26]:42024 helo=alt2.a-painless.mh.aa.net.uk) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lMot8-0008Dk-4P for grub-devel@gnu.org; Thu, 18 Mar 2021 05:24:19 -0400 Received: from f.b.1.7.2.1.e.f.f.f.a.c.5.0.a.6.4.1.b.e.2.f.f.b.0.b.8.0.1.0.0.2.ip6.arpa ([2001:8b0:bff2:eb14:6a05:caff:fe12:71bf] helo=riva.pelham.vpn.ucam.org) by painless-a.thn.aa.net.uk with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lMot5-00029w-Ie; Thu, 18 Mar 2021 09:24:15 +0000 Received: from ns1.pelham.vpn.ucam.org ([172.20.153.2] helo=riva.ucam.org) by riva.pelham.vpn.ucam.org with esmtp (Exim 4.92) (envelope-from ) id 1lMosW-0004xY-Vx; Thu, 18 Mar 2021 09:23:41 +0000 Date: Thu, 18 Mar 2021 09:23:40 +0000 From: Colin Watson To: The development of GNU GRUB Cc: Michael Chang , Marco A Benatto , Javier Martinez Canillas , Daniel Kiper Subject: Re: [PATCH] i386-pc: build verifiers API as module Message-ID: <20210318092340.GA18653@riva.ucam.org> References: <20210318071434.2814-1-mchang@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210318071434.2814-1-mchang@suse.com> User-Agent: Mutt/1.10.1 (2018-07-13) Received-SPF: none client-ip=2001:8b0:62::26; envelope-from=cjwatson@debian.org; helo=alt2.a-painless.mh.aa.net.uk X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, KHOP_HELO_FCRDNS=0.399, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Mar 2021 09:24:20 -0000 On Thu, Mar 18, 2021 at 03:14:34PM +0800, Michael Chang via Grub-devel wrote: > Given no core functions on i386-pc would require verifiers to work and > the only consumer of the verifier API is the pgp module, it looks good > to me that we can move the verifiers out of the kernel image and let > moddep.lst to auto-load it when pgp is loaded on i386-pc platform. > > This helps to reduce the size of core image and thus can relax the > tension of exploading on some i386-pc system with very short MBR gap > size. See also a very comprehensive summary from Colin [1] about the > details. Thanks for working on this! It's certainly awkward to have to deal with this sort of thing, but apparently not as awkward as I'd feared, and it's better than the alternative. > +AM_CONDITIONAL([COND_NOT_i386_pc], [test x$target_cpu != xi386 -o x$platform != xpc]) You could drop this and instead just do "if !COND_i386_pc" in grub-core/Makefile.am. > diff --git a/grub-core/kern/verifiers.c b/grub-core/kern/verifiers.c > index 75d7994cf..85887917d 100644 > --- a/grub-core/kern/verifiers.c > +++ b/grub-core/kern/verifiers.c > @@ -221,8 +221,19 @@ grub_verify_string (char *str, enum grub_verify_string_type type) > return GRUB_ERR_NONE; > } > > +#ifdef GRUB_MACHINE_PCBIOS > +GRUB_MOD_INIT(verifiers) > +#else > void > grub_verifiers_init (void) > +#endif I think a comment here (or somewhere in the actual code, anyway, I don't mind where) would be useful so that people trying to work out what's going on don't have to hunt through commit logs to find out. If these minor comments are fixed: Reviewed-by: Colin Watson -- Colin Watson (he/him) [cjwatson@debian.org]