Received: by 10.223.164.202 with SMTP id h10csp247072wrb; Wed, 29 Nov 2017 21:24:17 -0800 (PST) X-Google-Smtp-Source: AGs4zMaiMoScvLQ9yB4MabZYDQsIHuB7cEUyTl7KLf7/ARRYpL9melenMRcxJQYXPAL/WDc6dr1b X-Received: by 10.84.140.1 with SMTP id 1mr1383200pls.114.1512019457087; Wed, 29 Nov 2017 21:24:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512019457; cv=none; d=google.com; s=arc-20160816; b=ZbG3y71v2WeawsjBLNrJhXSDshe9J+is/I5y34/rznkNs4FLTrxPVfTU6byv+zbQnX Pwoa8sJCf7aONw0IIRbPgd8AQNppdmDndLWhwHRuxiXAm51ZjQKBy4pmz6Kxb9ehTqYM rBhFs9zTgTyzug1C6H/FzWB2c8PXrQPh3BXJEumu2KL7CSVLK29ETqCNTBX6iU5Kr+8M ol5mVV/fRDPTxSIqCqTZ4Se+h3Zd0hOGXOT0Xr+t5ZEug8chrCiYoDl0ufcI/2OLyxJZ 9t/HJ4PLvpKZM3mnYYLySrKxEvRRRvdkfB1Ck3CFTWxZGL786Md9vLMl48oHBlcU1D9U 7biQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date :arc-authentication-results; bh=c75hCtCsKFvxYHV6Or6kPpgVtEmo0OFMIKXz47UHzY8=; b=VUWw0PYDKS5nX+1MAg16aukSjffJN9+Tht5/uX45rilzHBTGf8kL4/SjwtIAFPIrk7 CujxmeE0QH6HH00MxXLbLps1pz1zHeuWD7mvKo+r32rVqF/ungbStikeD5Tanv5ml14n Zv2XZE4AFkyafidRsrc12LMvbwZ6/pjZez3r6jc/Sc6GqQLHFxDEFuK6W4PZsvPdkvcF I/FYzdA1MqihFD/HOriTcne9Nu3pqXnT+gtgwtiIh7B1mAlLVY/Svap3bWqVFAZ70Yyg Ba3AxwaI2CTZzVzn7a+pVbl7qc8v492DyoURSc0ojM98NFUjP20YrBSsdSPotIMBRKKM V57A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x189si2586735pfx.395.2017.11.29.21.24.03; Wed, 29 Nov 2017 21:24:17 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750964AbdK3FXg (ORCPT + 99 others); Thu, 30 Nov 2017 00:23:36 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35862 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750747AbdK3FXe (ORCPT ); Thu, 30 Nov 2017 00:23:34 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BCD51883C3; Thu, 30 Nov 2017 05:23:34 +0000 (UTC) Received: from dhcp-128-65.nay.redhat.com (ovpn-12-26.pek2.redhat.com [10.72.12.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B1EA960569; Thu, 30 Nov 2017 05:23:31 +0000 (UTC) Date: Thu, 30 Nov 2017 13:23:27 +0800 From: Dave Young To: linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org Cc: mingo@kernel.org, ard.biesheuvel@linaro.org, matt@codeblueprint.co.uk Subject: [PATCH] x86: move parse_early_param to earlier code for add_efi_memmap Message-ID: <20171130052327.GA3500@dhcp-128-65.nay.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.9.1 (2017-09-22) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 30 Nov 2017 05:23:34 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 'add_efi_memmap' is an early param, but do_add_efi_memmap() has no chance to run because the code path is before parse_early_param(). I believe it worked when the param was introduced but probably later some other changes caused the wrong order and nobody noticed it. Move parse_early_param before efi_memblock_x86_reserve_range to fix this. Signed-off-by: Dave Young --- arch/x86/kernel/setup.c | 55 ++++++++++++++++++++++++------------------------ 1 file changed, 28 insertions(+), 27 deletions(-) --- linux-x86.orig/arch/x86/kernel/setup.c +++ linux-x86/arch/x86/kernel/setup.c @@ -897,6 +897,34 @@ void __init setup_arch(char **cmdline_p) rd_prompt = ((boot_params.hdr.ram_size & RAMDISK_PROMPT_FLAG) != 0); rd_doload = ((boot_params.hdr.ram_size & RAMDISK_LOAD_FLAG) != 0); #endif + +#ifdef CONFIG_CMDLINE_BOOL +#ifdef CONFIG_CMDLINE_OVERRIDE + strlcpy(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE); +#else + if (builtin_cmdline[0]) { + /* append boot loader cmdline to builtin */ + strlcat(builtin_cmdline, " ", COMMAND_LINE_SIZE); + strlcat(builtin_cmdline, boot_command_line, COMMAND_LINE_SIZE); + strlcpy(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE); + } +#endif +#endif + + strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE); + *cmdline_p = command_line; + + /* + * x86_configure_nx() is called before parse_early_param() to detect + * whether hardware doesn't support NX (so that the early EHCI debug + * console setup can safely call set_fixmap()). It may then be called + * again from within noexec_setup() during parsing early parameters + * to honor the respective command line option. + */ + x86_configure_nx(); + + parse_early_param(); + #ifdef CONFIG_EFI if (!strncmp((char *)&boot_params.efi_info.efi_loader_signature, EFI32_LOADER_SIGNATURE, 4)) { @@ -935,33 +963,6 @@ void __init setup_arch(char **cmdline_p) bss_resource.start = __pa_symbol(__bss_start); bss_resource.end = __pa_symbol(__bss_stop)-1; -#ifdef CONFIG_CMDLINE_BOOL -#ifdef CONFIG_CMDLINE_OVERRIDE - strlcpy(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE); -#else - if (builtin_cmdline[0]) { - /* append boot loader cmdline to builtin */ - strlcat(builtin_cmdline, " ", COMMAND_LINE_SIZE); - strlcat(builtin_cmdline, boot_command_line, COMMAND_LINE_SIZE); - strlcpy(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE); - } -#endif -#endif - - strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE); - *cmdline_p = command_line; - - /* - * x86_configure_nx() is called before parse_early_param() to detect - * whether hardware doesn't support NX (so that the early EHCI debug - * console setup can safely call set_fixmap()). It may then be called - * again from within noexec_setup() during parsing early parameters - * to honor the respective command line option. - */ - x86_configure_nx(); - - parse_early_param(); - #ifdef CONFIG_MEMORY_HOTPLUG /* * Memory used by the kernel cannot be hot-removed because Linux From 1585445770635975643@xxx Wed Nov 29 23:41:51 +0000 2017 X-GM-THRID: 1585445770635975643 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread