From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1lMqoh-00009q-Gs for mharc-grub-devel@gnu.org; Thu, 18 Mar 2021 07:27:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43590) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lMqod-00007z-Pm for grub-devel@gnu.org; Thu, 18 Mar 2021 07:27:47 -0400 Received: from de-smtp-delivery-102.mimecast.com ([194.104.109.102]:23345) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lMqoa-0000gA-Ul for grub-devel@gnu.org; Thu, 18 Mar 2021 07:27:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1616066862; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=5DtKe95ZhZR2YeqbKOKpSPq9IVbRY+zpeClocHBTiaw=; b=EoAi12uTSG0nDBQP469H1OfEpl0lVteF6y86ewo5u2UFA6EbwybnhAzY+Q2iDQR2AU46pN oQ2EkkKTe8XuEodiDUfEY0KLPdnPLSgFNt/lvQ/HIN2kFi3Ltx6PmbwLvosxoi7pUxfCad 9w4GhZS5p4kvhwOVBU48s9wOOyAZkao= Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05lp2177.outbound.protection.outlook.com [104.47.17.177]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-15-90dIJ_aBPKylo3UPTAYBSg-1; Thu, 18 Mar 2021 12:27:41 +0100 X-MC-Unique: 90dIJ_aBPKylo3UPTAYBSg-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VmBi6Q4dpefNi3k5XxKDcnDQSGyfD5y/2AAeZmiNAW/0SQZ34IC2IHlu5ylw9/qjcnmrW9UwOT9qMomQ1v1ds/4keA6ZobBYncNf6ta+2yzbYVwmg4d6saakTaHDzq60MJOirAU1XhVF6ypqgFZO1Nox2kZuTs3rrlagIhCThWbcdmeTaTwcrjXgCt2zMuUHZORUpCHGvtig2jfK5OdeoANrEMPmgAnPK9C9j3duZ8awbTDRli8RMjbdgJ2x0mjdRBrdFSNHm4zdCqHIYF5ipWM+bICUv4KapJ62pYLA9ITpE0aA05bN+XTf/YNsh1B4ktDIsQrVQ3HiApluaNcV4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5DtKe95ZhZR2YeqbKOKpSPq9IVbRY+zpeClocHBTiaw=; b=eu5dzYJ/DWIfoIxuyi0DXtfEkIB+bMLVW4I1+fa833WXzZg/O88pgmFDvEvthq75BXufhUZiqpxlZi8xGdIiVbV3YjzMQGHLAZXnakZBJo4r3i35QrfIsVZw5ix14xZa4V1UdsVzrOkUXx1br+ase1G23eY1/dHS/D/yeXwCDotdtfYDmlQtZwYLU7n4H1pRmOrqFW9odKyWkkWRMAw3FJT2SkW3JpzS21joVke39WMg6clKPnPOn1Pj6cRuddgLvdaHTm5Ij9HfTRGmvYEBCrMygWHzLr/aJZQUTSf8JDWHx5FY7gbHCiW28glE5ngwzJ9iZSr2a9e10OHJnlFSyA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Authentication-Results: debian.org; dkim=none (message not signed) header.d=none;debian.org; dmarc=none action=none header.from=suse.com; Received: from VI1PR04MB4991.eurprd04.prod.outlook.com (2603:10a6:803:57::28) by VI1PR04MB4270.eurprd04.prod.outlook.com (2603:10a6:803:3e::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3955.18; Thu, 18 Mar 2021 11:27:40 +0000 Received: from VI1PR04MB4991.eurprd04.prod.outlook.com ([fe80::28b7:e423:c3d7:7ccf]) by VI1PR04MB4991.eurprd04.prod.outlook.com ([fe80::28b7:e423:c3d7:7ccf%6]) with mapi id 15.20.3933.032; Thu, 18 Mar 2021 11:27:40 +0000 Date: Thu, 18 Mar 2021 19:27:31 +0800 From: Michael Chang To: Colin Watson Cc: The development of GNU GRUB , Marco A Benatto , Javier Martinez Canillas , Daniel Kiper Subject: Re: [PATCH] i386-pc: build verifiers API as module Message-ID: <20210318112731.GA17529@mercury> References: <20210318071434.2814-1-mchang@suse.com> <20210318092340.GA18653@riva.ucam.org> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210318092340.GA18653@riva.ucam.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Originating-IP: [2001:b011:30d0:14af:cb28:3a0c:91f:362b] X-ClientProxiedBy: HK2PR02CA0132.apcprd02.prod.outlook.com (2603:1096:202:16::16) To VI1PR04MB4991.eurprd04.prod.outlook.com (2603:10a6:803:57::28) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from mercury (2001:b011:30d0:14af:cb28:3a0c:91f:362b) by HK2PR02CA0132.apcprd02.prod.outlook.com (2603:1096:202:16::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3955.18 via Frontend Transport; Thu, 18 Mar 2021 11:27:38 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 893b1cae-941b-4b78-2f5d-08d8ea00d6b0 X-MS-TrafficTypeDiagnostic: VI1PR04MB4270: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: p6BaiuXNFYf0CiQXfMNzKXE8e20UC8FteP8GSUKl9u+d+uTa25apBfh8HSsoaOPKn1QMqoQjLaN6pmvMAi37Ky1rFHgR2m4ZHUy3Qaatk7l9RnT/GE+oXAzWJ+1y+oa8tWfl+hqrY9HbukPFL8q3avCr1j/05869FWzqWCXc+ZDQ3Gu3rrSKpUyw9Pc00imDOekP7YVm+QMAlEnwtjgfH1xo6FKJ4H4Zb4616q9u06Z8SuKoOosKq9RyuVlO4Fi988Wr8wH623H3nksgkiA3zsy8Rt/ertPvSiwzcUb3/A3ky01YkP1SyWnJup63tO78zsRdTx7tFz+0zKqDhXi/HAYqeMDxe2wSiia9kBdJeZrQLc1aZnLhZCbA8HjYq742Q/MyB5OTJ9B5cLwAwuF82WXeozZgDuuHXTwghXspTOm+8cPEGFmXGsUu+nwB8ub/TO66fadpgq489Dxp+n9+cZDKlF8CydVRoIECFOgsgzraTev8Bp2Bhn/kPaGa1SeCKbZC1/XcjoDWopdqcySdkR4RC6wJ61GkzGaWS0C15LYwnX5FZw5/nP8QJs1gZrW5YkqwA6TUJxbLf7qFENE2f8Wvdmf2tukdFJ9m5sFkfk/W6hmAD7OuIsWCJu+SkHkh X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB4991.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(396003)(346002)(39860400002)(136003)(366004)(376002)(52116002)(9576002)(83380400001)(33656002)(6916009)(478600001)(6496006)(8676002)(16526019)(8936002)(38100700001)(5660300002)(186003)(9686003)(54906003)(55016002)(1076003)(2906002)(316002)(6666004)(66946007)(66476007)(4326008)(86362001)(66556008)(33716001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?fzA36NIp2qzlveXanXEE47Yip66xkRaUhs67e0dUqFMoDr4fG8OG1XIPksew?= =?us-ascii?Q?SHVA+oGsS+ebsxn/cZoYtS/wHT74cBsWLhiWtJr2flT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5fZyDcJNL4XGQS/ZsA1ZzMfhbvmY2C0HjP7hJ5tOi3lAmgphDHKtC?= =?us-ascii?Q?fn7MJQ02mtSFBgIUy7vWRbBaBi0PLXL3e9oCUaurJZt0/ldfzZIfVflhDXmJ?= =?us-ascii?Q?sL/DM2qzojFuM+pnqbdVw/8maVjW28xv+awtwed1IfbvF39ycrNKt4/XN3nz?= =?us-ascii?Q?p/fbwAcbxNle/RlfkabmOYNxrqr0o2q1JUoSJHY27FXOXhQDq4OdWm3gZrcj?= =?us-ascii?Q?xDrXnlTqumufLYVeoRawnvYye/kb1nx1BS/1OlhNobOsJzUxJzZQgF8O2EZU?= =?us-ascii?Q?VTObn/JVHOE5OTtn6+yPD9aguhsTxT2ZPhW1rrPmCXvXnq3innUYCRy6+q/j?= =?us-ascii?Q?4/f4YY0G7/f3jTh0UiT/uC4Pi9V4m5bPBqIFHmBV9Zhm6tuwcYCHpd2iV3+U?= =?us-ascii?Q?MEKGDK+PRkeK6J3Spyw+4g8Fs2qz?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 893b1cae-941b-4b78-2f5d-08d8ea00d6b0 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB4991.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Mar 2021 11:27:40.1092 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 8TV7C0kI2Dl4RLWGXLCoG3KNbTwo6O0/B4vLMT8Emld+4DLjYdSbFam0Cw1InPzY X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4270 Received-SPF: pass client-ip=194.104.109.102; envelope-from=mchang@suse.com; helo=de-smtp-delivery-102.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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 11:27:48 -0000 On Thu, Mar 18, 2021 at 09:23:40AM +0000, Colin Watson wrote: > 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. If I remember correctly in the past every core image size increase on i386-pc build is counted. IMHO we should keep up with that practice at least in reviewing new release ... > > > +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. Indeed it looks superfluous to invent COND_NOT_i386_pc here. I will fix in next patch. > > > 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. OK. I will add the comment to explain what's going on in next patch. > > If these minor comments are fixed: > > Reviewed-by: Colin Watson Thanks. I will also add your Reviewed-by ... Regards, Michael > > -- > Colin Watson (he/him) [cjwatson@debian.org] >