From patchwork Fri Oct 11 12:22:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankit Jindal X-Patchwork-Id: 20963 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f198.google.com (mail-pd0-f198.google.com [209.85.192.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1492725EA1 for ; Fri, 11 Oct 2013 12:23:20 +0000 (UTC) Received: by mail-pd0-f198.google.com with SMTP id x10sf7606369pdj.9 for ; Fri, 11 Oct 2013 05:23:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:x-gm-message-state:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=eDMIqGUYsybabc43fCmpm2WvWHv9ShvcGBb/W4TOXhU=; b=O8Gd5s4OEigEt/6Z67hqREFl8Xe+n/tBxm2YVmw1EKOb4jvmJlMqjD7Tv3AiL1zBTK ESee951OAzWlb/lvYz1xhSmRPiacFjQil93b8+45dY8wfo3SZdziiED4jRjFySnN6IIN GAzEdHzcm325xuD1Duf677z6tEAWo0ohj7vOZLDigrJb6UrlhjCOniaphX+t1sy40LMY HpD5S0/4slsCaLFO9I8bNTLl4+lcCAnR73kaZ33AXB7qil7lwuD+YeidFLPvDK2jsttO +4C7Vj2gi4/KOwRrtRpt6SpZvhNqsr3yog8tb6NFx7JFwjXqqnlpoqCDIX3n/g2W08Zp 0kqw== X-Received: by 10.66.121.194 with SMTP id lm2mr6481264pab.20.1381494199315; Fri, 11 Oct 2013 05:23:19 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.64.38 with SMTP id l6ls1564197qes.89.gmail; Fri, 11 Oct 2013 05:23:19 -0700 (PDT) X-Received: by 10.52.76.200 with SMTP id m8mr61938vdw.53.1381494199170; Fri, 11 Oct 2013 05:23:19 -0700 (PDT) Received: from mail-vc0-f175.google.com (mail-vc0-f175.google.com [209.85.220.175]) by mx.google.com with ESMTPS id uh5si16582390vcb.52.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 11 Oct 2013 05:23:19 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.175 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.175; Received: by mail-vc0-f175.google.com with SMTP id ia6so1764528vcb.34 for ; Fri, 11 Oct 2013 05:23:19 -0700 (PDT) X-Gm-Message-State: ALoCoQneLQhq53B77WXtli2YP2eqaEW1yHSWR3CUHm7AlAhG4b/c/PZFuNuGwOsSFhBzwq2U1LCy X-Received: by 10.220.199.5 with SMTP id eq5mr21258611vcb.16.1381494199084; Fri, 11 Oct 2013 05:23:19 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp34943vcz; Fri, 11 Oct 2013 05:23:18 -0700 (PDT) X-Received: by 10.66.17.166 with SMTP id p6mr21488971pad.149.1381494198034; Fri, 11 Oct 2013 05:23:18 -0700 (PDT) Received: from mail-pa0-f47.google.com (mail-pa0-f47.google.com [209.85.220.47]) by mx.google.com with ESMTPS id pz2si39650601pac.260.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 11 Oct 2013 05:23:18 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.47 is neither permitted nor denied by best guess record for domain of ankit.jindal@linaro.org) client-ip=209.85.220.47; Received: by mail-pa0-f47.google.com with SMTP id kp14so4297650pab.34 for ; Fri, 11 Oct 2013 05:23:17 -0700 (PDT) X-Received: by 10.67.22.67 with SMTP id hq3mr21377893pad.132.1381494197625; Fri, 11 Oct 2013 05:23:17 -0700 (PDT) Received: from pnqlab023.amcc.com ([182.73.239.130]) by mx.google.com with ESMTPSA id uw6sm59608947pbc.8.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 11 Oct 2013 05:23:16 -0700 (PDT) From: Ankit Jindal To: linux-arm-kernel@lists.infradead.org Cc: patches@linaro.org, linaro-networking@linaro.org, linaro-kernel@lists.linaro.org, steve.mcintyre@linaro.org, tushar.jagad@linaro.org, catalin.marinas@arm.com, Ankit Jindal Subject: [RFC PATCH 4/4] ARM64: Support for 32-bit big endian userspace Date: Fri, 11 Oct 2013 17:52:15 +0530 Message-Id: <1381494135-15085-5-git-send-email-ankit.jindal@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1381494135-15085-1-git-send-email-ankit.jindal@linaro.org> References: <1381494135-15085-1-git-send-email-ankit.jindal@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ankit.jindal@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.175 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Set PSTATE.E for compatible binaries when using 64-bit BE kernel Signed-off-by: Ankit Jindal Signed-off-by: Tushar Jagad --- 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 {