linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: ankit.jindal@linaro.org (Ankit Jindal)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH 4/4] ARM64: Support for 32-bit big endian userspace
Date: Fri, 11 Oct 2013 17:52:15 +0530	[thread overview]
Message-ID: <1381494135-15085-5-git-send-email-ankit.jindal@linaro.org> (raw)
In-Reply-To: <1381494135-15085-1-git-send-email-ankit.jindal@linaro.org>

Set PSTATE.E for compatible binaries when using 64-bit BE kernel

Signed-off-by: Ankit Jindal <ankit.jindal@linaro.org>
Signed-off-by: Tushar Jagad <tushar.jagad@linaro.org>
---
 arch/arm64/include/asm/processor.h |    3 +++
 arch/arm64/kernel/signal32.c       |    4 ++++
 2 files changed, 7 insertions(+)

diff --git a/arch/arm64/include/asm/processor.h b/arch/arm64/include/asm/processor.h
index ab239b2..d72f5c0 100644
--- a/arch/arm64/include/asm/processor.h
+++ b/arch/arm64/include/asm/processor.h
@@ -107,6 +107,9 @@ static inline void compat_start_thread(struct pt_regs *regs, unsigned long pc,
 	regs->pstate = COMPAT_PSR_MODE_USR;
 	if (pc & 1)
 		regs->pstate |= COMPAT_PSR_T_BIT;
+#ifdef CONFIG_CPU_BIG_ENDIAN
+	regs->pstate |= COMPAT_PSR_E_BIT;
+#endif
 	regs->compat_sp = sp;
 }
 #endif
diff --git a/arch/arm64/kernel/signal32.c b/arch/arm64/kernel/signal32.c
index e393174..8f5b72e 100644
--- a/arch/arm64/kernel/signal32.c
+++ b/arch/arm64/kernel/signal32.c
@@ -481,6 +481,10 @@ static void compat_setup_return(struct pt_regs *regs, struct k_sigaction *ka,
 		spsr &= ~COMPAT_PSR_T_BIT;
 	}
 
+#ifdef CONFIG_CPU_BIG_ENDIAN
+	spsr |= COMPAT_PSR_E_BIT;
+#endif
+
 	if (ka->sa.sa_flags & SA_RESTORER) {
 		retcode = ptr_to_compat(ka->sa.sa_restorer);
 	} else {
-- 
1.7.9.5

  parent reply	other threads:[~2013-10-11 12:22 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-11 12:22 [RFC PATCH 0/4] Big Endian support for ARM64 kernel Ankit Jindal
2013-10-11 12:22 ` [RFC PATCH 1/4] ARM64: Add Kconfig option to enable Big Endian kernel Ankit Jindal
2013-10-15 18:09   ` Christopher Covington
2013-10-16  6:49     ` Tushar Jagad
2013-10-16 14:30       ` Christopher Covington
2013-10-11 12:22 ` [RFC PATCH 2/4] ARM64: Include appropriate byteorder for Big Endian Ankit Jindal
2013-10-11 12:22 ` [RFC PATCH 3/4] ARM64: Big Endian fixes for kernel booting Ankit Jindal
2013-10-11 12:52   ` Ankit Jindal
2013-10-15 18:24   ` Christopher Covington
2013-10-16  7:04     ` Tushar Jagad
2013-10-11 12:22 ` Ankit Jindal [this message]
2013-10-15 18:09 ` [RFC PATCH 0/4] Big Endian support for ARM64 kernel Christopher Covington
2013-10-16  8:05   ` Tushar Jagad
2013-10-16 14:40     ` Christopher Covington

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1381494135-15085-5-git-send-email-ankit.jindal@linaro.org \
    --to=ankit.jindal@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).