From patchwork Tue Nov 5 02:16:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Victor Kamensky X-Patchwork-Id: 3138921 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C2B559F407 for ; Tue, 5 Nov 2013 03:07:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B557B205EA for ; Tue, 5 Nov 2013 03:07:41 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AD41D205E8 for ; Tue, 5 Nov 2013 03:07:40 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VdWDq-0006YO-EM; Tue, 05 Nov 2013 02:18:27 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VdWD0-0004kr-Ij; Tue, 05 Nov 2013 02:17:34 +0000 Received: from mail-pd0-f173.google.com ([209.85.192.173]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VdWCS-0004dK-PB for linux-arm-kernel@lists.infradead.org; Tue, 05 Nov 2013 02:17:01 +0000 Received: by mail-pd0-f173.google.com with SMTP id r10so7479680pdi.4 for ; Mon, 04 Nov 2013 18:16:38 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=3o5XfOSy1H7rLd6NYbv3hqM/Pgv3K8LfW3YNXO/RLhA=; b=MdEMwSToldEhUtpaYV+29wIdvXs8kk05X1j9Yx+nr7fTKChtUPCNXChaRpBzUJ+wLx +r7XLQlsuV5kwP9wG//JXWNo1VCpX4ykBLzV78noWbvMugZc952v3vzG8L8fiAKYxH6H 7fDc717zvJidHcX4r4itPHt41Z5hYrWsBNUAKkcW9VhhQfuqu2CZes7iXIXyTtjBR6G7 t1JXF0x9aoW/9mvazb7S9G7Pz19bFVCZkdU3hVroHFaTPrEinYybazRgDqUF0rdlyZDj OmFPCgfmHPtbda4GgnAnG9RqjxPiMX4+K8PpE/wzjAXRJ/upEdYY3bUUFoE30hwVk6Cx 6Avg== X-Gm-Message-State: ALoCoQkVm7U3dPqyzFbi7Hu24na1ih2xVMmPAr5bXfmO8pPaQRd7Aw9zOUOLMk1pczml1F/axjJa X-Received: by 10.68.179.4 with SMTP id dc4mr20415873pbc.45.1383617798699; Mon, 04 Nov 2013 18:16:38 -0800 (PST) Received: from kamensky-w530.cisco.com.com (128-107-239-234.cisco.com. [128.107.239.234]) by mx.google.com with ESMTPSA id ry4sm36533776pab.4.2013.11.04.18.16.37 for (version=TLSv1.2 cipher=AES128-GCM-SHA256 bits=128/128); Mon, 04 Nov 2013 18:16:38 -0800 (PST) From: Victor Kamensky To: linux-arm-kernel@lists.infradead.org, ben.dooks@codethink.co.uk, rmk@arm.linux.org.uk Subject: [PATCH 3/3] ARM: fix mov to mvn conversion in case of 64 bit phys_addr_t and BE Date: Mon, 4 Nov 2013 18:16:05 -0800 Message-Id: <1383617765-28052-4-git-send-email-victor.kamensky@linaro.org> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1383617765-28052-1-git-send-email-victor.kamensky@linaro.org> References: <1383617765-28052-1-git-send-email-victor.kamensky@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131104_211700_948488_A476B1DB X-CRM114-Status: UNSURE ( 9.16 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.9 (-) Cc: nicolas.pitre@linaro.org, linaro-kernel@lists.linaro.org, patches@linaro.org, Victor Kamensky , r.sricharan@ti.com, santosh.shilimkar@ti.com, linaro-networking@linaro.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fix patching code to convert mov instruction into mvn instruction in case of CONFIG_ARCH_PHYS_ADDR_T_64BIT and CONFIG_ARM_PATCH_PHYS_VIRT. In BE case store into r0 proper bits so byte swapped instruction could be modified correctly. Signed-off-by: Victor Kamensky Reviewed-by: R Sricharan Acked-by: Santosh Shilimkar --- arch/arm/kernel/head.S | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S index cd788d5..11d59b3 100644 --- a/arch/arm/kernel/head.S +++ b/arch/arm/kernel/head.S @@ -645,7 +645,11 @@ ARM_BE8(rev16 ip, ip) bcc 1b bx lr #else +#ifdef CONFIG_CPU_ENDIAN_BE8 + moveq r0, #0x00004000 @ set bit 22, mov to mvn instruction +#else moveq r0, #0x400000 @ set bit 22, mov to mvn instruction +#endif b 2f 1: ldr ip, [r7, r3] #ifdef CONFIG_CPU_ENDIAN_BE8 @@ -654,7 +658,7 @@ ARM_BE8(rev16 ip, ip) tst ip, #0x000f0000 @ check the rotation field orrne ip, ip, r6, lsl #24 @ mask in offset bits 31-24 biceq ip, ip, #0x00004000 @ clear bit 22 - orreq ip, ip, r0, lsl #24 @ mask in offset bits 7-0 + orreq ip, ip, r0 @ mask in offset bits 7-0 #else bic ip, ip, #0x000000ff tst ip, #0xf00 @ check the rotation field