From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6F305C83007 for ; Wed, 29 Apr 2020 19:07:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 48970205C9 for ; Wed, 29 Apr 2020 19:07:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588187265; bh=70/Qtp8JNfEX5//G0orLObh5VqUnEg2kq8b3aA7czoY=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-ID:From; b=zRBWm+EEpmk5UC8ZSl2F/bjma6Lr25yh3AZIjMVtg0SNgCyQkZKcOekUXQHazChlL DEQTF5zu4xVNkz3tu10s7Z+kYhkDOlAbCNNldq2vtQSP286j50VCE8wg/hN6B2reFy QFfTPqC85bO7rWfreeCScTNK3xKmH3xJ4BaXGKas= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727087AbgD2THo (ORCPT ); Wed, 29 Apr 2020 15:07:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:44590 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726456AbgD2THo (ORCPT ); Wed, 29 Apr 2020 15:07:44 -0400 Received: from mail-io1-f52.google.com (mail-io1-f52.google.com [209.85.166.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 935B1205C9; Wed, 29 Apr 2020 19:07:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588187263; bh=70/Qtp8JNfEX5//G0orLObh5VqUnEg2kq8b3aA7czoY=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=Q/edQAiHUPqyTnynxIRYwuRac0ucWkio5V94MHB7kJseis6f1V90xV0iEu2r9m+uX KiuGO3wIKMzBR0aDv270D070dzx7C8O7JPNsDxe4D6B3gAEG/cU0YFoTfmP4myHWDN LlSyURB3frGzdbehjRakvrcIsNmhGCs1RA0wwt70= Received: by mail-io1-f52.google.com with SMTP id w4so3455517ioc.6; Wed, 29 Apr 2020 12:07:43 -0700 (PDT) X-Gm-Message-State: AGi0PuadGohAyjHpF6DUIyxovgZuG1Ce4jE3j08Og16N+2m1pCpmGt3R 3UNcTf78CSB4eC4iWgufPpzm3qkKdSnK1VcfQQs= X-Google-Smtp-Source: APiQypIjDe2LaryNktyvdsE5AqmMfsCyjNFIxAp+7DQaFSQDI81FXSIlPfXk/ajIyUPs96MPgeNC7JKPCMFOOO4hwBM= X-Received: by 2002:a02:8247:: with SMTP id q7mr9982215jag.68.1588187263019; Wed, 29 Apr 2020 12:07:43 -0700 (PDT) MIME-Version: 1.0 References: <20200429174120.1497212-1-nivedita@alum.mit.edu> <20200429174120.1497212-11-nivedita@alum.mit.edu> In-Reply-To: <20200429174120.1497212-11-nivedita@alum.mit.edu> From: Ard Biesheuvel Date: Wed, 29 Apr 2020 21:07:32 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 09/10] efi/x86: Support builtin command line To: Arvind Sankar Cc: linux-efi , X86 ML , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 29 Apr 2020 at 19:41, Arvind Sankar wrote: > > Add support for the x86 CMDLINE_BOOL and CMDLINE_OVERRIDE configuration > options. > > Signed-off-by: Arvind Sankar > --- > drivers/firmware/efi/libstub/x86-stub.c | 12 ++++++++---- > 1 file changed, 8 insertions(+), 4 deletions(-) > > diff --git a/drivers/firmware/efi/libstub/x86-stub.c b/drivers/firmware/efi/libstub/x86-stub.c > index 85a924fecc87..0faba30d6406 100644 > --- a/drivers/firmware/efi/libstub/x86-stub.c > +++ b/drivers/firmware/efi/libstub/x86-stub.c > @@ -680,7 +680,6 @@ unsigned long efi_main(efi_handle_t handle, > unsigned long buffer_start, buffer_end; > struct setup_header *hdr = &boot_params->hdr; > efi_status_t status; > - unsigned long cmdline_paddr; > > efi_system_table = sys_table_arg; > > @@ -739,9 +738,14 @@ unsigned long efi_main(efi_handle_t handle, > image_offset = 0; > } > > - cmdline_paddr = ((u64)hdr->cmd_line_ptr | > - ((u64)boot_params->ext_cmd_line_ptr << 32)); > - efi_parse_options((char *)cmdline_paddr); > +#ifdef CONFIG_CMDLINE_BOOL > + efi_parse_options(CONFIG_CMDLINE); > +#endif Can we use IS_ENABLED() here as well? > + if (!IS_ENABLED(CONFIG_CMDLINE_OVERRIDE)) { > + unsigned long cmdline_paddr = ((u64)hdr->cmd_line_ptr | > + ((u64)boot_params->ext_cmd_line_ptr << 32)); > + efi_parse_options((char *)cmdline_paddr); > + } > > /* > * At this point, an initrd may already have been loaded by the > -- > 2.26.2 >