From patchwork Tue Dec 6 23:50:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laura Abbott X-Patchwork-Id: 9463481 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 497E76022E for ; Tue, 6 Dec 2016 23:54:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3A28727D85 for ; Tue, 6 Dec 2016 23:54:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2EE46284D4; Tue, 6 Dec 2016 23:54:36 +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 E85FA27D85 for ; Tue, 6 Dec 2016 23:54:35 +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 1cEPXo-00051g-Q9; Tue, 06 Dec 2016 23:53:08 +0000 Received: from mail-qt0-f177.google.com ([209.85.216.177]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1cEPWO-0003uq-E7 for linux-arm-kernel@lists.infradead.org; Tue, 06 Dec 2016 23:51:42 +0000 Received: by mail-qt0-f177.google.com with SMTP id w33so362434517qtc.3 for ; Tue, 06 Dec 2016 15:51:19 -0800 (PST) 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:in-reply-to :references; bh=sXjHK5RcMYcN7uQjMbGP7Hp/QbxZFQA8zT500j7uBWo=; b=TSiwq23usXN23lZ1+QQUBYdIHg7hbvNWnbI/lOgCeqqLf9L+9d9XXMXRT9+MkzTWqq Z/5jaCG2hhcl4r/ZhgebKxe/1ORrIJcCWQ5N1u3vHa3+9PRFwZJKUCjzdVd1U/ClSqzg gEQ+e3BujaSgLQkCRR7NSzhlSFo87PKotNNCRaJBUzv8K5jCIko+Y0dH/p55ugyUmqD4 J6L4jqgu2bdHZkQyRpOhQILCy51RnmXNK74rqnQKy3EfNrBpHbl3zgwYB2vNQq9pbKYH 4blksG6YrCaHb8qxjNKebBqLBzSHDigxPMAjPdCuToBfE2cb8tJMqZwkeoQCd8V4cfiG mjsQ== X-Gm-Message-State: AKaTC0125bxF/HuP3c5KBU6Gj3zxcLxn385JiKNViPHL5+bkKyvvqz0TWALZe8isxuOl/9a6 X-Received: by 10.200.0.132 with SMTP id c4mr2163029qtg.44.1481068279001; Tue, 06 Dec 2016 15:51:19 -0800 (PST) Received: from labbott-redhat-machine.redhat.com ([2601:602:9800:177f::df9b]) by smtp.gmail.com with ESMTPSA id o190sm2739212qke.5.2016.12.06.15.51.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Dec 2016 15:51:18 -0800 (PST) From: Laura Abbott To: Mark Rutland , Ard Biesheuvel , Will Deacon , Catalin Marinas , Christoffer Dall , Marc Zyngier , Lorenzo Pieralisi Subject: [PATCHv5 05/11] mm: Introduce lm_alias Date: Tue, 6 Dec 2016 15:50:51 -0800 Message-Id: <1481068257-6367-6-git-send-email-labbott@redhat.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1481068257-6367-1-git-send-email-labbott@redhat.com> References: <1481068257-6367-1-git-send-email-labbott@redhat.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161206_155140_706497_C41D8A2B X-CRM114-Status: GOOD ( 12.02 ) 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. Signed-off-by: Laura Abbott --- v5: Split off from the arm64 conversion to __pa_symbol --- include/linux/mm.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/linux/mm.h b/include/linux/mm.h index a92c8d7..88556b8 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.