From patchwork Fri Mar 9 09:06:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Shi X-Patchwork-Id: 10270077 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 389BC60211 for ; Fri, 9 Mar 2018 09:08:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 306E129D99 for ; Fri, 9 Mar 2018 09:08:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2542329D9B; Fri, 9 Mar 2018 09:08:54 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9285929D99 for ; Fri, 9 Mar 2018 09:08:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=okyMTlCJ2LT776b8rGweeJEw099nS3Z8Eg1ykBO/NHU=; b=jgqUvqT7IEjz3vzAl66M9Hu64z 9FAjCJz6rNLLE/5DeG554PsxeKWjXAuxMVkZJH9/HR0ZYGZNL4FD7V1xjKrdL8Q4KCEEvXAZgnNLm YveXl7X45PPlVdXAFsl1JhdfGT+f3qbicKLV+pPfmdywtfQ/7TmFB20dk4tZaXXKSfPAHcCSXmE9C B+f9kzBxuI78SiNR1un5QGDskVXjPH2NMAE6PP71Mo1Lu9au/esVjnTBwLqAeE5jI19pMfHWTANsU inUuLqB7lHosSSCoGGkjTPCkg7e/1vLa/RGU0+dPuFCWKB1+tTRPgad8Ni0VE8of84Xuv23Io7DzJ Tygx7JxA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1euE16-0003VR-RJ; Fri, 09 Mar 2018 09:08:44 +0000 Received: from mail-pl0-x241.google.com ([2607:f8b0:400e:c01::241]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1euE0e-0003B8-C3 for linux-arm-kernel@lists.infradead.org; Fri, 09 Mar 2018 09:08:27 +0000 Received: by mail-pl0-x241.google.com with SMTP id y8-v6so4910769pll.13 for ; Fri, 09 Mar 2018 01:08:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=zbt0EpioQ/5w8Wjmf3j3cUq9h+xgqcvRvvPHaXOUkNI=; b=acnKVMTRpH0JCBPkofKVpuBztKJAdt4I23XRZstWj2hRXDjE6xaYlzNiZApeapXsnF 4NFpsT4BIQjWy8rLwnTn/cglTj1rFn5PinYo0aP770Uvzc8DHIYhqaDKyfLa66wfdyQx HBZsaffNlZe60TYSaJ0XzJrWRUDoP4xcpy9d0= 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=zbt0EpioQ/5w8Wjmf3j3cUq9h+xgqcvRvvPHaXOUkNI=; b=t219Gq65YZUn32mApf0xCS4KOjPxwru7hSSbi+ZvOH0+uQj+GwXfpdQ9FBOjlIWVsy SBpsOmjB9FXhRzT1VIHlJkkGiiskiMSMoi8jxnJGND6hivME/4b1nnoogGt6yZa1ycrO jtGEsv0VF8jPWueXE7bWLCXh64ZsX3InT1W7/xIUaWYz4rWZggW8LUz/PUNwWPFsS9ha sG06sAU12InZmAv89yi6Yl5RV3RIcy2/JsQk1yfiOYl5G+n1GdVn9JxuMjn1o4X3fSog pz8D39g4aPCBZ7848brmefjoq0Nwdm5MHrsIr0pP1EBanhiirhUQAxMVMjN24x3m86RM biaA== X-Gm-Message-State: APf1xPBJgY/wCnZMEV86SawYzcLaTWhxYM6jNrqDipD65PPIszRnTGz2 a/Fo+yv+e3nEt7bZcZ/VMUztIg== X-Google-Smtp-Source: AG47ELu2ErR/sjhbqTbultgbKgYvsv/O8tYgw6vswt2jRby1Xei7+PiKzI7ssw0xDFQE66NecFuHag== X-Received: by 2002:a17:902:a70f:: with SMTP id w15-v6mr26228294plq.79.1520586485929; Fri, 09 Mar 2018 01:08:05 -0800 (PST) Received: from localhost.localdomain (176.122.172.82.16clouds.com. [176.122.172.82]) by smtp.gmail.com with ESMTPSA id c7sm1961752pfg.36.2018.03.09.01.07.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Mar 2018 01:08:05 -0800 (PST) From: Alex Shi To: Marc Zyngier , Will Deacon , Ard Biesheuvel , Catalin Marinas , broonie@linaro.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 01/39] mm: Introduce lm_alias Date: Fri, 9 Mar 2018 17:06:44 +0800 Message-Id: <20180309090722.26279-2-alex.shi@linaro.org> X-Mailer: git-send-email 2.16.2.440.gc6284da In-Reply-To: <20180309090722.26279-1-alex.shi@linaro.org> References: <20180309090722.26279-1-alex.shi@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180309_010816_785243_BB31F53C X-CRM114-Status: GOOD ( 12.78 ) 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: Alex Shi , Laura Abbott 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 From: Laura Abbott commit 568c5fe5a54 upstream. 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 Signed-off-by: Will Deacon Signed-off-by: Alex Shi --- include/linux/mm.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/linux/mm.h b/include/linux/mm.h index 55f950afb60d..648f14335a9b 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -59,6 +59,14 @@ extern int sysctl_legacy_va_layout; #define __pa_symbol(x) __pa(RELOC_HIDE((unsigned long)(x), 0)) #endif +#ifndef page_to_virt +#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.