From patchwork Tue Jan 10 21:35:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laura Abbott X-Patchwork-Id: 9508565 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 6515560231 for ; Tue, 10 Jan 2017 21:37:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 55FBF285C3 for ; Tue, 10 Jan 2017 21:37:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4A9F1285C7; Tue, 10 Jan 2017 21:37:04 +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=-3.7 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0100C285C3 for ; Tue, 10 Jan 2017 21:37:04 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cR46I-0003T4-7R; Tue, 10 Jan 2017 21:37:02 +0000 Received: from mail-qk0-f182.google.com ([209.85.220.182]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cR45k-0002HA-JP for linux-arm-kernel@lists.infradead.org; Tue, 10 Jan 2017 21:36:31 +0000 Received: by mail-qk0-f182.google.com with SMTP id u25so573184642qki.2 for ; Tue, 10 Jan 2017 13:36:08 -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=tIBJiJcCsl++W/Tou9nU6hCkGQ0qiSKEzKaMqmqs/Wk=; b=SSBvY+HCvEg+kAtA16IGv0dOaCPR1bkjbJZJIlFnjvAeNLPoOyhdeVCdN3gkS1nxhI BrRqJ01+WGb8W16ryCulnmVBFY+3DFuBdaH7asaQmqBTE41d/W3+fA2tig13BDnGPt86 d4Fq8C1QQuu8RICsVkQZFfTjunCm0fYdbn0Ijpzp8bb6MipsAd2Du0s5+FMvUWoHAN22 LJ+Z2pjKmIj+LDtaCrbLNbiNMZZ/yvyop6r27f8zAxppQ+NemE2ABLqNurmJP6VtFge8 cxmFAAyuRkYUfCaB6YfT4JVf33JwuZG0r6TUfz+Lx2uarIfJfGzsgDbTvtibiX1yYuPF ugPw== X-Gm-Message-State: AIkVDXKYj8CYgXKY6VUO4FNDfE+irV79HmwJ9Incmh68rRzZJTcUjBOC4ta2rVdigW/elDqU X-Received: by 10.55.65.82 with SMTP id o79mr4792409qka.136.1484084167317; Tue, 10 Jan 2017 13:36:07 -0800 (PST) Received: from labbott-redhat-machine.redhat.com ([2601:602:9802:a8dc::6b06]) by smtp.gmail.com with ESMTPSA id n188sm2406857qkc.30.2017.01.10.13.36.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Jan 2017 13:36:06 -0800 (PST) From: Laura Abbott To: Mark Rutland , Ard Biesheuvel , Will Deacon , Catalin Marinas , Christoffer Dall , Marc Zyngier , Lorenzo Pieralisi , Florian Fainelli Subject: [PATCHv7 03/11] mm: Introduce lm_alias Date: Tue, 10 Jan 2017 13:35:42 -0800 Message-Id: <1484084150-1523-4-git-send-email-labbott@redhat.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1484084150-1523-1-git-send-email-labbott@redhat.com> References: <1484084150-1523-1-git-send-email-labbott@redhat.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170110_133628_899048_01090120 X-CRM114-Status: GOOD ( 11.88 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 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.