Skip to content

Instantly share code, notes, and snippets.

@eerykitty
Created April 28, 2020 15:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eerykitty/01707dc6bca2be32b4c5e30d15d15dcf to your computer and use it in GitHub Desktop.
Save eerykitty/01707dc6bca2be32b4c5e30d15d15dcf to your computer and use it in GitHub Desktop.
Changes the 32 bit signal handler to use the previous endianness
of the process, instead of always using big endian. Removes dependency
on big endian to allow 32 bit vDSO to be built even on 64 bit LE kernels.
--- a/arch/powerpc/kernel/signal_32.c
+++ b/arch/powerpc/kernel/signal_32.c
@@ -1287,8 +1287,9 @@ int handle_signal32(struct ksignal *ksig, sigset_t *oldset,
regs->gpr[3] = ksig->sig;
regs->gpr[4] = (unsigned long) sc;
regs->nip = (unsigned long) (unsigned long)ksig->ka.sa.sa_handler;
- /* enter the signal handler in big-endian mode */
+ /* enter the signal handler in native-endian mode */
regs->msr &= ~MSR_LE;
+ regs->msr |= (MSR_KERNEL & MSR_LE);
return 0;
badframe:
diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype
index 27a81c291..4a7dfa707 100644
--- a/arch/powerpc/platforms/Kconfig.cputype
+++ b/arch/powerpc/platforms/Kconfig.cputype
@@ -490,7 +490,6 @@ endmenu
config VDSO32
def_bool y
- depends on PPC32 || CPU_BIG_ENDIAN
help
This symbol controls whether we build the 32-bit VDSO. We obviously
want to do that if we're building a 32-bit kernel. If we're building
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment