From patchwork Tue Jan 3 17:21:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laura Abbott X-Patchwork-Id: 9495261 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9C054606A7 for ; Tue, 3 Jan 2017 17:24:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A3D6D27BFF for ; Tue, 3 Jan 2017 17:24:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9850427C2D; Tue, 3 Jan 2017 17:24:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 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.wl.linuxfoundation.org (Postfix) with ESMTPS id 330FC27BFF for ; Tue, 3 Jan 2017 17:24:47 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1cOSo5-0004dX-1U; Tue, 03 Jan 2017 17:23:29 +0000 Received: from mail-qk0-f175.google.com ([209.85.220.175]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1cOSnH-0004FQ-GH for linux-arm-kernel@lists.infradead.org; Tue, 03 Jan 2017 17:22:41 +0000 Received: by mail-qk0-f175.google.com with SMTP id u25so370887746qki.2 for ; Tue, 03 Jan 2017 09:22:19 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Bt/slw2Y2uQs4vyxNsdl04AyhuuEcydCevi8HDDtAig=; b=NKhYcCiPVms7ZjzwHN+RgB0ykFo5YLT/Otqx8oqmqEW3DUym41duZtKEfwUSeTssHi Xpo441HcGKi0a14R1ULY6Pc3srkj8yBOGIA1pqVu0qDX6DrCdqqs33KU53M8GsCLyAyy mKB3p88m8mqgbSLQ9yeGIRuttJoUMNVd/nDD+cKSIYaPug6W4ez6yoGyOZ2Lwmg1IYN3 f3CQ+IWNOKQcz+fBnT8OcrSHScxgowYeVFTv7QMo1+TM+/jd4aq0AdYifxaS4QRQmqRF CWCP689UVZh5/VS/jAYAOc30R20NfM0rZeST/NH36qPqkVFDNj8DzJyAEVFNXtew7qJQ C1/g== X-Gm-Message-State: AIkVDXLPnJ18ziVselPaImm4BuwKtspeTFfycNqSPdMBsdNuLO3Ga5+CXsCK65UfPMSwvclc X-Received: by 10.55.97.204 with SMTP id v195mr59125775qkb.158.1483464138309; Tue, 03 Jan 2017 09:22:18 -0800 (PST) Received: from labbott-redhat-machine.redhat.com ([2601:602:9802:a8dc::6b06]) by smtp.gmail.com with ESMTPSA id 53sm44034313qtm.5.2017.01.03.09.22.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Jan 2017 09:22:17 -0800 (PST) From: Laura Abbott To: Mark Rutland , Ard Biesheuvel , Will Deacon , Catalin Marinas , Christoffer Dall , Marc Zyngier , Lorenzo Pieralisi Subject: [PATCHv6 05/11] mm: Introduce lm_alias Date: Tue, 3 Jan 2017 09:21:47 -0800 Message-Id: <1483464113-1587-6-git-send-email-labbott@redhat.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1483464113-1587-1-git-send-email-labbott@redhat.com> References: <1483464113-1587-1-git-send-email-labbott@redhat.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170103_092239_689400_085369BE X-CRM114-Status: GOOD ( 11.10 ) 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: , Cc: x86@kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Ingo Molnar , "H. Peter Anvin" , Joonsoo Kim , Thomas Gleixner , Laura Abbott , Andrew Morton , linux-arm-kernel@lists.infradead.org, Marek Szyprowski MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Certain architectures may have the kernel image mapped separately to alias the linear map. Introduce a macro lm_alias to translate a kernel image symbol into its linear alias. This is used in part with work to add CONFIG_DEBUG_VIRTUAL support for arm64. Reviewed-by: Mark Rutland Tested-by: Mark Rutland Signed-off-by: Laura Abbott --- include/linux/mm.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/linux/mm.h b/include/linux/mm.h index fe6b403..5dc9c46 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -76,6 +76,10 @@ extern int mmap_rnd_compat_bits __read_mostly; #define page_to_virt(x) __va(PFN_PHYS(page_to_pfn(x))) #endif +#ifndef lm_alias +#define lm_alias(x) __va(__pa_symbol(x)) +#endif + /* * To prevent common memory management code establishing * a zero page mapping on a read fault.