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: 12658837 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 68F96C433EF for ; Mon, 6 Dec 2021 16:13:10 +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=O8za7EfD9PuqnZgUiX/VFLiq0ixSc0mbIvLeZB+tI00=; b=CW4aPKbqHoHfba k6w1steCqIYjhlgWYgkwdEAU6vXdl1ZXrXzqqIJiso4i67MZblkn6brr3UwHvWNfqUbkBwrdW/AfJ LJWJMtxJqlsGMhfvyZrSZQ2xQD3yXS2c2J5Gaxc4pBiGCaZaEiP4pBEcadi/haFAOaqHq7Dd2a6EB u1Q/p3UxYKMY0toCG24ZLl6R0j4mSvtB8dZ9lCvpqixW3vwHD3NuEhxdzTHeDIRYMweI3mmgg+DoU ztPhXaDtrxkUvFCGQlNeYIz37Ms/JCCU2RKdr6J/VpKu4mzXY27curC0nAZjag9v0WMcyptjRUG0k 1A+N9HNWXpeN487COolQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1muGbv-004grV-9B; Mon, 06 Dec 2021 16:13:03 +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-riscv@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-riscv" Errors-To: linux-riscv-bounces+linux-riscv=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: 12658839 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 C08AEC433F5 for ; Mon, 6 Dec 2021 16:13:25 +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=jePw1IeMXWzFXW548PYrl4A1ia7wDTu4w8pzaYXLcaY=; b=vGvnWXCkfy9kZK fQPKDKayUVtp7perk4sAftcUJE/1NJ3IEzLAFgHYyF1PFJ/Cv5/cbjixlHTpRmAhxvs47eTKYSVdT Nhdzb8yzn7xhFGpGxQU8wsZqVUUFNvHfVJXOjE+PRQnfd4dZdEHvrjX7jz/YNb4FgdYOQcfr3HqQE dDR5hW8lAMFO5BW8nHwYqGDlB6tiao1osbUF1ayTM06shOJfQ/KxR3y0CRHEFlP/GMC7jzN2/D1jV 78xzCd/3s/HL4urY74IYeOPFLAnkrCeGyKX8smC49/6h8fW17xnTeezKDmLz2gS1N5OXQdwV/F8UP h0Eo8JrBfBqrapX1Cniw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1muGcA-004h0Z-RG; Mon, 06 Dec 2021 16:13:18 +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-riscv@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-riscv" Errors-To: linux-riscv-bounces+linux-riscv=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: 12658841 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 56F5BC433EF for ; Mon, 6 Dec 2021 16:13:58 +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=rzFVDwkteBKX4uWX1SBXYoQjL14KxFYRYTmxTHSpM2c=; b=wfHKpmH+TBelm6 8EcOzzSICiKECXm262kO3Cnb9S5StZpEpMuJcjFm499Ahrs2RR+Ty36NjxMO9Og4e3+6hSnyWT5xv ASSMNALr48KT/f2EzwJwj4bUSiZKY5PFsws/xMuSFpZWg74nJTOsaLw2W0wVBmm3n9h8RU8KfSydg +0KXvqBXowDwl+Saw9p9WCH8JNZ1oO+NKKONlexx9DleQgyJU/TI6eK1IIx7k8Pp9bGZcsWOH4h47 mgxkucqnTTyF8CBmK1QJqUStg1BXFwwAGzfyCwMSnP995HhUMNz0TyiFBMSMOKVSyPF00sTpkCT2p AS8nSTQln5vPMBhMhd7Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1muGcg-004hP2-JU; Mon, 06 Dec 2021 16:13:50 +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-riscv@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-riscv" Errors-To: linux-riscv-bounces+linux-riscv=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: 12658855 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 828CDC433F5 for ; Mon, 6 Dec 2021 16:14: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=xiOcKh0XM1c1JuPFy5n4dv4JglIAk58JjljY6eF6EGU=; b=iJc8cjvvVG58TK e2Xy4A7JEcbhnkJLB+rQH9qklmwULFa8d/Up2LJkN9JRrvb9wz3yd+KKyLQuNmK/N3PChgfXa5P5J UbvHN6iLy+SZEM4brEru6hU0mDVcL472h8RqNIxSaNYju7gFXras1f4DDCLbDYG+SME0z8l5BMlMH 0qzNujUrxRxt6FrWA3Ombi728e5e9U/GBgiaBArUikHjVMatUMk5Ymr4hVVRx8JSu0lZWGoJm8oz+ nAnuIJH364iuodsWztqnRgXsBCwkLl40aEl6cJs6m7WUSHRIZeMVfq/95R5XpQz+Sszyiq2h9GmQ6 1O5eRcaWq10EmInGEYUA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1muGdH-004hph-5j; Mon, 06 Dec 2021 16:14:27 +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-riscv@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-riscv" Errors-To: linux-riscv-bounces+linux-riscv=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: 12658857 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 91FC4C433F5 for ; Mon, 6 Dec 2021 16:15:41 +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=kfLOvpSA3iK/cdLDR+6tg5gbUS6l55+2FKo9uiDAn54=; b=XNSPyIGE/D0Uxt soxnQB+uogqItS0tDX7IfmbrcDX8m7HcmgICYZ7naXR/r426ScbMANzrfrnmGp6VhY4AKffa/fmHc RbBi4Llwg9rbsJukUHBm4tSDanSRzGrRHYnG5SHNcuIkxHZ+nVU8AtrB0OLZ+yHR7unUwik3uTE/G 3UIMR1lpt8lQH8F5qA5W3Y4rcBB9aHwc7wcl6Gto8XTZXCPMYKxVhdbkw64SA4jxsQXGkEF5IU1N2 KTC0s6sKTryh4+j+IRxzsoQK7ItG3zFxjTLs8dHqIoUXXCO/bsaJtRd1cwXiutDUSGXTDc38trq9q LoGknXVMRTRsp0zHvtqg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1muGeI-004iSa-3g; Mon, 06 Dec 2021 16:15:30 +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-riscv@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-riscv" Errors-To: linux-riscv-bounces+linux-riscv=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) {