From patchwork Wed Aug 12 17:42:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trammell Hudson X-Patchwork-Id: 11711089 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D36E314F6 for ; Wed, 12 Aug 2020 17:43:44 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id ADDEA20781 for ; Wed, 12 Aug 2020 17:43:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=trmm.net header.i=@trmm.net header.b="x3zn6dVh" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ADDEA20781 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=trmm.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k5umA-0008Fe-6V; Wed, 12 Aug 2020 17:42:58 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k5um9-0008FZ-0w for xen-devel@lists.xenproject.org; Wed, 12 Aug 2020 17:42:57 +0000 X-Inumbo-ID: 9ddaa9bd-cdeb-4a29-9891-5170fa170552 Received: from mail-40131.protonmail.ch (unknown [185.70.40.131]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 9ddaa9bd-cdeb-4a29-9891-5170fa170552; Wed, 12 Aug 2020 17:42:54 +0000 (UTC) Date: Wed, 12 Aug 2020 17:42:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trmm.net; s=protonmail; t=1597254173; bh=TncjQOnANMp/VJE2TG6+QX42ZO3WtSPCWr/QYT0LTKM=; h=Date:To:From:Reply-To:Subject:From; b=x3zn6dVh0rznrzRzzDah5hzza0Ec61+Dt4ZSm9S9bpOnaPkqsrdtejmV0RsWzWfsi mfYuDnacvo/0Bvjh7xR0jnI9nlQsAV8F+1hPBC3VUz5Yg4J/ZCmhrun/kaUzcRJXo+ bb1NFVKUti2515BaSa+3eWjY52a4J5wGO0xrUJLI= To: Xen-devel From: Trammell Hudson Subject: [PATCH] arch/x86/setup.c: Ignore early boot parameters like no-real-mode Message-ID: MIME-Version: 1.0 X-Spam-Status: No, score=-1.2 required=7.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mail.protonmail.ch X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Reply-To: Trammell Hudson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" There are parameters in xen/arch/x86/boot/cmdline.c that are only used early in the boot process, so handlers are necessary to avoid an "Unknown command line option" in dmesg. This also updates ignore_param() to generate a temporary variable name so that the macro can be used more than once per file. Signed-off-by: Trammell hudson diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c index c9b6af8..4b15e06 100644 --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -679,6 +679,15 @@ static void __init noreturn reinit_bsp_stack(void) reset_stack_and_jump_nolp(init_done); } +/* + * x86 early command line parsing in xen/arch/x86/boot/cmdline.c + * has options that are only used during the very initial boot process, + * so they can be ignored now. + */ +ignore_param("no-real-mode"); +ignore_param("edd"); +ignore_param("edid"); + /* * Some scripts add "placeholder" to work around a grub error where it ate the * first parameter. diff --git a/xen/include/xen/param.h b/xen/include/xen/param.h index c2fd075..b77f7f2 100644 --- a/xen/include/xen/param.h +++ b/xen/include/xen/param.h @@ -35,6 +35,10 @@ extern const struct kernel_param __setup_start[], __setup_end[]; __attribute__((__aligned__(1))) char #define __kparam __param(__initsetup) +#define __TEMP_NAME(base,line) base##_##line +#define _TEMP_NAME(base,line) __TEMP_NAME(base,line) +#define TEMP_NAME(base) _TEMP_NAME(base,__LINE__) + #define custom_param(_name, _var) \ __setup_str __setup_str_##_var[] = _name; \ __kparam __setup_##_var = \ @@ -71,9 +75,9 @@ extern const struct kernel_param __setup_start[], __setup_end[]; .len = sizeof(_var), \ .par.var = &_var } #define ignore_param(_name) \ - __setup_str setup_str_ign[] = _name; \ - __kparam setup_ign = \ - { .name = setup_str_ign, \ + __setup_str TEMP_NAME(__setup_str_ign)[] = _name; \ + __kparam TEMP_NAME(__setup_ign) = \ + { .name = TEMP_NAME(__setup_str_ign), \ .type = OPT_IGNORE } #ifdef CONFIG_HYPFS