Skip to content

Commit 6cdc7f2

Browse files
committed
Merge tag 'riscv/for-v5.5-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux
Pull more RISC-V updates from Paul Walmsley: "A few minor RISC-V updates for v5.5-rc1 that arrived late. New features: - Dump some kernel virtual memory map details to the console if CONFIG_DEBUG_VM is enabled Other improvements: - Enable more debugging options in the primary defconfigs Cleanups: - Clean up Kconfig indentation" * tag 'riscv/for-v5.5-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: RISC-V: Add address map dumper riscv: defconfigs: enable more debugging options riscv: defconfigs: enable debugfs riscv: Fix Kconfig indentation
2 parents ef66f6b + 1646220 commit 6cdc7f2

File tree

4 files changed

+88
-8
lines changed

4 files changed

+88
-8
lines changed

arch/riscv/Kconfig.socs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
menu "SoC selection"
22

33
config SOC_SIFIVE
4-
bool "SiFive SoCs"
5-
select SERIAL_SIFIVE
6-
select SERIAL_SIFIVE_CONSOLE
7-
select CLK_SIFIVE
8-
select CLK_SIFIVE_FU540_PRCI
9-
select SIFIVE_PLIC
10-
help
11-
This enables support for SiFive SoC platform hardware.
4+
bool "SiFive SoCs"
5+
select SERIAL_SIFIVE
6+
select SERIAL_SIFIVE_CONSOLE
7+
select CLK_SIFIVE
8+
select CLK_SIFIVE_FU540_PRCI
9+
select SIFIVE_PLIC
10+
help
11+
This enables support for SiFive SoC platform hardware.
1212

1313
endmenu

arch/riscv/configs/defconfig

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,4 +100,28 @@ CONFIG_9P_FS=y
100100
CONFIG_CRYPTO_USER_API_HASH=y
101101
CONFIG_CRYPTO_DEV_VIRTIO=y
102102
CONFIG_PRINTK_TIME=y
103+
CONFIG_DEBUG_FS=y
104+
CONFIG_DEBUG_PAGEALLOC=y
105+
CONFIG_DEBUG_VM=y
106+
CONFIG_DEBUG_VM_PGFLAGS=y
107+
CONFIG_DEBUG_MEMORY_INIT=y
108+
CONFIG_DEBUG_PER_CPU_MAPS=y
109+
CONFIG_SOFTLOCKUP_DETECTOR=y
110+
CONFIG_WQ_WATCHDOG=y
111+
CONFIG_SCHED_STACK_END_CHECK=y
112+
CONFIG_DEBUG_TIMEKEEPING=y
113+
CONFIG_DEBUG_RT_MUTEXES=y
114+
CONFIG_DEBUG_SPINLOCK=y
115+
CONFIG_DEBUG_MUTEXES=y
116+
CONFIG_DEBUG_RWSEMS=y
117+
CONFIG_DEBUG_ATOMIC_SLEEP=y
118+
CONFIG_STACKTRACE=y
119+
CONFIG_DEBUG_LIST=y
120+
CONFIG_DEBUG_PLIST=y
121+
CONFIG_DEBUG_SG=y
103122
# CONFIG_RCU_TRACE is not set
123+
CONFIG_RCU_EQS_DEBUG=y
124+
CONFIG_DEBUG_BLOCK_EXT_DEVT=y
125+
# CONFIG_FTRACE is not set
126+
# CONFIG_RUNTIME_TESTING_MENU is not set
127+
CONFIG_MEMTEST=y

arch/riscv/configs/rv32_defconfig

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,28 @@ CONFIG_9P_FS=y
9797
CONFIG_CRYPTO_USER_API_HASH=y
9898
CONFIG_CRYPTO_DEV_VIRTIO=y
9999
CONFIG_PRINTK_TIME=y
100+
CONFIG_DEBUG_FS=y
101+
CONFIG_DEBUG_PAGEALLOC=y
102+
CONFIG_DEBUG_VM=y
103+
CONFIG_DEBUG_VM_PGFLAGS=y
104+
CONFIG_DEBUG_MEMORY_INIT=y
105+
CONFIG_DEBUG_PER_CPU_MAPS=y
106+
CONFIG_SOFTLOCKUP_DETECTOR=y
107+
CONFIG_WQ_WATCHDOG=y
108+
CONFIG_SCHED_STACK_END_CHECK=y
109+
CONFIG_DEBUG_TIMEKEEPING=y
110+
CONFIG_DEBUG_RT_MUTEXES=y
111+
CONFIG_DEBUG_SPINLOCK=y
112+
CONFIG_DEBUG_MUTEXES=y
113+
CONFIG_DEBUG_RWSEMS=y
114+
CONFIG_DEBUG_ATOMIC_SLEEP=y
115+
CONFIG_STACKTRACE=y
116+
CONFIG_DEBUG_LIST=y
117+
CONFIG_DEBUG_PLIST=y
118+
CONFIG_DEBUG_SG=y
100119
# CONFIG_RCU_TRACE is not set
120+
CONFIG_RCU_EQS_DEBUG=y
121+
CONFIG_DEBUG_BLOCK_EXT_DEVT=y
122+
# CONFIG_FTRACE is not set
123+
# CONFIG_RUNTIME_TESTING_MENU is not set
124+
CONFIG_MEMTEST=y

arch/riscv/mm/init.c

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,37 @@ static void setup_zero_page(void)
4646
memset((void *)empty_zero_page, 0, PAGE_SIZE);
4747
}
4848

49+
#ifdef CONFIG_DEBUG_VM
50+
static inline void print_mlk(char *name, unsigned long b, unsigned long t)
51+
{
52+
pr_notice("%12s : 0x%08lx - 0x%08lx (%4ld kB)\n", name, b, t,
53+
(((t) - (b)) >> 10));
54+
}
55+
56+
static inline void print_mlm(char *name, unsigned long b, unsigned long t)
57+
{
58+
pr_notice("%12s : 0x%08lx - 0x%08lx (%4ld MB)\n", name, b, t,
59+
(((t) - (b)) >> 20));
60+
}
61+
62+
static void print_vm_layout(void)
63+
{
64+
pr_notice("Virtual kernel memory layout:\n");
65+
print_mlk("fixmap", (unsigned long)FIXADDR_START,
66+
(unsigned long)FIXADDR_TOP);
67+
print_mlm("pci io", (unsigned long)PCI_IO_START,
68+
(unsigned long)PCI_IO_END);
69+
print_mlm("vmemmap", (unsigned long)VMEMMAP_START,
70+
(unsigned long)VMEMMAP_END);
71+
print_mlm("vmalloc", (unsigned long)VMALLOC_START,
72+
(unsigned long)VMALLOC_END);
73+
print_mlm("lowmem", (unsigned long)PAGE_OFFSET,
74+
(unsigned long)high_memory);
75+
}
76+
#else
77+
static void print_vm_layout(void) { }
78+
#endif /* CONFIG_DEBUG_VM */
79+
4980
void __init mem_init(void)
5081
{
5182
#ifdef CONFIG_FLATMEM
@@ -56,6 +87,7 @@ void __init mem_init(void)
5687
memblock_free_all();
5788

5889
mem_init_print_info(NULL);
90+
print_vm_layout();
5991
}
6092

6193
#ifdef CONFIG_BLK_DEV_INITRD

0 commit comments

Comments
 (0)