From patchwork Mon Jan 13 22:30:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: vkamensky X-Patchwork-Id: 23177 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qe0-f71.google.com (mail-qe0-f71.google.com [209.85.128.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5CD9B2054B for ; Mon, 13 Jan 2014 22:31:34 +0000 (UTC) Received: by mail-qe0-f71.google.com with SMTP id 8sf2487893qea.10 for ; Mon, 13 Jan 2014 14:31:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=kqOtoiMMnRuScjXBZIouLaXFomxU8F9ISWQkxIIlHTw=; b=T3EsoxoKu2u/WLATClaXDQp2K6BPIFVUlVJpczz+IRA0rkZ+Cl9eekm8HADlYi66r2 CeZnGmfBkAiJ0dXiePSF6ij7PbKnQTn0exwjSC1ktRQ6TEC5/y88svfwknmGFWtvo2z1 tqLbakOoMm4LOD1KNXaZn1p0Rg4hzKoXptdjHmunKP0xOHXiOFM+oVkRc127k95nNKq2 7COETjP0sVqudfk1wgI1f2tD5mWLe+IU50GK0TuHFiXNlzLQ+R4NGhjD99UaeaFuB175 htpVb8BjdnX9BaQwoVlcXLO71z0zDsr7UpQV9aUQ/jfXERxrGKEFudh/owRJ6paYMclW 7f6w== X-Gm-Message-State: ALoCoQnZ+zERW9Mdf61DOTAChmT6P1JkVHXw7xpNOIqvkKjafe0ctg5gQh2pDyNUfLLs9gSiPpeC X-Received: by 10.224.76.8 with SMTP id a8mr8075694qak.2.1389652293621; Mon, 13 Jan 2014 14:31:33 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.59.49 with SMTP id w17ls2788440qeq.68.gmail; Mon, 13 Jan 2014 14:31:33 -0800 (PST) X-Received: by 10.52.33.84 with SMTP id p20mr4668759vdi.31.1389652293551; Mon, 13 Jan 2014 14:31:33 -0800 (PST) Received: from mail-ve0-f171.google.com (mail-ve0-f171.google.com [209.85.128.171]) by mx.google.com with ESMTPS id wz7si11667042vdc.26.2014.01.13.14.31.33 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 13 Jan 2014 14:31:33 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.171 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.171; Received: by mail-ve0-f171.google.com with SMTP id c14so267044vea.30 for ; Mon, 13 Jan 2014 14:31:33 -0800 (PST) X-Received: by 10.58.37.67 with SMTP id w3mr5579504vej.22.1389652293360; Mon, 13 Jan 2014 14:31:33 -0800 (PST) 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.59.13.131 with SMTP id ey3csp160548ved; Mon, 13 Jan 2014 14:31:32 -0800 (PST) X-Received: by 10.66.139.169 with SMTP id qz9mr7903388pab.16.1389652292305; Mon, 13 Jan 2014 14:31:32 -0800 (PST) Received: from mail-pa0-f41.google.com (mail-pa0-f41.google.com [209.85.220.41]) by mx.google.com with ESMTPS id xy6si10463393pab.211.2014.01.13.14.31.31 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 13 Jan 2014 14:31:32 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.41 is neither permitted nor denied by best guess record for domain of victor.kamensky@linaro.org) client-ip=209.85.220.41; Received: by mail-pa0-f41.google.com with SMTP id fb1so6653277pad.28 for ; Mon, 13 Jan 2014 14:31:31 -0800 (PST) X-Received: by 10.68.66.1 with SMTP id b1mr32405718pbt.43.1389652291853; Mon, 13 Jan 2014 14:31:31 -0800 (PST) Received: from kamensky-w530.cisco.com (128-107-239-233.cisco.com. [128.107.239.233]) by mx.google.com with ESMTPSA id qq5sm40537862pbb.24.2014.01.13.14.31.29 for (version=TLSv1.2 cipher=AES128-GCM-SHA256 bits=128/128); Mon, 13 Jan 2014 14:31:30 -0800 (PST) From: Victor Kamensky To: linux-arm-kernel@lists.infradead.org Cc: ben.dooks@codethink.co.uk, Dave.Martin@arm.com, will.deacon@arm.com, rmk@arm.linux.org.uk, taras.kondratiuk@linaro.org, comelton@cisco.com, patches@linaro.org, linaro-kernel@lists.linaro.org, Victor Kamensky Subject: [PATCH] ARM: asm: __und_usr_thumb need byteswap instructions in BE case Date: Mon, 13 Jan 2014 14:30:51 -0800 Message-Id: <1389652251-18298-1-git-send-email-victor.kamensky@linaro.org> X-Mailer: git-send-email 1.8.1.4 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: victor.kamensky@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.171 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: , __und_usr_thumb function deals with thumb2 opcodes. In case of BE image, it needs to byteswap half word thumb2 encoded instructions before further processing them. Without this fix BE image user-land thread executing first VFP instruction encoded in thumb2 fails with SIGILL, because kernel does not recognize instruction and does not enable VFP. Reported-by: Corey Melton Signed-off-by: Victor Kamensky --- arch/arm/kernel/entry-armv.S | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S index b3fb8c9..1879e8d 100644 --- a/arch/arm/kernel/entry-armv.S +++ b/arch/arm/kernel/entry-armv.S @@ -451,9 +451,11 @@ __und_usr_thumb: .arch armv6t2 #endif 2: ldrht r5, [r4] +ARM_BE8(rev16 r5, r5) @ little endian instruction cmp r5, #0xe800 @ 32bit instruction if xx != 0 blo __und_usr_fault_16 @ 16bit undefined instruction 3: ldrht r0, [r2] +ARM_BE8(rev16 r0, r0) @ little endian instruction add r2, r2, #2 @ r2 is PC + 2, make it PC + 4 str r2, [sp, #S_PC] @ it's a 2x16bit instr, update orr r0, r0, r5, lsl #16