Skip to content

Commit 86e581e

Browse files
RISC-V: Mask out the F extension on systems without D
The RISC-V Linux port doesn't support systems that have the F extension but don't have the D extension -- we actually don't support systems without D either, but Alan's patch set is rectifying that soon. For now I think we can leave this in a semi-broken state and just wait for Alan's patch set to get merged for proper non-FPU support -- the patch set is starting to look good, so doing something in-between doesn't seem like it's worth the work. I don't think it's worth fretting about support for systems with F but not D for now: our glibc ABIs are IMAC and IMAFDC so they probably won't end up being popular. We can always extend this in the future. CC: Alan Kao <[email protected]> Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent 1760deb commit 86e581e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

arch/riscv/kernel/cpufeature.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,12 @@ void riscv_fill_hwcap(void)
5757
for (i = 0; i < strlen(isa); ++i)
5858
elf_hwcap |= isa2hwcap[(unsigned char)(isa[i])];
5959

60+
/* We don't support systems with F but without D, so mask those out
61+
* here. */
62+
if ((elf_hwcap & COMPAT_HWCAP_ISA_F) && !(elf_hwcap & COMPAT_HWCAP_ISA_D)) {
63+
pr_info("This kernel does not support systems with F but not D");
64+
elf_hwcap &= ~COMPAT_HWCAP_ISA_F;
65+
}
66+
6067
pr_info("elf_hwcap is 0x%lx", elf_hwcap);
6168
}

0 commit comments

Comments
 (0)