lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240309-sunset-v2-17-f09912574d2c@ravnborg.org>
Date: Sat, 09 Mar 2024 19:15:38 +0100
From: Sam Ravnborg via B4 Relay <devnull+sam.ravnborg.org@...nel.org>
To: "David S. Miller" <davem@...emloft.net>, 
 Arnd Bergmann <arnd@...nel.org>, Andreas Larsson <andreas@...sler.com>
Cc: Helge Deller <deller@....de>, Randy Dunlap <rdunlap@...radead.org>, 
 John Paul Adrian Glaubitz <glaubitz@...sik.fu-berlin.de>, 
 Mark Cave-Ayland <mark.cave-ayland@...nde.co.uk>, 
 Kjetil Oftedal <oftedal@...il.com>, Thomas Zimmermann <tzimmermann@...e.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, Sam Ravnborg <sam@...nborg.org>
Subject: [PATCH v2 17/28] sparc32: Drop run-time cpuid patching

From: Sam Ravnborg <sam@...nborg.org>

The CPU is always leon, so the run-time cpuid patching is no longer
required.

Signed-off-by: Sam Ravnborg <sam@...nborg.org>
Reported-by: Andreas Larsson <andreas@...sler.com>
Cc: "David S. Miller" <davem@...emloft.net>
Cc: Arnd Bergmann <arnd@...nel.org>
Cc: Andreas Larsson <andreas@...sler.com>
---
 arch/sparc/include/asm/winmacro.h | 12 ------------
 arch/sparc/kernel/entry.S         | 13 -------------
 arch/sparc/kernel/setup_32.c      | 31 -------------------------------
 3 files changed, 56 deletions(-)

diff --git a/arch/sparc/include/asm/winmacro.h b/arch/sparc/include/asm/winmacro.h
index b6e911f5d93c..16144900bd6c 100644
--- a/arch/sparc/include/asm/winmacro.h
+++ b/arch/sparc/include/asm/winmacro.h
@@ -105,21 +105,9 @@
 
 #ifdef CONFIG_SMP
 #define LOAD_CURRENT(dest_reg, idreg) 			\
-661:	rd	%tbr, %idreg;				\
-	srl	%idreg, 10, %idreg;			\
-	and	%idreg, 0xc, %idreg;			\
-	.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..f158cbca3e62 100644
--- a/arch/sparc/kernel/entry.S
+++ b/arch/sparc/kernel/entry.S
@@ -984,21 +984,8 @@ flushw_all:
 
 #ifdef CONFIG_SMP
 ENTRY(hard_smp_processor_id)
-661:	rd		%tbr, %g1
-	srl		%g1, 12, %o0
-	and		%o0, 3, %o0
-	.section	.cpuid_patch, "ax"
-	/* Instruction location. */
-	.word		661b
-	/* SUN4D implementation. */
-	lda		[%g0] ASI_M_VIKING_TMP1, %o0
-	nop
-	nop
-	/* LEON implementation. */
 	rd		%asr17, %o0
 	srl		%o0, 0x1c, %o0
-	nop
-	.previous
 	retl
 	 nop
 ENDPROC(hard_smp_processor_id)
diff --git a/arch/sparc/kernel/setup_32.c b/arch/sparc/kernel/setup_32.c
index 0f38d72aae2d..af5f143ed882 100644
--- a/arch/sparc/kernel/setup_32.c
+++ b/arch/sparc/kernel/setup_32.c
@@ -178,34 +178,6 @@ extern int root_mountflags;
 
 char reboot_command[COMMAND_LINE_SIZE];
 
-struct cpuid_patch_entry {
-	unsigned int	addr;
-	unsigned int	sun4d[3];
-	unsigned int	leon[3];
-};
-extern struct cpuid_patch_entry __cpuid_patch, __cpuid_patch_end;
-
-static void __init per_cpu_patch(void)
-{
-	struct cpuid_patch_entry *p;
-
-	p = &__cpuid_patch;
-	while (p < &__cpuid_patch_end) {
-		unsigned long addr = p->addr;
-		unsigned int *insns;
-
-		insns = &p->leon[0];
-		*(unsigned int *) (addr + 0) = insns[0];
-		flushi(addr + 0);
-		*(unsigned int *) (addr + 4) = insns[1];
-		flushi(addr + 4);
-		*(unsigned int *) (addr + 8) = insns[2];
-		flushi(addr + 8);
-
-		p++;
-	}
-}
-
 static __init void leon_patch(void)
 {
 	/* Default instruction is leon - no patching */
@@ -271,9 +243,6 @@ void __init setup_arch(char **cmdline_p)
 		(*(linux_dbvec->teach_debugger))();
 	}
 
-	/* Run-time patch instructions to match the cpu model */
-	per_cpu_patch();
-
 	paging_init();
 
 	smp_setup_cpu_possible_map();

-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ