From patchwork Thu Apr 17 20:14:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Victor Kamensky X-Patchwork-Id: 4010621 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 31D8DBFF02 for ; Thu, 17 Apr 2014 20:24:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 62CB22028D for ; Thu, 17 Apr 2014 20:24:31 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8995220170 for ; Thu, 17 Apr 2014 20:24:30 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WasoA-0006gh-Qv; Thu, 17 Apr 2014 20:21:18 +0000 Received: from mail-pa0-f50.google.com ([209.85.220.50]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Waso8-0006bE-Rc for linux-arm-kernel@lists.infradead.org; Thu, 17 Apr 2014 20:21:17 +0000 Received: by mail-pa0-f50.google.com with SMTP id kq14so740357pab.23 for ; Thu, 17 Apr 2014 13:20:53 -0700 (PDT) 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; bh=hYDXD5RDxx/0tvITG9WzeG48QzzluTACDM1WfJgEwdQ=; b=i/aAqgQMhJGv2wWqP966IGrLkaZN5maUtWIjVlbJLH5TWukXvf0SbZFyQfDw9MhWFt +vw0RtEDughqoeie35sYnDh8ybLEdKJJODAmjdlYHYYStwU78GU6SHOFz9oaKJteV/md jl4GvZMuHLAUtanuW6HU9cW3lzbviYl+j+2AtuLXuBFwZj5MgGrRJuTENylMl31oYpz/ 8QujwnQSJQ7Y/nRLHH/qifkwfCb2UCFfG/75uJyEMeVA4VIFynvnR08xjfSogy9G+zCo qYDnfR4NkUitk+y6C5IYS+Jbyg3k7mkg/lSdpvMHqogiuvqUxAtII/xr+C8oe5mYT1rI uSRA== X-Gm-Message-State: ALoCoQnHY+uQI8p2x4byH60e/QPogvaiJVIFO1HXZiW++wOqVi3evHnLTnKEFdXYNwTEcBvFNyd6 X-Received: by 10.68.178.162 with SMTP id cz2mr17626076pbc.51.1397765680473; Thu, 17 Apr 2014 13:14:40 -0700 (PDT) Received: from kamensky-w530.cisco.com.net (c-24-6-79-41.hsd1.ca.comcast.net. [24.6.79.41]) by mx.google.com with ESMTPSA id pe3sm55380072pbc.23.2014.04.17.13.14.39 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Apr 2014 13:14:39 -0700 (PDT) From: Victor Kamensky To: rmk@arm.linux.org.uk, nicolas.pitre@linaro.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] ARM: fix big endian __pv_phys_pfn_offset size related issue Date: Thu, 17 Apr 2014 13:14:12 -0700 Message-Id: <1397765652-21623-1-git-send-email-victor.kamensky@linaro.org> X-Mailer: git-send-email 1.8.1.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140417_132116_938350_BC68D932 X-CRM114-Status: UNSURE ( 9.03 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.7 (/) Cc: taras.kondratiuk@linaro.org, linaro-kernel@lists.linaro.org, Victor Kamensky 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=-2.6 required=5.0 tests=BAYES_00,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 e26a9e00afc482b971afcaef1db8c9034d4d6d7c 'ARM: Better virt_to_page() handling' replaced __pv_phys_offset with __pv_phys_pfn_offset. Also note that size of __pv_phys_offset was quad but size of __pv_phys_pfn_offset is word. Instruction that used to update __pv_phys_offset which address is in r6 had to update low word of __pv_phys_offset so it used #LOW_OFFSET macro for store offset. Now when size of __pv_phys_pfn_offset is word, no difference between little endian and big endian should exist - i.e no offset should be used when __pv_phys_pfn_offset is stored. Note that for little endian image proposed change is noop, since in little endian case #LOW_OFFSET is defined 0 anyway. Reported-by: Taras Kondratiuk Signed-off-by: Victor Kamensky Acked-by: Nicolas Pitre --- arch/arm/kernel/head.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S index f8c0883..591d6e4 100644 --- a/arch/arm/kernel/head.S +++ b/arch/arm/kernel/head.S @@ -587,7 +587,7 @@ __fixup_pv_table: add r6, r6, r3 @ adjust __pv_phys_pfn_offset address add r7, r7, r3 @ adjust __pv_offset address mov r0, r8, lsr #12 @ convert to PFN - str r0, [r6, #LOW_OFFSET] @ save computed PHYS_OFFSET to __pv_phys_pfn_offset + str r0, [r6] @ save computed PHYS_OFFSET to __pv_phys_pfn_offset strcc ip, [r7, #HIGH_OFFSET] @ save to __pv_offset high bits mov r6, r3, lsr #24 @ constant for add/sub instructions teq r3, r6, lsl #24 @ must be 16MiB aligned