From: Yixun Lan <dlan@gentoo.org> To: linux-riscv@lists.infradead.org Cc: Palmer Dabbelt <palmer@dabbelt.com>, Paul Walmsley <paul.walmsley@sifive.com>, Albert Ou <aou@eecs.berkeley.edu>, linux-kernel@vger.kernel.org, Yixun Lan <dlan@gentoo.org> Subject: [PATCH] RISC-V: enable CONFIG_ARCH_KEEP_MEMBLOCK Date: Sun, 12 Jun 2022 12:34:33 +0800 [thread overview] Message-ID: <20220612043433.10469-1-dlan@gentoo.org> (raw) Preserve the memblock info while CONFIG_DEBUG_FS is enabled. So later, the information can be showed at: /sys/kernel/debug/memblock/{memory,reserved} Signed-off-by: Yixun Lan <dlan@gentoo.org> --- Check mm/memblock.c:2120 for the code logic: #if defined(CONFIG_DEBUG_FS) && defined(CONFIG_ARCH_KEEP_MEMBLOCK) I've tested on unmatched board, with this patch applied for example, we can see the memblock reserved info as: # cat /sys/kernel/debug/memblock/reserved 0: 0x0000000080000000..0x000000008007ffff 1: 0x0000000080200000..0x00000000823fffff 2: 0x0000000088000000..0x000000008800307f 3: 0x00000000ec000000..0x00000000ffffffff 4: 0x000000046d600000..0x000000047edfffff 5: 0x000000047ee2d000..0x000000047eeecfff 6: 0x000000047eeed440..0x000000047eeed947 7: 0x000000047eeed980..0x000000047eeede1f 8: 0x000000047eeede40..0x000000047eeedfc7 9: 0x000000047eeee000..0x000000047ef59fff 10: 0x000000047ef5c000..0x000000047efdd05f 11: 0x000000047efdd080..0x000000047efdd29f 12: 0x000000047efdd2c0..0x000000047efdd3df 13: 0x000000047efdd400..0x000000047efdd41f 14: 0x000000047efdd440..0x000000047efdd44f 15: 0x000000047efdd480..0x000000047efdd487 16: 0x000000047efdd4c0..0x000000047efdd525 17: 0x000000047efdd540..0x000000047efdd5a5 18: 0x000000047efdd5c0..0x000000047ffdfa47 19: 0x000000047ffdfa78..0x000000047ffdfaa8 20: 0x000000047ffdfab0..0x000000047ffdfade 21: 0x000000047ffdfae0..0x000000047ffdfb0e 22: 0x000000047ffdfb10..0x000000047ffeeffb --- arch/riscv/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index c22f58155948..e457c5855222 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -32,6 +32,7 @@ config RISCV select ARCH_HAS_STRICT_MODULE_RWX if MMU && !XIP_KERNEL select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST select ARCH_HAS_UBSAN_SANITIZE_ALL + select ARCH_KEEP_MEMBLOCK select ARCH_OPTIONAL_KERNEL_RWX if ARCH_HAS_STRICT_KERNEL_RWX select ARCH_OPTIONAL_KERNEL_RWX_DEFAULT select ARCH_STACKWALK -- 2.35.1
WARNING: multiple messages have this Message-ID (diff)
From: Yixun Lan <dlan@gentoo.org> To: linux-riscv@lists.infradead.org Cc: Palmer Dabbelt <palmer@dabbelt.com>, Paul Walmsley <paul.walmsley@sifive.com>, Albert Ou <aou@eecs.berkeley.edu>, linux-kernel@vger.kernel.org, Yixun Lan <dlan@gentoo.org> Subject: [PATCH] RISC-V: enable CONFIG_ARCH_KEEP_MEMBLOCK Date: Sun, 12 Jun 2022 12:34:33 +0800 [thread overview] Message-ID: <20220612043433.10469-1-dlan@gentoo.org> (raw) Preserve the memblock info while CONFIG_DEBUG_FS is enabled. So later, the information can be showed at: /sys/kernel/debug/memblock/{memory,reserved} Signed-off-by: Yixun Lan <dlan@gentoo.org> --- Check mm/memblock.c:2120 for the code logic: #if defined(CONFIG_DEBUG_FS) && defined(CONFIG_ARCH_KEEP_MEMBLOCK) I've tested on unmatched board, with this patch applied for example, we can see the memblock reserved info as: # cat /sys/kernel/debug/memblock/reserved 0: 0x0000000080000000..0x000000008007ffff 1: 0x0000000080200000..0x00000000823fffff 2: 0x0000000088000000..0x000000008800307f 3: 0x00000000ec000000..0x00000000ffffffff 4: 0x000000046d600000..0x000000047edfffff 5: 0x000000047ee2d000..0x000000047eeecfff 6: 0x000000047eeed440..0x000000047eeed947 7: 0x000000047eeed980..0x000000047eeede1f 8: 0x000000047eeede40..0x000000047eeedfc7 9: 0x000000047eeee000..0x000000047ef59fff 10: 0x000000047ef5c000..0x000000047efdd05f 11: 0x000000047efdd080..0x000000047efdd29f 12: 0x000000047efdd2c0..0x000000047efdd3df 13: 0x000000047efdd400..0x000000047efdd41f 14: 0x000000047efdd440..0x000000047efdd44f 15: 0x000000047efdd480..0x000000047efdd487 16: 0x000000047efdd4c0..0x000000047efdd525 17: 0x000000047efdd540..0x000000047efdd5a5 18: 0x000000047efdd5c0..0x000000047ffdfa47 19: 0x000000047ffdfa78..0x000000047ffdfaa8 20: 0x000000047ffdfab0..0x000000047ffdfade 21: 0x000000047ffdfae0..0x000000047ffdfb0e 22: 0x000000047ffdfb10..0x000000047ffeeffb --- arch/riscv/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index c22f58155948..e457c5855222 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -32,6 +32,7 @@ config RISCV select ARCH_HAS_STRICT_MODULE_RWX if MMU && !XIP_KERNEL select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST select ARCH_HAS_UBSAN_SANITIZE_ALL + select ARCH_KEEP_MEMBLOCK select ARCH_OPTIONAL_KERNEL_RWX if ARCH_HAS_STRICT_KERNEL_RWX select ARCH_OPTIONAL_KERNEL_RWX_DEFAULT select ARCH_STACKWALK -- 2.35.1 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv
next reply other threads:[~2022-06-12 4:35 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-06-12 4:34 Yixun Lan [this message] 2022-06-12 4:34 ` [PATCH] RISC-V: enable CONFIG_ARCH_KEEP_MEMBLOCK Yixun Lan
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220612043433.10469-1-dlan@gentoo.org \ --to=dlan@gentoo.org \ --cc=aou@eecs.berkeley.edu \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-riscv@lists.infradead.org \ --cc=palmer@dabbelt.com \ --cc=paul.walmsley@sifive.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.