diff options
Diffstat (limited to 'arch/riscv/kernel')
| -rw-r--r-- | arch/riscv/kernel/cpu.c | 9 | ||||
| -rw-r--r-- | arch/riscv/kernel/head.S | 10 | ||||
| -rw-r--r-- | arch/riscv/kernel/vmlinux.lds.S | 2 | 
3 files changed, 17 insertions, 4 deletions
| diff --git a/arch/riscv/kernel/cpu.c b/arch/riscv/kernel/cpu.c index 3a5a2ee31547..b4a7d4427fbb 100644 --- a/arch/riscv/kernel/cpu.c +++ b/arch/riscv/kernel/cpu.c @@ -64,7 +64,7 @@ int riscv_of_processor_hartid(struct device_node *node)  static void print_isa(struct seq_file *f, const char *orig_isa)  { -	static const char *ext = "mafdc"; +	static const char *ext = "mafdcsu";  	const char *isa = orig_isa;  	const char *e; @@ -88,11 +88,14 @@ static void print_isa(struct seq_file *f, const char *orig_isa)  	/*  	 * Check the rest of the ISA string for valid extensions, printing those  	 * we find.  RISC-V ISA strings define an order, so we only print the -	 * extension bits when they're in order. +	 * extension bits when they're in order. Hide the supervisor (S) +	 * extension from userspace as it's not accessible from there.  	 */  	for (e = ext; *e != '\0'; ++e) {  		if (isa[0] == e[0]) { -			seq_write(f, isa, 1); +			if (isa[0] != 's') +				seq_write(f, isa, 1); +  			isa++;  		}  	} diff --git a/arch/riscv/kernel/head.S b/arch/riscv/kernel/head.S index 711190d473d4..fe884cd69abd 100644 --- a/arch/riscv/kernel/head.S +++ b/arch/riscv/kernel/head.S @@ -44,6 +44,16 @@ ENTRY(_start)  	amoadd.w a3, a2, (a3)  	bnez a3, .Lsecondary_start +	/* Clear BSS for flat non-ELF images */ +	la a3, __bss_start +	la a4, __bss_stop +	ble a4, a3, clear_bss_done +clear_bss: +	REG_S zero, (a3) +	add a3, a3, RISCV_SZPTR +	blt a3, a4, clear_bss +clear_bss_done: +  	/* Save hart ID and DTB physical address */  	mv s0, a0  	mv s1, a1 diff --git a/arch/riscv/kernel/vmlinux.lds.S b/arch/riscv/kernel/vmlinux.lds.S index ece84991609c..65df1dfdc303 100644 --- a/arch/riscv/kernel/vmlinux.lds.S +++ b/arch/riscv/kernel/vmlinux.lds.S @@ -74,7 +74,7 @@ SECTIONS  		*(.sbss*)  	} -	BSS_SECTION(0, 0, 0) +	BSS_SECTION(PAGE_SIZE, PAGE_SIZE, 0)  	EXCEPTION_TABLE(0x10)  	NOTES | 
