From patchwork Mon Dec 6 16:05:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 12694914 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 97EDCC433EF for ; Mon, 6 Dec 2021 16:14:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=aVIAosgFv9u9kDDmctsBnSqZMRVV4Zv0q72fn3dBr3s=; b=ZBjICqk2jgf3ye UwEYdo7UKnm4G7K6V0gjq36mm92VzbBrfgN1efjFwVnGvy0GKu/HD8QFr2hJcoAkT1hs/iaOsL8VY /iaFFo0PrEnWVvx470F7wjQKzTz8vFzeoPBawsO9axN8gYWuZpXyhvJnOWAHJaJF5Yk7q6Z837wHF PU3xcsAUwazQ4eqSKWlaPGcDaa9J050AJ0c/QLIPLux21lee5PhVFmeWyoLZPYM1SA44Dvxrxn+Vd 5exqyImwurJ3HLWt3OFVrsilLEQtFKRi5GZrFp+8FiV0Ot2jZRAmBvY4L9/RuW3p+/J2Z1m6Dglnl z2UYphqmkOdIrEN9aEOw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1muGbk-004gkR-Fq; Mon, 06 Dec 2021 16:12:52 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1muGbV-004gfY-65; Mon, 06 Dec 2021 16:12:38 +0000 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 sin.source.kernel.org (Postfix) with ESMTPS id 5895ECE16C8; Mon, 6 Dec 2021 16:12:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7B956C341C5; Mon, 6 Dec 2021 16:12:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1638807153; bh=Pwe0wYHKG5lxvAb6z5/hTI+22/H72lsdHUeOXryUv9w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HTthzCPNXZsIEG0DB5CS9wiZM+kKPI1cgbZDwA9kKTHfyUBjdHKrDbAEmobT7ni5a xTnX6fk/MLonIW5znbVYv62epkKB55ZMZNvFFyi6kSxZr0I7Xytz3hjl4MtU6Xbyvp xxtrwjuSuqwMs8EyXxLd60XZuGfwz1naw9L5M7eYhlz5H8xnwfjZ0iFOHYwJUuqnyb +VzDdARPnLckFenOQOuw+/RKJMof/D1wBE3OTD3aHgwO56dUQV4QwMTzx2XBVPwUv6 5L4nOMXBFT7QXKqK5WeBs1KEX4dCrxLYmkprqqk4aq5+OpMvF1mYasqr/ua1YA6pbK RRj8yZHjFUZ3Q== From: Jisheng Zhang To: Russell King , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, hpa@zytor.com, Eric Biederman Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, kexec@lists.infradead.org, Alexandre ghiti Subject: [PATCH v2 1/5] kexec: make crashk_res, crashk_low_res and crash_notes symbols always visible Date: Tue, 7 Dec 2021 00:05:10 +0800 Message-Id: <20211206160514.2000-2-jszhang@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20211206160514.2000-1-jszhang@kernel.org> References: <20211206160514.2000-1-jszhang@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211206_081237_414191_A352B3D1 X-CRM114-Status: GOOD ( 12.77 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Make the forward declarations of crashk_res, crashk_low_res and crash_notes always visible. Code referring to these symbols can then just check for IS_ENABLED(CONFIG_KEXEC_CORE), instead of requiring conditional compilation using an #ifdef, thus preparing to increase compile coverage and simplify the code. Signed-off-by: Jisheng Zhang --- include/linux/kexec.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/linux/kexec.h b/include/linux/kexec.h index 0c994ae37729..58d1b58a971e 100644 --- a/include/linux/kexec.h +++ b/include/linux/kexec.h @@ -20,6 +20,12 @@ #include +/* Location of a reserved region to hold the crash kernel. + */ +extern struct resource crashk_res; +extern struct resource crashk_low_res; +extern note_buf_t __percpu *crash_notes; + #ifdef CONFIG_KEXEC_CORE #include #include @@ -350,12 +356,6 @@ extern int kexec_load_disabled; #define KEXEC_FILE_FLAGS (KEXEC_FILE_UNLOAD | KEXEC_FILE_ON_CRASH | \ KEXEC_FILE_NO_INITRAMFS) -/* Location of a reserved region to hold the crash kernel. - */ -extern struct resource crashk_res; -extern struct resource crashk_low_res; -extern note_buf_t __percpu *crash_notes; - /* flag to track if kexec reboot is in progress */ extern bool kexec_in_progress; From patchwork Mon Dec 6 16:05:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 12694915 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 47B58C433EF for ; Mon, 6 Dec 2021 16:14:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=hDhT2M/Nfwkis6VZ5uSaeM65HH8cLk2wKrn8IB/st3M=; b=FHk+sbi7nI1i4O dGUq7A6QKnepDLtFsytihUh7ft0g5jNkQP3fWLt4L+fd2JrXEX6/BZInb75HEdr+MfYugV8zBIRR/ 90rvGYDJyAS70v/LeltWcwKwE5CAvA5U8t7yxI8B7hZnaP0tNuO7sQPjiAo0CRwPm8ygG0ngll+TK v7tMfJIK3sTOusvZub1BddJbi+gcVzlxYrAmLYNvHmKMJDi9OKCZFhyWCkfL1brJMaODWF33j5QA9 /ofXrio0N/AYacHURIEwt6pNXzbjJZMsMX0MgTww6wAEsg2acU4nUFnjC9Dps5fTQVafhzIZkH+Rh 7o+vqMdeo+40CRJELVtA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1muGbz-004gsu-QO; Mon, 06 Dec 2021 16:13:08 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1muGbX-004ggd-Jo; Mon, 06 Dec 2021 16:12:40 +0000 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 dfw.source.kernel.org (Postfix) with ESMTPS id 10BBF61366; Mon, 6 Dec 2021 16:12:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 13504C341C6; Mon, 6 Dec 2021 16:12:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1638807158; bh=FbVUfMtlrUmynM5GSIR2jyniuTQu6HS+1BJoIHuyhIg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nvQ+cK5HnoWNb/L0NqoY7XfHUz5r4CqrLksxkylnrp990aoQ1ZBiJZcwZfCTs22p0 nmIFLmqu9cif6hoTjgAwJNvQzvWHGm8RlixRySanrkS0shvhqTERJEqjAPDBzJR4Ko n+QHCF+u4Ew5xuWvsF9/cfMNdUCskqH0g6CgyJNxnSV8Oay7d/mxUs7jBT3gAPzLZp eOsqjixa9h1hl5MNrSnfkBZPYi0rtfRr1StTEELG6iJ5JaU68Hax8n7i+31/HfxSnj BRu2e0iplUwnUBTlqZbtc4FFlFHKzv73g2WfLrYDsjKsvKOOC0VNbn3pD80tGsmUAm 8TglsEVNIVBEA== From: Jisheng Zhang To: Russell King , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, hpa@zytor.com, Eric Biederman Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, kexec@lists.infradead.org, Alexandre ghiti Subject: [PATCH v2 2/5] riscv: mm: init: use IS_ENABLED(CONFIG_KEXEC_CORE) instead of #ifdef Date: Tue, 7 Dec 2021 00:05:11 +0800 Message-Id: <20211206160514.2000-3-jszhang@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20211206160514.2000-1-jszhang@kernel.org> References: <20211206160514.2000-1-jszhang@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211206_081239_722622_7CAD5BE2 X-CRM114-Status: GOOD ( 14.57 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Replace the conditional compilation using "#ifdef CONFIG_KEXEC_CORE" by a check for "IS_ENABLED(CONFIG_KEXEC_CORE)", to simplify the code and increase compile coverage. Signed-off-by: Jisheng Zhang Acked-by: Palmer Dabbelt --- arch/riscv/mm/init.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c index a15640eeb334..84879a5ce818 100644 --- a/arch/riscv/mm/init.c +++ b/arch/riscv/mm/init.c @@ -748,7 +748,6 @@ static inline void setup_vm_final(void) } #endif /* CONFIG_MMU */ -#ifdef CONFIG_KEXEC_CORE /* * reserve_crashkernel() - reserves memory for crash kernel * @@ -765,6 +764,8 @@ static void __init reserve_crashkernel(void) int ret = 0; + if (!IS_ENABLED(CONFIG_KEXEC_CORE)) + return; /* * Don't reserve a region for a crash kernel on a crash kernel * since it doesn't make much sense and we have limited memory @@ -805,7 +806,6 @@ static void __init reserve_crashkernel(void) crashk_res.start = crash_base; crashk_res.end = crash_base + crash_size - 1; } -#endif /* CONFIG_KEXEC_CORE */ void __init paging_init(void) { @@ -819,9 +819,7 @@ void __init misc_mem_init(void) arch_numa_init(); sparse_init(); zone_sizes_init(); -#ifdef CONFIG_KEXEC_CORE reserve_crashkernel(); -#endif memblock_dump_all(); } From patchwork Mon Dec 6 16:05:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 12694916 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 887B5C433F5 for ; Mon, 6 Dec 2021 16:15:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=qWFozsJeKHvBVbojXVT6Jw0LQeTNHCwT0nqQE1Szwrs=; b=SCLjOIQ+2qDtow m9tk53BT+pWsuejOwZeNWdtrcse2xLOMPjFTGsz3s7KejggMsuEJpOP+xP+hNaTNETf8nUh7WEk5y 3yl9j+seMIMNseBRZ5nyZ9BDRE/uaosP0pVzBaT+cZllLKyXG1Cv3XTjFAdBk0exLzKPW4Kf/G6Ms EaOnZWLgG+uivovdwtne7T3bN6oy92N5hsGT5iPMAof33czsJIdqO7aSEBQ1CDGZNO0lpbw1hZo1p GPVU5/a+5QrSSWI5Efip77M8/L2KoG0a1+y98obvwR/DONqYqfuMm/e1vtNRH69/il5kUtM8GnizZ DqbnEZR8jAqbIn22uq+w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1muGcI-004h4L-L2; Mon, 06 Dec 2021 16:13:26 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1muGbf-004giy-I4; Mon, 06 Dec 2021 16:12:48 +0000 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 sin.source.kernel.org (Postfix) with ESMTPS id D71C8CE16CC; Mon, 6 Dec 2021 16:12:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F174AC341C1; Mon, 6 Dec 2021 16:12:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1638807163; bh=4lrA7vab3IqapjTBi4sA+eK+CFU9COhOnI0b6b8qoS8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nojnBAoYR0mRHYKp/3KVaGhmt58qmV4P0h9vURAhHbgbEO7zcXe4ur7GDw0rCgOeI McNXdDdSpd7iEsatyNZVqw8n5EwyKupKsmZgGDjcje28IpyJbkIlNBsu4SQfKafcF/ 9VqU0GV14BMYQJa5PVfNPtYypBOmxWNoBxg+J80nW19lbsCIyw3EoWPWI0sagLQL8L rUmObWt1OLaXrw5qNdQcNyJDMOb8iODS5dY4G+iQRXa4FOwMGmYsyL+dxAH2bhZhup nDNjoEuuOyaWpjm6E7SAUhv2zy03XYCk94gpE7HKst3S+kzWWbyvwHbgfSJgO/rcq8 3br6qYWpR+s8A== From: Jisheng Zhang To: Russell King , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, hpa@zytor.com, Eric Biederman Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, kexec@lists.infradead.org, Alexandre ghiti Subject: [PATCH v2 3/5] x86/setup: use IS_ENABLED(CONFIG_KEXEC_CORE) instead of #ifdef Date: Tue, 7 Dec 2021 00:05:12 +0800 Message-Id: <20211206160514.2000-4-jszhang@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20211206160514.2000-1-jszhang@kernel.org> References: <20211206160514.2000-1-jszhang@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211206_081247_781434_D8AB0AB6 X-CRM114-Status: GOOD ( 13.82 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Replace the conditional compilation using "#ifdef CONFIG_KEXEC_CORE" by a check for "IS_ENABLED(CONFIG_KEXEC_CORE)", to simplify the code and increase compile coverage. Signed-off-by: Jisheng Zhang --- arch/x86/kernel/setup.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index c410be738ae7..56b738c1ca33 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -390,8 +390,6 @@ static void __init memblock_x86_reserve_range_setup_data(void) * --------- Crashkernel reservation ------------------------------ */ -#ifdef CONFIG_KEXEC_CORE - /* 16M alignment for crash kernel regions */ #define CRASH_ALIGN SZ_16M @@ -469,6 +467,9 @@ static void __init reserve_crashkernel(void) bool high = false; int ret; + if (!IS_ENABLED(CONFIG_KEXEC_CORE)) + return; + total_mem = memblock_phys_mem_size(); /* crashkernel=XM */ @@ -534,11 +535,6 @@ static void __init reserve_crashkernel(void) crashk_res.end = crash_base + crash_size - 1; insert_resource(&iomem_resource, &crashk_res); } -#else -static void __init reserve_crashkernel(void) -{ -} -#endif static struct resource standard_io_resources[] = { { .name = "dma1", .start = 0x00, .end = 0x1f, From patchwork Mon Dec 6 16:05:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 12694918 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A21B0C433EF for ; Mon, 6 Dec 2021 16:18:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=FCAGRz28rRdc3mU/8MGtfKUGFEXQxwtSdpYHGzzvJSU=; b=Sh+LCZg2Lgmwjt RfqjlAK4/gzbwnDhsy5gT8t2vbTvh+cOwyNfJqcYCzAG09nc52rh3fF3oxedoNt7BkVb5OSCDPoH0 pM7AOcjIuGaUQ3YpRMmAQnl+Lqc6mpXqxGUgmEn72f1aISBf56AESQ0okzjUSk96ii6UjOb/eilzn H2fHOMJt1HwbLJdvo82CTArv7Nf642mNIwcNfpCcHDraxDnQ5geECDvJLC0GXZxYZx+2ITBfj23KI /Aioz1KJZhDaIIzlY/1rETrsT4xx1JBpfBdE++dFLmYSRNP6vxPV/FhaBFI5MyL2AOcmqggwCWgbE elXJfAuvpe/AjJgOVk4Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1muGcq-004hU4-Gk; Mon, 06 Dec 2021 16:14:00 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1muGbj-004gkE-8w; Mon, 06 Dec 2021 16:12:52 +0000 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 sin.source.kernel.org (Postfix) with ESMTPS id 6E6C8CE16CA; Mon, 6 Dec 2021 16:12:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9264BC341C5; Mon, 6 Dec 2021 16:12:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1638807167; bh=r7gcAJ+SiOVCAHRDLO1HycpA8Xew8/od/ps6s+RbLT0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y15auMAoKthCqJEM0wuPExbfzU75NtRn6bCJTQluZ4JnJynmw+hpz2PIXP8VjI8YT 24o7fb1c4H+ncYPmF5i4yi3/ZGOsXKTJ3e9JMjVMDoVPNGp9mEO7yHQfCzqVx+bDIv 0gCyTFq1txPzwYKMdMs5vtfRKyZ8cxFY8XJvpN9pwlXdDP/jXFr6pddVDZoLTqwKIr apd28d09ruTtCyR3ngCTFtiYu4yI5fclaq8y5tf8huESE67r8WfJBwovHeybVjtFqz a9qfiTjpdi4/cKOcgk7sYveF53Q6CHJjVBoLZlnijAeG9MIZi2nIP6kRnW6v4wOlDu BVFwdMW2q3t+w== From: Jisheng Zhang To: Russell King , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, hpa@zytor.com, Eric Biederman Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, kexec@lists.infradead.org, Alexandre ghiti Subject: [PATCH v2 4/5] arm64: mm: use IS_ENABLED(CONFIG_KEXEC_CORE) instead of #ifdef Date: Tue, 7 Dec 2021 00:05:13 +0800 Message-Id: <20211206160514.2000-5-jszhang@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20211206160514.2000-1-jszhang@kernel.org> References: <20211206160514.2000-1-jszhang@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211206_081251_511124_982BCAC2 X-CRM114-Status: GOOD ( 12.89 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Replace the conditional compilation using "#ifdef CONFIG_KEXEC_CORE" by a check for "IS_ENABLED(CONFIG_KEXEC_CORE)", to simplify the code and increase compile coverage. Signed-off-by: Jisheng Zhang Acked-by: Catalin Marinas --- arch/arm64/mm/init.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index a8834434af99..b4b8b4dc2d31 100644 --- a/arch/arm64/mm/init.c +++ b/arch/arm64/mm/init.c @@ -64,7 +64,6 @@ EXPORT_SYMBOL(memstart_addr); */ phys_addr_t arm64_dma_phys_limit __ro_after_init; -#ifdef CONFIG_KEXEC_CORE /* * reserve_crashkernel() - reserves memory for crash kernel * @@ -78,6 +77,9 @@ static void __init reserve_crashkernel(void) unsigned long long crash_max = arm64_dma_phys_limit; int ret; + if (!IS_ENABLED(CONFIG_KEXEC_CORE)) + return; + ret = parse_crashkernel(boot_command_line, memblock_phys_mem_size(), &crash_size, &crash_base); /* no crashkernel= or invalid value specified */ @@ -110,11 +112,6 @@ static void __init reserve_crashkernel(void) crashk_res.start = crash_base; crashk_res.end = crash_base + crash_size - 1; } -#else -static void __init reserve_crashkernel(void) -{ -} -#endif /* CONFIG_KEXEC_CORE */ /* * Return the maximum physical address for a zone accessible by the given bits From patchwork Mon Dec 6 16:05:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 12694917 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4A536C433EF for ; Mon, 6 Dec 2021 16:17:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Arq2DU9+gi0pKKG/98/8W4jOIZY6yJnrzcG7pRfZUaw=; b=19pzv0+8z+EOIw 85fwMgV67nmcSqpwyFeeKK9/ztOhMJUohEBybVJB2GFdzSTVji1+sGB4EuDEMjlC3Tlw85w6ibN62 bnmmVuUvLpJ9g3gdJx73jPjNtVjhJYMLLbKS7vaQKhgVnMhcsel8uYWoOxz5OeXCiz+qwtMhZLrcI l28zBL1X11L9sXhWCNq6SJ0vnr0g5/dMP7FUhVUDLczC9w8jTgnlvd4bPr0y+q5c8rROYtNDhZt1T wGWDX9MRrd3vtJciz6p8dKbOanOYy+l/xquMa+nHTgn+1d5a0aIs+OupMLoAJjYchD9URWy14JJ8Y Bq5mB7SqgwKilOXi8tng==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1muGdl-004i1A-KC; Mon, 06 Dec 2021 16:14:59 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1muGbl-004glv-HC; Mon, 06 Dec 2021 16:12:54 +0000 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 dfw.source.kernel.org (Postfix) with ESMTPS id 104556136C; Mon, 6 Dec 2021 16:12:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 249D9C341C7; Mon, 6 Dec 2021 16:12:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1638807172; bh=nFeA2Qnp7UpOzQ0dau1zsG4iKPtStOZhLFNfY+mSumQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pAwQXGdBEvOm6ZN3gwfqPK6br2O3B9Ib/1/EbGm9JfzdYM0Ba/zv4exD8jKUbSlOj myC78FFF23d1uPKiVsyNgVlbvFf5C4e7woqojZGT1qYOb17gF+hv3GkKEN5fh6RpXp CwXon9C1oMNdlNYt6yoaqeBeavXtUnSGJOxnurGSF1z4gK/XzWAgFfO5LWZXM1zC5q 6PB1n8Kf2Cw7qlzXABWdVA2AssXh6sit9AIqVeJ4yZ0Mz+/dIDI8d9b9YAA+3B+/I/ 96VjJf9+TOWE0ACGGhnxCCfAPmXkM0dXsEVERViO0FykMRTw8JmSMalterEYLocQ1B h5pnfFxz4sZRw== From: Jisheng Zhang To: Russell King , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, hpa@zytor.com, Eric Biederman Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, kexec@lists.infradead.org, Alexandre ghiti , Russell King Subject: [PATCH v2 5/5] arm: use IS_ENABLED(CONFIG_KEXEC_CORE) instead of #ifdef Date: Tue, 7 Dec 2021 00:05:14 +0800 Message-Id: <20211206160514.2000-6-jszhang@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20211206160514.2000-1-jszhang@kernel.org> References: <20211206160514.2000-1-jszhang@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211206_081253_644060_5B46856D X-CRM114-Status: GOOD ( 12.39 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Replace the conditional compilation using "#ifdef CONFIG_KEXEC_CORE" by a check for "IS_ENABLED(CONFIG_KEXEC_CORE)", to simplify the code and increase compile coverage. Signed-off-by: Jisheng Zhang Reviewed-by: Russell King (Oracle) --- arch/arm/kernel/setup.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index 284a80c0b6e1..f9a054a344c0 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c @@ -973,7 +973,6 @@ static int __init init_machine_late(void) } late_initcall(init_machine_late); -#ifdef CONFIG_KEXEC /* * The crash region must be aligned to 128MB to avoid * zImage relocating below the reserved region. @@ -1001,6 +1000,9 @@ static void __init reserve_crashkernel(void) unsigned long long total_mem; int ret; + if (!IS_ENABLED(CONFIG_KEXEC_CORE)) + return; + total_mem = get_total_mem(); ret = parse_crashkernel(boot_command_line, total_mem, &crash_size, &crash_base); @@ -1056,9 +1058,6 @@ static void __init reserve_crashkernel(void) insert_resource(&iomem_resource, &crashk_boot_res); } } -#else -static inline void reserve_crashkernel(void) {} -#endif /* CONFIG_KEXEC */ void __init hyp_mode_check(void) {