All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] m68k: math-emu: Fix dependencies of math emulation support
@ 2022-05-13 12:50 Geert Uytterhoeven
  2022-05-16  6:06 ` Greg Ungerer
  0 siblings, 1 reply; 2+ messages in thread
From: Geert Uytterhoeven @ 2022-05-13 12:50 UTC (permalink / raw)
  To: Greg Ungerer
  Cc: kernel test robot, linux-m68k, linux-kernel, Geert Uytterhoeven

If CONFIG_M54xx=y, CONFIG_MMU=y, and CONFIG_M68KFPU_EMU=y:

    {standard input}:272: Error: invalid instruction for this architecture; needs 68000 or higher (68000 [68ec000, 68hc000, 68hc001, 68008, 68302, 68306, 68307, 68322, 68356], 68010, 68020 [68k, 68ec020], 68030 [68ec030], 68040 [68ec040], 68060 [68ec060], cpu32 [68330, 68331, 68332, 68333, 68334, 68336, 68340, 68341, 68349, 68360], fidoa [fido]) -- statement `sub.b %d1,%d3' ignored
    {standard input}:609: Error: invalid instruction for this architecture; needs 68020 or higher (68020 [68k, 68ec020], 68030 [68ec030], 68040 [68ec040], 68060 [68ec060]) -- statement `bfextu 4(%a1){%d0,#8},%d0' ignored
    {standard input}:752: Error: operands mismatch -- statement `mulu.l 4(%a0),%d3:%d0' ignored
    {standard input}:1155: Error: operands mismatch -- statement `divu.l %d0,%d3:%d7' ignored

The math emulation support code is intended for 68020 and higher, and
uses several instructions or instruction modes not available on coldfire
or 68000.

Originally, the dependency of M68KFPU_EMU on MMU was fine, as MMU
support was only available on 68020 or higher.  But this assumption
was broken by the introduction of MMU support for M547x and M548x.

Drop the dependency on MMU, as the code should work fine on 68020 and up
without MMU (which are not yet supported by Linux, though).
Add dependencies on M68KCLASSIC (to rule out Coldfire) and FPU (kernel
has some type of floating-point support --- be it hardware or software
emulated, to rule out anything below 68020).

Fixes: 1f7034b9616e6f14 ("m68k: allow ColdFire 547x and 548x CPUs to be built with MMU enabled")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
To be queued in the m68k for-v5.19 branch.

v2:
  - Fix typo in M68KCLASSIC,
  - Improve rationale behind FPU dependency.
---
 arch/m68k/Kconfig.cpu | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/m68k/Kconfig.cpu b/arch/m68k/Kconfig.cpu
index 16ea9a67723c09dc..3d5da25c73b5af8a 100644
--- a/arch/m68k/Kconfig.cpu
+++ b/arch/m68k/Kconfig.cpu
@@ -327,7 +327,7 @@ comment "Processor Specific Options"
 
 config M68KFPU_EMU
 	bool "Math emulation support"
-	depends on MMU
+	depends on M68KCLASSIC && FPU
 	help
 	  At some point in the future, this will cause floating-point math
 	  instructions to be emulated by the kernel on machines that lack a
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] m68k: math-emu: Fix dependencies of math emulation support
  2022-05-13 12:50 [PATCH v2] m68k: math-emu: Fix dependencies of math emulation support Geert Uytterhoeven
@ 2022-05-16  6:06 ` Greg Ungerer
  0 siblings, 0 replies; 2+ messages in thread
From: Greg Ungerer @ 2022-05-16  6:06 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: kernel test robot, linux-m68k, linux-kernel

Hi Geert,

On 13/5/22 22:50, Geert Uytterhoeven wrote:
> If CONFIG_M54xx=y, CONFIG_MMU=y, and CONFIG_M68KFPU_EMU=y:
> 
>      {standard input}:272: Error: invalid instruction for this architecture; needs 68000 or higher (68000 [68ec000, 68hc000, 68hc001, 68008, 68302, 68306, 68307, 68322, 68356], 68010, 68020 [68k, 68ec020], 68030 [68ec030], 68040 [68ec040], 68060 [68ec060], cpu32 [68330, 68331, 68332, 68333, 68334, 68336, 68340, 68341, 68349, 68360], fidoa [fido]) -- statement `sub.b %d1,%d3' ignored
>      {standard input}:609: Error: invalid instruction for this architecture; needs 68020 or higher (68020 [68k, 68ec020], 68030 [68ec030], 68040 [68ec040], 68060 [68ec060]) -- statement `bfextu 4(%a1){%d0,#8},%d0' ignored
>      {standard input}:752: Error: operands mismatch -- statement `mulu.l 4(%a0),%d3:%d0' ignored
>      {standard input}:1155: Error: operands mismatch -- statement `divu.l %d0,%d3:%d7' ignored
> 
> The math emulation support code is intended for 68020 and higher, and
> uses several instructions or instruction modes not available on coldfire
> or 68000.
> 
> Originally, the dependency of M68KFPU_EMU on MMU was fine, as MMU
> support was only available on 68020 or higher.  But this assumption
> was broken by the introduction of MMU support for M547x and M548x.
> 
> Drop the dependency on MMU, as the code should work fine on 68020 and up
> without MMU (which are not yet supported by Linux, though).
> Add dependencies on M68KCLASSIC (to rule out Coldfire) and FPU (kernel
> has some type of floating-point support --- be it hardware or software
> emulated, to rule out anything below 68020).
> 
> Fixes: 1f7034b9616e6f14 ("m68k: allow ColdFire 547x and 548x CPUs to be built with MMU enabled")
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>

Reviewed-by: Greg Ungerer <gerg@linux-m68k.org>

Regards
Greg



> ---
> To be queued in the m68k for-v5.19 branch.
> 
> v2:
>    - Fix typo in M68KCLASSIC,
>    - Improve rationale behind FPU dependency.
> ---
>   arch/m68k/Kconfig.cpu | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/m68k/Kconfig.cpu b/arch/m68k/Kconfig.cpu
> index 16ea9a67723c09dc..3d5da25c73b5af8a 100644
> --- a/arch/m68k/Kconfig.cpu
> +++ b/arch/m68k/Kconfig.cpu
> @@ -327,7 +327,7 @@ comment "Processor Specific Options"
>   
>   config M68KFPU_EMU
>   	bool "Math emulation support"
> -	depends on MMU
> +	depends on M68KCLASSIC && FPU
>   	help
>   	  At some point in the future, this will cause floating-point math
>   	  instructions to be emulated by the kernel on machines that lack a

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-05-16  6:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-13 12:50 [PATCH v2] m68k: math-emu: Fix dependencies of math emulation support Geert Uytterhoeven
2022-05-16  6:06 ` Greg Ungerer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.