[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d1a616f1-0fd2-4af0-8b89-e0d0a8842a6d@gaisler.com>
Date: Fri, 16 Feb 2024 18:12:08 +0100
From: Andreas Larsson <andreas@...sler.com>
To: sam@...nborg.org, "David S. Miller" <davem@...emloft.net>,
Arnd Bergmann <arnd@...nel.org>
Cc: Helge Deller <deller@....de>, Alexander Viro <viro@...iv.linux.org.uk>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Alan Stern <stern@...land.harvard.edu>, Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.com>, sparclinux@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-usb@...r.kernel.org,
linux-fbdev@...r.kernel.org, dri-devel@...ts.freedesktop.org,
linux-sound@...r.kernel.org
Subject: Re: [PATCH 17/27] sparc32: Drop run-time patching of ASI instructions
On 2023-12-19 23:03, Sam Ravnborg via B4 Relay wrote:
> From: Sam Ravnborg <sam@...nborg.org>
>
> With only LEON supported there is no need to run-time patch
> the instructions to match ASI.
>
> Move a few functions back to C with inline asm, now that
> run-time patching is not needed.
>
> Deleted a few functions that turns out not to be used rather
> than re-implement them in C.
..
> diff --git a/arch/sparc/include/asm/sections.h b/arch/sparc/include/asm/sections.h
> index 08f833453ab3..e9d28148850b 100644
> --- a/arch/sparc/include/asm/sections.h
> +++ b/arch/sparc/include/asm/sections.h
> @@ -8,7 +8,4 @@
> /* sparc entry point */
> extern char _start[];
>
> -extern char __leon_1insn_patch[];
> -extern char __leon_1insn_patch_end[];
> -
> #endif
> diff --git a/arch/sparc/include/asm/winmacro.h b/arch/sparc/include/asm/winmacro.h
> index b6e911f5d93c..c496b04cdfaf 100644
> --- a/arch/sparc/include/asm/winmacro.h
> +++ b/arch/sparc/include/asm/winmacro.h
> @@ -108,18 +108,11 @@
> 661: rd %tbr, %idreg; \
> srl %idreg, 10, %idreg; \
> and %idreg, 0xc, %idreg; \
These three lines, including the label, should also be removed as they
are not for LEON. Additionally, I think it would be best to split out
removing the cpuid instruction fixups to one patch and the MMU ASI
instruction fixups to another patch.
> - .section .cpuid_patch, "ax"; \
> - /* Instruction location. */ \
> - .word 661b; \
> - /* SUN4D implementation. */ \
> - lda [%g0] ASI_M_VIKING_TMP1, %idreg; \
> - sll %idreg, 2, %idreg; \
> - nop; \
> - /* LEON implementation. */ \
> + \
> rd %asr17, %idreg; \
> srl %idreg, 0x1c, %idreg; \
> sll %idreg, 0x02, %idreg; \
> - .previous; \
> + \
> sethi %hi(current_set), %dest_reg; \
> or %dest_reg, %lo(current_set), %dest_reg;\
> ld [%idreg + %dest_reg], %dest_reg;
> diff --git a/arch/sparc/kernel/entry.S b/arch/sparc/kernel/entry.S
> index 0f2417ee3f95..9cf8f87e8c42 100644
> --- a/arch/sparc/kernel/entry.S
> +++ b/arch/sparc/kernel/entry.S
The hard_smp_processor_id function also needs to be reduced to just the
LEON code. With the patching removed, SMP otherwise breaks with CPUs
other than CPU 0 getting stuck.
Thanks,
Andreas
Powered by blists - more mailing lists