Bladeren bron

powerpc: Disable the fast-endian switch syscall by default

Back in 2008 we added support for "fast little-endian switch" in the
syscall path. This added a special case syscall number 0x1ebe, which
is caught very early in the system call exception and switches endian
with as little overhead as possible. See commit 745a14cc264b
("[POWERPC] Add fast little-endian switch system call") for full
details.

Although it is fast, it's also completely non standard. The "syscall
number" is out of the range of normal syscalls, it can't be traced or
audited, and it's a bit of a wart. To the best of our knowledge it was
only used by one program, now long since discontinued.

So in an effort to shake out any current users, put it behind a config
option, and make it default n. If anyone *is* using it they can
quickly reinstate it with a rebuild, and we can flip it to default y.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Michael Ellerman 7 jaren geleden
bovenliggende
commit
727f13616c
2 gewijzigde bestanden met toevoegingen van 11 en 0 verwijderingen
  1. 6 0
      arch/powerpc/Kconfig.debug
  2. 5 0
      arch/powerpc/kernel/exceptions-64s.S

+ 6 - 0
arch/powerpc/Kconfig.debug

@@ -369,4 +369,10 @@ config PPC_HTDUMP
 	def_bool y
 	def_bool y
 	depends on PPC_PTDUMP && PPC_BOOK3S
 	depends on PPC_PTDUMP && PPC_BOOK3S
 
 
+config PPC_FAST_ENDIAN_SWITCH
+	bool "Deprecated fast endian-switch syscall"
+        depends on DEBUG_KERNEL && PPC_BOOK3S_64
+        help
+	  If you're unsure what this is, say N.
+
 endmenu
 endmenu

+ 5 - 0
arch/powerpc/kernel/exceptions-64s.S

@@ -879,6 +879,7 @@ EXC_COMMON(trap_0b_common, 0xb00, unknown_exception)
 	rfid ; 							\
 	rfid ; 							\
 	b	. ;	/* prevent speculative execution */
 	b	. ;	/* prevent speculative execution */
 
 
+#ifdef CONFIG_PPC_FAST_ENDIAN_SWITCH
 #define SYSCALL_FASTENDIAN_TEST					\
 #define SYSCALL_FASTENDIAN_TEST					\
 BEGIN_FTR_SECTION						\
 BEGIN_FTR_SECTION						\
 	cmpdi	r0,0x1ebe ; 					\
 	cmpdi	r0,0x1ebe ; 					\
@@ -893,6 +894,10 @@ END_FTR_SECTION_IFSET(CPU_FTR_REAL_LE)				\
 	mr	r13,r9 ;					\
 	mr	r13,r9 ;					\
 	rfid ;		/* return to userspace */		\
 	rfid ;		/* return to userspace */		\
 	b	. ;	/* prevent speculative execution */
 	b	. ;	/* prevent speculative execution */
+#else
+#define SYSCALL_FASTENDIAN_TEST
+#define SYSCALL_FASTENDIAN
+#endif /* CONFIG_PPC_FAST_ENDIAN_SWITCH */
 
 
 #if defined(CONFIG_RELOCATABLE)
 #if defined(CONFIG_RELOCATABLE)
 	/*
 	/*