Skip to content

Commit 1edd28b

Browse files
atishp04paul-walmsley-sifive
authored andcommitted
RISC-V: Remove unsupported isa string info print
/proc/cpuinfo should just print all the isa string as an information instead of determining what is supported or not. ELF hwcap can be used by the userspace to figure out that. Simplify the isa string printing by removing the unsupported isa string print and all related code. The relevant discussion can be found at http://lists.infradead.org/pipermail/linux-riscv/2019-September/006702.html Signed-off-by: Atish Patra <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Link: http://lists.infradead.org/pipermail/linux-riscv/2019-September/006702.html Signed-off-by: Paul Walmsley <[email protected]>
1 parent d6d5df1 commit 1edd28b

File tree

1 file changed

+3
-42
lines changed

1 file changed

+3
-42
lines changed

arch/riscv/kernel/cpu.c

Lines changed: 3 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -46,51 +46,12 @@ int riscv_of_processor_hartid(struct device_node *node)
4646

4747
#ifdef CONFIG_PROC_FS
4848

49-
static void print_isa(struct seq_file *f, const char *orig_isa)
49+
static void print_isa(struct seq_file *f, const char *isa)
5050
{
51-
static const char *ext = "mafdcsu";
52-
const char *isa = orig_isa;
53-
const char *e;
54-
55-
/*
56-
* Linux doesn't support rv32e or rv128i, and we only support booting
57-
* kernels on harts with the same ISA that the kernel is compiled for.
58-
*/
59-
#if defined(CONFIG_32BIT)
60-
if (strncmp(isa, "rv32i", 5) != 0)
61-
return;
62-
#elif defined(CONFIG_64BIT)
63-
if (strncmp(isa, "rv64i", 5) != 0)
64-
return;
65-
#endif
66-
67-
/* Print the base ISA, as we already know it's legal. */
51+
/* Print the entire ISA as it is */
6852
seq_puts(f, "isa\t\t: ");
69-
seq_write(f, isa, 5);
70-
isa += 5;
71-
72-
/*
73-
* Check the rest of the ISA string for valid extensions, printing those
74-
* we find. RISC-V ISA strings define an order, so we only print the
75-
* extension bits when they're in order. Hide the supervisor (S)
76-
* extension from userspace as it's not accessible from there.
77-
*/
78-
for (e = ext; *e != '\0'; ++e) {
79-
if (isa[0] == e[0]) {
80-
if (isa[0] != 's')
81-
seq_write(f, isa, 1);
82-
83-
isa++;
84-
}
85-
}
53+
seq_write(f, isa, strlen(isa));
8654
seq_puts(f, "\n");
87-
88-
/*
89-
* If we were given an unsupported ISA in the device tree then print
90-
* a bit of info describing what went wrong.
91-
*/
92-
if (isa[0] != '\0')
93-
pr_info("unsupported ISA \"%s\" in device tree\n", orig_isa);
9455
}
9556

9657
static void print_mmu(struct seq_file *f, const char *mmu_type)

0 commit comments

Comments
 (0)