From patchwork Thu Jul 23 11:45:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: yalin wang X-Patchwork-Id: 6853061 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0EB42C05AC for ; Thu, 23 Jul 2015 11:49:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 01B7E206ED for ; Thu, 23 Jul 2015 11:49:01 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3928C20651 for ; Thu, 23 Jul 2015 11:49:00 +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 1ZIExc-0002Wx-1R; Thu, 23 Jul 2015 11:46:48 +0000 Received: from mail-pd0-x234.google.com ([2607:f8b0:400e:c02::234]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZIExC-0002VL-UW for linux-arm-kernel@lists.infradead.org; Thu, 23 Jul 2015 11:46:24 +0000 Received: by pdbbh15 with SMTP id bh15so110400484pdb.1 for ; Thu, 23 Jul 2015 04:46:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:content-type:content-transfer-encoding:subject:message-id:date :to:mime-version; bh=Y2gWxOVJm43DJdrRKJvQ4vX+ivc1OpHFcIhGrBkuJ84=; b=x7whkXlmWwzJBIo8wwrnZfLYgwj5Ib/Fmd2TP3xKUKM4poEhkW1w2JPaqBEipdzX3a e30BMnUJuMDmpl2olt8DVtk/1hFOcZbbw03SiSZmGEKFx2QbCcur6YcEu7IgxdEWVh2Y r/aEtplO/VjRDk8mxNj8qzyOla7NyhzV7eRJlpIi096IoXy1CVNv+xgDqI0QSsoH9x6e cykXXO589hjViJhI4rxg9pXxbrKoglYuMNzRHbd+aNE1herJvhLQJP71BHV24CLBg9Hy jogSw3E8EHmhff1P/RP+NCfJswDf07xd1lNXCLQqygs0SA/7A890XPwgAExzsLPWPjru VUig== X-Received: by 10.66.140.98 with SMTP id rf2mr18194359pab.138.1437651961631; Thu, 23 Jul 2015 04:46:01 -0700 (PDT) Received: from [17.87.20.100] ([17.87.20.100]) by smtp.gmail.com with ESMTPSA id dc8sm8579074pdb.23.2015.07.23.04.45.57 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 23 Jul 2015 04:46:01 -0700 (PDT) From: yalin wang Subject: [RFC] arm64:use set_fixmap_offset to make it more clear Message-Id: Date: Thu, 23 Jul 2015 19:45:53 +0800 To: catalin.marinas@arm.com, will.deacon@arm.com, zlim.lnx@gmail.com, punit.agrawal@arm.com, marc.zyngier@arm.com, lauraa@codeaurora.org, wcohen@redhat.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\)) X-Mailer: Apple Mail (2.2102) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150723_044623_031539_B81893CD X-CRM114-Status: GOOD ( 11.38 ) X-Spam-Score: -2.5 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 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.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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 A little change to patch_map() function, use set_fixmap_offset() to make code more clear. Signed-off-by: yalin wang Acked-by: Catalin Marinas Reviewed-by: Laura Abbott --- arch/arm64/kernel/insn.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/arm64/kernel/insn.c b/arch/arm64/kernel/insn.c index dd9671c..7dafd5a 100644 --- a/arch/arm64/kernel/insn.c +++ b/arch/arm64/kernel/insn.c @@ -101,9 +101,8 @@ static void __kprobes *patch_map(void *addr, int fixmap) return addr; BUG_ON(!page); - set_fixmap(fixmap, page_to_phys(page)); - - return (void *) (__fix_to_virt(fixmap) + (uintaddr & ~PAGE_MASK)); + return (void *)set_fixmap_offset(fixmap, page_to_phys(page) + + (addr & ~PAGE_MASK)); } static void __kprobes patch_unmap(int fixmap)