Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp259584ybj; Fri, 8 May 2020 11:07:37 -0700 (PDT) X-Google-Smtp-Source: APiQypKaqcwflYp59GIvzY26ftGh2B7nqDOV/yZq5O8Rrp5icHSH09NBz3zk5i/Vaw1P1nYZ0XZ8 X-Received: by 2002:a05:6402:1a49:: with SMTP id bf9mr3385342edb.189.1588961255083; Fri, 08 May 2020 11:07:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588961255; cv=none; d=google.com; s=arc-20160816; b=UyZzRi2T16VlcN3G/M4R+g/uKu5M1VENtc+BnPqTwqWCqTzhg6J0Y4ZBw0DOoL+qg/ v2wEWwdYC5E0Sty210OF4Imu5+GI/IDwdcVFEzcfiFCuKPcn2noExdiv5kcOxfdSTysZ erbC8HthNO6GxzWd9F+2/mlot2LpCxUxLibp5/toiFepSHdUpAZjTNLlP5mmkNc6HTLk 4nqoFqcUilL55Qpa+2lnSFkMZPokUd+YFJeg2hshc0fqvyJOojE5R7CVig2lzBCUpboA vRiNLUixOFCTfp2pqofngnh3fsIwsYMwypVG6rLs3bWKbUMHg8v+Uvd/clvE7i0dorDA 940Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=RYb/LSHxhoDWUNUrcfvb5+QaJ4mvKULu2LBTn15N9to=; b=pUOuQn8TvEAZ53sCkcbuMdwlH434HSTrg43x4+fKzuEBSIibDbfy9Tf0UuaTxVX7Rx ZIi+VUYaV7bi5139eoRoNL6cCBVvV3qJYUQsdHVpftqpx+VpHfCDwQnVNQE9nf4DhIb7 12HNoszT7JTShEBXYT+NN9NPUceWX8yCuK1DCPJ/xrkDDQ9I5G7BF8PlWNZLEGMFA1rB FSbb8/bukOLra1qTrs9yQNTcmANMWv694+0lgZpCOS111UTES/W/vvqI5b+0CmT50xJq SFAC+DY4Jpn55XsraKnoyYVfSVJOMwYo3X7eOVHOxjokime58Avkf2/T7aA66AvfCEDq vKrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="2UAI6X/n"; 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 mh4si1369929ejb.385.2020.05.08.11.07.11; Fri, 08 May 2020 11:07:35 -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="2UAI6X/n"; 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 S1727907AbgEHSCu (ORCPT + 99 others); Fri, 8 May 2020 14:02:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:48294 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727978AbgEHSCq (ORCPT ); Fri, 8 May 2020 14:02:46 -0400 Received: from e123331-lin.nice.arm.com (amontpellier-657-1-18-247.w109-210.abo.wanadoo.fr [109.210.65.247]) (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 4B3AA24958; Fri, 8 May 2020 18:02:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588960966; bh=WTukNKpKjk8cOI4uPZY4UeJ1dYYW706w8hy+2fahylY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2UAI6X/nBupzoFacpraPzq49FlH9Q3AzcBI8fCBaPkDNc0e34yiKDRM4XSWxCsgMt 7NUkshxZPIXSGAdbEP/8fOvH6oLyfLLFc3EIdqVrRT9sT+GxbQChkS+Z8li6a8utNH 0DbdR1Ub7MW4aeX0l9eubwfIzD51KJnCTsiqJlsw= From: Ard Biesheuvel To: linux-efi@vger.kernel.org, Ingo Molnar , Thomas Gleixner Cc: Ard Biesheuvel , linux-kernel@vger.kernel.org, Arnd Bergmann , Arvind Sankar , Guenter Roeck , Joe Perches Subject: [PATCH 10/15] efi/x86: Support builtin command line Date: Fri, 8 May 2020 20:01:52 +0200 Message-Id: <20200508180157.1816-11-ardb@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200508180157.1816-1-ardb@kernel.org> References: <20200508180157.1816-1-ardb@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arvind Sankar Add support for the x86 CMDLINE_BOOL and CMDLINE_OVERRIDE configuration options. Signed-off-by: Arvind Sankar Link: https://lore.kernel.org/r/20200430182843.2510180-11-nivedita@alum.mit.edu Signed-off-by: Ard Biesheuvel --- 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 f1a134596b53..c84c5678e3e1 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 + 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.17.1