From patchwork Fri Jun 21 23:48:19 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Santosh Shilimkar X-Patchwork-Id: 2765061 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 9E6C7C0AB1 for ; Fri, 21 Jun 2013 23:53:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C4B59201B1 for ; Fri, 21 Jun 2013 23:53:54 +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 A9853201AE for ; Fri, 21 Jun 2013 23:53:53 +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 1UqB6i-00018u-31; Fri, 21 Jun 2013 23:51:09 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UqB5o-00005b-LI; Fri, 21 Jun 2013 23:50:12 +0000 Received: from arroyo.ext.ti.com ([192.94.94.40]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UqB4s-0008RD-3d for linux-arm-kernel@lists.infradead.org; Fri, 21 Jun 2013 23:49:17 +0000 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id r5LNmicS003750; Fri, 21 Jun 2013 18:48:44 -0500 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id r5LNmiNA005026; Fri, 21 Jun 2013 18:48:44 -0500 Received: from dlelxv22.itg.ti.com (172.17.1.197) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.2.342.3; Fri, 21 Jun 2013 18:48:44 -0500 Received: from ula0393909.am.dhcp.ti.com (ula0393909.am.dhcp.ti.com [158.218.103.117]) by dlelxv22.itg.ti.com (8.13.8/8.13.8) with ESMTP id r5LNmPJH025428; Fri, 21 Jun 2013 18:48:43 -0500 From: Santosh Shilimkar To: Subject: [PATCH 5/8] ARM: mm: Add __pv_stub_mov to patch MOV instruction Date: Fri, 21 Jun 2013 19:48:19 -0400 Message-ID: <1371858502-10083-6-git-send-email-santosh.shilimkar@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1371858502-10083-1-git-send-email-santosh.shilimkar@ti.com> References: <1371858502-10083-1-git-send-email-santosh.shilimkar@ti.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130621_194914_300605_2BD05F22 X-CRM114-Status: UNSURE ( 8.92 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -8.4 (--------) Cc: nicolas.pitre@linaro.org, linux@arm.linux.org.uk, catalin.marinas@arm.com, will.deacon@arm.com, r.sricharan@ti.com, Santosh Shilimkar 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.7 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 From: Sricharan R Patch adds stub for MOV instruction. This is preparatory patch to add the subsequent 64 bit patching which will use MOV stub. For review simplicity the patch is kept as a separate change Signed-off-by: Sricharan R Signed-off-by: Santosh Shilimkar --- arch/arm/include/asm/memory.h | 10 ++++++++++ arch/arm/kernel/head.S | 2 ++ arch/arm/kernel/vmlinux.lds.S | 5 +++++ 3 files changed, 17 insertions(+) diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h index 3d4f79c..d8a3ea6 100644 --- a/arch/arm/include/asm/memory.h +++ b/arch/arm/include/asm/memory.h @@ -172,6 +172,7 @@ * so that all we need to do is modify the 8-bit constant field. */ #define __PV_BITS_31_24 0x81000000 +#define __PV_BITS_7_0 0x81 extern phys_addr_t (*arch_virt_to_idmap) (unsigned long x); extern unsigned long __pv_phys_offset; @@ -188,6 +189,15 @@ extern unsigned long __pv_offset; : "=r" (to) \ : "r" (from), "I" (type)) +#define __pv_stub_mov(to, instr, type) \ + __asm__ volatile("@ __pv_stub_mov\n" \ + "1: " instr " %R0, %1\n" \ + " .pushsection .pv_high_table,\"a\"\n" \ + " .long 1b\n" \ + " .popsection\n" \ + : "=r" (to) \ + : "I" (type)) + static inline phys_addr_t __virt_to_phys(unsigned long x) { unsigned long t; diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S index 764e83b..b1bdeb5 100644 --- a/arch/arm/kernel/head.S +++ b/arch/arm/kernel/head.S @@ -565,6 +565,8 @@ ENDPROC(__fixup_pv_table) .long __pv_table_begin .long __pv_table_end 2: .long __pv_phys_offset +3: .long __pv_high_table_begin + .long __pv_high_table_end .text __fixup_a_pv_table: diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S index a871b8e..cf17c7b 100644 --- a/arch/arm/kernel/vmlinux.lds.S +++ b/arch/arm/kernel/vmlinux.lds.S @@ -182,6 +182,11 @@ SECTIONS *(.pv_table) __pv_table_end = .; } + .init.pv_high_table : { + __pv_high_table_begin = .; + *(.pv_high_table) + __pv_high_table_end = .; + } .init.data : { #ifndef CONFIG_XIP_KERNEL INIT_DATA