From patchwork Sat Dec 25 05:12:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12699173 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 694DFC433FE for ; Sat, 25 Dec 2021 05:12:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DB3186B0078; Sat, 25 Dec 2021 00:12:42 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D3B7A6B007B; Sat, 25 Dec 2021 00:12:42 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C2D9D6B007D; Sat, 25 Dec 2021 00:12:42 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0168.hostedemail.com [216.40.44.168]) by kanga.kvack.org (Postfix) with ESMTP id B3CA06B0078 for ; Sat, 25 Dec 2021 00:12:42 -0500 (EST) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 73E9E180E4EC7 for ; Sat, 25 Dec 2021 05:12:42 +0000 (UTC) X-FDA: 78955146564.01.627BD71 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf31.hostedemail.com (Postfix) with ESMTP id E586120043 for ; Sat, 25 Dec 2021 05:12:26 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 11E14B80B1E; Sat, 25 Dec 2021 05:12:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 91A9DC36AE5; Sat, 25 Dec 2021 05:12:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1640409159; bh=DWeIuh07cHVZm8NJyw4rNMyS8/atCEUdEw3jcDbjF88=; h=Date:From:To:Subject:In-Reply-To:From; b=efX1t84J+mapk1BAjbQMpw5Wy8c7SdDF5lQkCDyiezcAjJbK+TrB4Ar8eNC740l4R aBA7+Aagu6DcS+mNTr9HwnCVfKW1fHSXRRr5GVWq+B2u2TZi6ymgt6oINfxsmgCSzt HP2ulGfKeaH3JZEPizPNbYLpJ7F/ZektArsGF/9k= Date: Fri, 24 Dec 2021 21:12:39 -0800 From: Andrew Morton To: ahalaney@redhat.com, akpm@linux-foundation.org, bhe@redhat.com, linux-mm@kvack.org, mm-commits@vger.kernel.org, prudo@redhat.com, torvalds@linux-foundation.org Subject: [patch 3/9] kernel/crash_core: suppress unknown crashkernel parameter warning Message-ID: <20211225051239.TPFjGNEo6%akpm@linux-foundation.org> In-Reply-To: <20211224211127.30b60764d059ff3b0afea38a@linux-foundation.org> User-Agent: s-nail v14.8.16 X-Stat-Signature: m8b4n87fcixp6eq6qar1e9qhpyd8db15 X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: E586120043 Authentication-Results: imf31.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=efX1t84J; spf=pass (imf31.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-HE-Tag: 1640409146-526184 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Philipp Rudo Subject: kernel/crash_core: suppress unknown crashkernel parameter warning When booting with crashkernel= on the kernel command line a warning similar to [ 0.038294] Kernel command line: ro console=ttyS0 crashkernel=256M [ 0.038353] Unknown kernel command line parameters "crashkernel=256M", will be passed to user space. is printed. This comes from crashkernel= being parsed independent from the kernel parameter handling mechanism. So the code in init/main.c doesn't know that crashkernel= is a valid kernel parameter and prints this incorrect warning. Suppress the warning by adding a dummy early_param handler for crashkernel=. Link: https://lkml.kernel.org/r/20211208133443.6867-1-prudo@redhat.com Fixes: 86d1919a4fb0 ("init: print out unknown kernel parameters") Signed-off-by: Philipp Rudo Acked-by: Baoquan He Cc: Andrew Halaney Signed-off-by: Andrew Morton --- kernel/crash_core.c | 11 +++++++++++ 1 file changed, 11 insertions(+) --- a/kernel/crash_core.c~kernel-crash_core-suppress-unknown-crashkernel-parameter-warning +++ a/kernel/crash_core.c @@ -6,6 +6,7 @@ #include #include +#include #include #include @@ -295,6 +296,16 @@ int __init parse_crashkernel_low(char *c "crashkernel=", suffix_tbl[SUFFIX_LOW]); } +/* + * Add a dummy early_param handler to mark crashkernel= as a known command line + * parameter and suppress incorrect warnings in init/main.c. + */ +static int __init parse_crashkernel_dummy(char *arg) +{ + return 0; +} +early_param("crashkernel", parse_crashkernel_dummy); + Elf_Word *append_elf_note(Elf_Word *buf, char *name, unsigned int type, void *data, size_t data_len) {