Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1083592ybz; Wed, 29 Apr 2020 14:45:31 -0700 (PDT) X-Google-Smtp-Source: APiQypKvXHUL2plc3KyDV71MinUtzIuQ5okceIB1jOlwZV1/65Jc+8wG/fmepnNnXKucMv/xBIAr X-Received: by 2002:a17:907:42fe:: with SMTP id oa22mr4490531ejb.98.1588196731639; Wed, 29 Apr 2020 14:45:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588196731; cv=none; d=google.com; s=arc-20160816; b=XEXIMmRJEOIjRmQFegjIgzxXtu/IJkK86egTVsDlFxzGLQr8b6+RwgZ2VPvoEPoaSH doQVGRkcIa4vOMT1XSOW+g9HFhoDOznlER70D6Pl7T9ds1CGbVzxFg7ZmJcaM5ssvi1o E5RVBKQpBBfQc43dNmehSe0ad9BHdDpU3redVkP702plOnU24Izs9BnxpmNgDqgWVkDF iLuMQ9CkQ/7hP5czvOJoDIZNza4LKi7H8dcygwUidNwoT01WzVJsHXC+ZR20gOTLVC0i cJaOqkXkMzXhKL29R99XfJb+O+2oNS2UduHSRJVxSCA+mZHGfv43WZe4WP3l8nSLXYR4 AzVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=S1VRmxpzOP7e7QbS1M3oHx6oIl+BUWLBuoTsu3dEbOA=; b=RMXTd+UlfWk8KUMGcyYI/vhYPEzmog7LeMNDG2b1Z2x5cbs7bMgmV23Y7pF2BDUbsp pD8ixRf3me4E76Wt2DpVOlyvYjq/4VsjufQHui7ILZ25QOsihRX5885aJUiMhnqWV3Cd 79FwYM3750Gdys/RFDBNEWodo/s3W5Ov4LkEhJ7tDJ6UhM9d5Ct8Z4bNKWLjdGjcwv// 4bORwHy87IzzJ0UX9AAMMWhGhuWIabswklFCOVnR2R9HWksHfQpUffzycXILBbZIdS8A tXe0altQ3xomITQ9ZFVgBbucfP0pCdBK5CzlhpwidxudscUANHKsWUuMvHP9NqVESKzl JDPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=V2Bwzdyd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d15si4500328ejj.253.2020.04.29.14.45.07; Wed, 29 Apr 2020 14:45:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=V2Bwzdyd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726929AbgD2VlE (ORCPT + 99 others); Wed, 29 Apr 2020 17:41:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:39294 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726511AbgD2VlE (ORCPT ); Wed, 29 Apr 2020 17:41:04 -0400 Received: from mail-il1-f182.google.com (mail-il1-f182.google.com [209.85.166.182]) (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 F397220B1F; Wed, 29 Apr 2020 21:41:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588196464; bh=PiKJ0Zcclx7zxFJZauZJsh2q/PZ0w2dzU3Qo8l37Nfs=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=V2BwzdyddFOhFfOyL9DMOOSHnupl1FQpNSkINwR7Co3bIN4J54qRfdmEli6CPyE9T JgIZcZwo31vF8opxNxOWb6wssnuXzLSB+S1Gkhp2n3822CBCU8zEbcsuJe2zPMv3+P DyVZcfD0/H86/ZZvefZvaOhOyaawQO+FXyK1z5zM= Received: by mail-il1-f182.google.com with SMTP id m5so3939273ilj.10; Wed, 29 Apr 2020 14:41:03 -0700 (PDT) X-Gm-Message-State: AGi0PubHkJzGP+w1fIXYByolWNeh/EmVwHGjOebi4JD8W0wgyACiML2c 7yfPPkvEZVnXzqaQHZICehP2mvrdhTOBYYd1G+8= X-Received: by 2002:a92:607:: with SMTP id x7mr394396ilg.218.1588196463379; Wed, 29 Apr 2020 14:41:03 -0700 (PDT) MIME-Version: 1.0 References: <20200429174120.1497212-1-nivedita@alum.mit.edu> <20200429174120.1497212-11-nivedita@alum.mit.edu> <20200429213944.GB1621173@rani.riverdale.lan> In-Reply-To: <20200429213944.GB1621173@rani.riverdale.lan> From: Ard Biesheuvel Date: Wed, 29 Apr 2020 23:40:51 +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 23:39, Arvind Sankar wrote: > > On Wed, Apr 29, 2020 at 09:07:32PM +0200, Ard Biesheuvel wrote: > > 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? > > Unfortunately on x86, CONFIG_CMDLINE is not defined if > CONFIG_CMDLINE_BOOL isn't enabled. So turning this into an > IS_ENABLED(CONFIG_CMDLINE_BOOL) causes a compile error when it's > disabled due to CONFIG_CMDLINE being an undeclared symbol. > What about efi_parse_options(CONFIG_CMDLINE ""); ?