From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 195DD606A31E for ; Thu, 26 Nov 2026 11:28:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=PFPqDKm3; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=k3kFIR10 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Unsubscribe-Post: List-Owner; bh=zImSfvTk7Ce9C0Ntm689zz11A7MeuyzdnAnXV7c96Hs=; b=PFPqDKm3MK5WEm Eqc6Ob7Sf3t+AFF442h4eel1fWHVA33P47Mm+M/Vjn8d8lIbmpJFwe4TBYJ+hnHWM8lFYECxDzY/P 0Bu3mtRoGqZtsPMGOOtSfjx7yk29vyjTXUpvbGJLGe3/vI/WKT/KQnUrWxzCC2vVwuJjSrcOvYvPD 8hrocwaT4y80yd9LGlTrAPy2sqFXP06MVsCJNpQoeW9AI63EfwA8Pv9EFu1lRN3tVoXIvk6BhZJHj lbISyvqX6RLWytJ3jeBOJyfmlq55cmoI46qTEjkONz2pqS4hJm51r68qEc+Ue3nK6He9NT93ZceZ2 1NHkdG3qEB6AWcBWSHGw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xWXS2-0000000CqNG-49Ez; Thu, 26 Nov 2026 11:15:42 +0000 Received: from sea.source.kernel.org ([2600:3c0a:e001:78e:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xWXRi-0000000Cq38-2aVp; Thu, 26 Nov 2026 11:15:22 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 5D98643224; Thu, 26 Nov 2026 11:15:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8FCDB1F00AE3; Thu, 26 Nov 2026 11:15:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795691722; bh=zImSfvTk7Ce9C0Ntm689zz11A7MeuyzdnAnXV7c96Hs=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=k3kFIR107EfL7OCOXCU8Gw8+wFHgYeB6pwLpvAtrtxNruSbP+IxmvekCmPdAtQpU6 UY9gwt+R1jj/XLJxRSkgFV/NN1dqYd2vaEiNbba2VGjRRqrndAy3W3NDIYMGpwGJdL 5I5xoLA6NN9oPGIT+cll+4qCT2QAsDrYc+8BocCiyQFLGSboxGfTEYTroUEdlDxo+c GWTUcL/DyD6jX5uwq92MnSCE+qN75XIupuUympUcKEE9nsukylR8tAJqmagsFaNpi4 wqNpEf6O3v9v4sAEU0M1bRVvAdcO5ESPqGmgBJIygD3v50tp7Tk1xNsDGMbHsOcixL hxaqNlHeGhMdg== From: "Mike Rapoport (Microsoft)" Date: Thu, 26 Nov 2026 13:14:18 +0200 Subject: [PATCH RFC v2 05/54] s390/boot: treat dashes and underscores alike in parameter names X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20261126-generic-set-memory-v0-1-v2-5-723f1e33c3d8@kernel.org> References: <20261126-generic-set-memory-v0-1-v2-0-723f1e33c3d8@kernel.org> In-Reply-To: <20261126-generic-set-memory-v0-1-v2-0-723f1e33c3d8@kernel.org> To: linux-mm@kvack.org Cc: =?utf-8?q?Adrian_Barna=C5=9B?= , Alexander Gordeev , Andrew Morton , Andy Lutomirski , Arnd Bergmann , Borislav Petkov , Brendan Jackman , Catalin Marinas , Dave Hansen , David Hildenbrand , Gerald Schaefer , Heiko Carstens , Huacai Chen , Ingo Molnar , Kevin Brodsky , "Liam R. Howlett" , Lorenzo Stoakes , Madhavan Srinivasan , Michal Hocko , Mike Rapoport , Palmer Dabbelt , Paul Walmsley , Peter Zijlstra , Russell King , Suren Baghdasaryan , Thomas Gleixner , Vasily Gorbik , Vlastimil Babka , Will Deacon , linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev, x86@kernel.org X-Mailer: b4 0.16.1-dev X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-18.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 Dashes and underscores are equivalent in the names of kernel parameters, and the kernel compares the names with parameq(). The decompressor uses strcmp(), so it ignores "relocate-lowcore" or "prot-virt=1". Compare the names like parameq() does. Signed-off-by: Mike Rapoport (Microsoft) --- arch/s390/boot/ipl_parm.c | 51 ++++++++++++++++++++++++++++++++--------------- 1 file changed, 35 insertions(+), 16 deletions(-) diff --git a/arch/s390/boot/ipl_parm.c b/arch/s390/boot/ipl_parm.c index ed28ea2fc1d1..ac4cf1ced71d 100644 --- a/arch/s390/boot/ipl_parm.c +++ b/arch/s390/boot/ipl_parm.c @@ -255,6 +255,25 @@ static void modify_fac_list(char *str) check_cleared_facilities(); } +static char dash2underscore(char c) +{ + if (c == '-') + return '_'; + return c; +} + +/* Dashes and underscores are equivalent in parameter names */ +static bool parameq(const char *a, const char *b) +{ + size_t i, n = strlen(a) + 1; + + for (i = 0; i < n; i++) { + if (dash2underscore(a[i]) != dash2underscore(b[i])) + return false; + } + return true; +} + void parse_boot_command_line(void) { char *param, *val; @@ -272,15 +291,15 @@ void parse_boot_command_line(void) if (!val && !strcmp(param, "--")) break; - if (!strcmp(param, "mem") && val) + if (parameq(param, "mem") && val) memory_limit = round_down(memparse(val, NULL), PAGE_SIZE); - if (!strcmp(param, "vmalloc") && val) { + if (parameq(param, "vmalloc") && val) { vmalloc_size = round_up(memparse(val, NULL), _SEGMENT_SIZE); vmalloc_size_set = 1; } - if (!strcmp(param, "dfltcc") && val) { + if (parameq(param, "dfltcc") && val) { if (!strcmp(val, "off")) zlib_dfltcc_support = ZLIB_DFLTCC_DISABLED; else if (!strcmp(val, "on")) @@ -293,49 +312,49 @@ void parse_boot_command_line(void) zlib_dfltcc_support = ZLIB_DFLTCC_FULL_DEBUG; } - if (!strcmp(param, "facilities") && val) + if (parameq(param, "facilities") && val) modify_fac_list(val); - if (!strcmp(param, "debug-alternative")) + if (parameq(param, "debug-alternative")) alt_debug_setup(val); - if (!strcmp(param, "nokaslr")) + if (parameq(param, "nokaslr")) __kaslr_enabled = 0; - if (!strcmp(param, "cmma")) { + if (parameq(param, "cmma")) { rc = kstrtobool(val, &enabled); if (!rc && !enabled) cmma_flag = 0; } #ifdef CONFIG_STACKPROTECTOR - if (!strcmp(param, "debug_stackprotector")) + if (parameq(param, "debug_stackprotector")) stack_protector_debug = 1; #endif #if IS_ENABLED(CONFIG_KVM) - if (!strcmp(param, "prot_virt")) { + if (parameq(param, "prot_virt")) { rc = kstrtobool(val, &enabled); if (!rc && enabled) prot_virt_host = 1; } #endif - if (!strcmp(param, "relocate_lowcore") && test_facility(193)) + if (parameq(param, "relocate_lowcore") && test_facility(193)) set_machine_feature(MFEATURE_LOWCORE); - if (!strcmp(param, "earlyprintk")) + if (parameq(param, "earlyprintk")) boot_earlyprintk = true; - if (!strcmp(param, "debug")) + if (parameq(param, "debug")) boot_console_loglevel = CONSOLE_LOGLEVEL_DEBUG; - if (!strcmp(param, "bootdebug")) { + if (parameq(param, "bootdebug")) { bootdebug = true; if (val) strscpy(bootdebug_filter, val); } - if (!strcmp(param, "quiet")) + if (parameq(param, "quiet")) boot_console_loglevel = CONSOLE_LOGLEVEL_QUIET; - if (!strcmp(param, "ignore_loglevel")) + if (parameq(param, "ignore_loglevel")) boot_ignore_loglevel = true; - if (!strcmp(param, "loglevel")) { + if (parameq(param, "loglevel")) { boot_console_loglevel = simple_strtoull(val, NULL, 10); if (boot_console_loglevel < CONSOLE_LOGLEVEL_MIN) boot_console_loglevel = CONSOLE_LOGLEVEL_MIN; -- 2.53.0