2022-04-29 21:46:10

by Maciej W. Rozycki

[permalink] [raw]
Subject: [PATCH 0/2] MIPS: Remove incorrect `cpu_has_fpu' overrides

Hi,

Forcing `cpu_has_fpu' to 1 is unsupported as it breaks the `nofpu' kernel
parameter and more recently also the CONFIG_MIPS_FP_SUPPORT configuration
option. Remove the broken `cpu_has_fpu' overrides then for IP27 and IP30
systems. Please apply.

Maciej


2022-04-29 21:58:15

by Maciej W. Rozycki

[permalink] [raw]
Subject: [PATCH 1/2] MIPS: IP27: Remove incorrect `cpu_has_fpu' override

Remove unsupported forcing of `cpu_has_fpu' to 1, which makes the `nofpu'
kernel parameter non-functional, and also causes a link error:

ld: arch/mips/kernel/traps.o: in function `trap_init':
./arch/mips/include/asm/msa.h:(.init.text+0x348): undefined reference to `handle_fpe'
ld: ./arch/mips/include/asm/msa.h:(.init.text+0x354): undefined reference to `handle_fpe'
ld: ./arch/mips/include/asm/msa.h:(.init.text+0x360): undefined reference to `handle_fpe'

where the CONFIG_MIPS_FP_SUPPORT configuration option has been chosen.

Signed-off-by: Maciej W. Rozycki <[email protected]>
Fixes: 0ebb2f4159af ("MIPS: IP27: Update/restructure CPU overrides")
Cc: [email protected] # v4.2+
---
arch/mips/include/asm/mach-ip27/cpu-feature-overrides.h | 1 -
1 file changed, 1 deletion(-)

linux-mips-ip27-cpu-has-fpu.diff
Index: linux-macro/arch/mips/include/asm/mach-ip27/cpu-feature-overrides.h
===================================================================
--- linux-macro.orig/arch/mips/include/asm/mach-ip27/cpu-feature-overrides.h
+++ linux-macro/arch/mips/include/asm/mach-ip27/cpu-feature-overrides.h
@@ -25,7 +25,6 @@
#define cpu_has_4kex 1
#define cpu_has_3k_cache 0
#define cpu_has_4k_cache 1
-#define cpu_has_fpu 1
#define cpu_has_nofpuex 0
#define cpu_has_32fpr 1
#define cpu_has_counter 1

2022-05-03 00:01:13

by Stephen Zhang

[permalink] [raw]
Subject: Re: [PATCH 1/2] MIPS: IP27: Remove incorrect `cpu_has_fpu' override

Maciej W. Rozycki <[email protected]> 于2022年4月29日周五 22:57写道:
>
> Remove unsupported forcing of `cpu_has_fpu' to 1, which makes the `nofpu'
> kernel parameter non-functional, and also causes a link error:
>
> ld: arch/mips/kernel/traps.o: in function `trap_init':
> ./arch/mips/include/asm/msa.h:(.init.text+0x348): undefined reference to `handle_fpe'
> ld: ./arch/mips/include/asm/msa.h:(.init.text+0x354): undefined reference to `handle_fpe'
> ld: ./arch/mips/include/asm/msa.h:(.init.text+0x360): undefined reference to `handle_fpe'
>
> where the CONFIG_MIPS_FP_SUPPORT configuration option has been chosen.
>

Sorry, but I have a question. From the code in
arch/mips/kernel/genex.S:567, 'handle_fpe’‘s
definition is controlled by CONFIG_MIPS_FP_SUPPORT. Then how can it
still report such
error when the CONFIG_MIPS_FP_SUPPORT configuration option has been chosen.


Stephen.

2022-05-03 00:51:41

by Maciej W. Rozycki

[permalink] [raw]
Subject: Re: [PATCH 1/2] MIPS: IP27: Remove incorrect `cpu_has_fpu' override

On Sat, 30 Apr 2022, Stephen Zhang wrote:

> > Remove unsupported forcing of `cpu_has_fpu' to 1, which makes the `nofpu'
> > kernel parameter non-functional, and also causes a link error:
> >
> > ld: arch/mips/kernel/traps.o: in function `trap_init':
> > ./arch/mips/include/asm/msa.h:(.init.text+0x348): undefined reference to `handle_fpe'
> > ld: ./arch/mips/include/asm/msa.h:(.init.text+0x354): undefined reference to `handle_fpe'
> > ld: ./arch/mips/include/asm/msa.h:(.init.text+0x360): undefined reference to `handle_fpe'
> >
> > where the CONFIG_MIPS_FP_SUPPORT configuration option has been chosen.
> >
>
> Sorry, but I have a question. From the code in
> arch/mips/kernel/genex.S:567, 'handle_fpe’‘s
> definition is controlled by CONFIG_MIPS_FP_SUPPORT. Then how can it
> still report such
> error when the CONFIG_MIPS_FP_SUPPORT configuration option has been chosen.

Good catch, thanks! For some reason I inverted the condition in my mind
as I wrote the change description. I have now posted v2 with the mistake
corrected.

Maciej

2022-05-03 01:10:58

by Maciej W. Rozycki

[permalink] [raw]
Subject: [PATCH 2/2] MIPS: IP30: Remove incorrect `cpu_has_fpu' override

Remove unsupported forcing of `cpu_has_fpu' to 1, which makes the `nofpu'
kernel parameter non-functional, and also causes a link error:

ld: arch/mips/kernel/traps.o: in function `trap_init':
./arch/mips/include/asm/msa.h:(.init.text+0x348): undefined reference to `handle_fpe'
ld: ./arch/mips/include/asm/msa.h:(.init.text+0x354): undefined reference to `handle_fpe'
ld: ./arch/mips/include/asm/msa.h:(.init.text+0x360): undefined reference to `handle_fpe'

where the CONFIG_MIPS_FP_SUPPORT configuration option has been chosen.

Signed-off-by: Maciej W. Rozycki <[email protected]>
Fixes: 7505576d1c1a ("MIPS: add support for SGI Octane (IP30)")
Cc: [email protected] # v5.5+
---
arch/mips/include/asm/mach-ip30/cpu-feature-overrides.h | 1 -
1 file changed, 1 deletion(-)

linux-mips-ip30-cpu-has-fpu.diff
Index: linux-macro/arch/mips/include/asm/mach-ip30/cpu-feature-overrides.h
===================================================================
--- linux-macro.orig/arch/mips/include/asm/mach-ip30/cpu-feature-overrides.h
+++ linux-macro/arch/mips/include/asm/mach-ip30/cpu-feature-overrides.h
@@ -28,7 +28,6 @@
#define cpu_has_4kex 1
#define cpu_has_3k_cache 0
#define cpu_has_4k_cache 1
-#define cpu_has_fpu 1
#define cpu_has_nofpuex 0
#define cpu_has_32fpr 1
#define cpu_has_counter 1