Received: by 10.223.185.116 with SMTP id b49csp7391667wrg; Thu, 1 Mar 2018 04:57:23 -0800 (PST) X-Google-Smtp-Source: AG47ELtuIVxMHyOGZfoSCuWdlnGU+b0xYneG0TcmKddaFNuhGF6dEbo886yrYDZtQdGhWXc0Q5ob X-Received: by 10.101.81.4 with SMTP id f4mr1554431pgq.30.1519909043367; Thu, 01 Mar 2018 04:57:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519909043; cv=none; d=google.com; s=arc-20160816; b=TWlJc8eKEQL4y6jPKlUbvvRceBMC5jELKK1bbJQnLovenib6N/3kpZYmMO8tgX4mcg v2MpmlE0bRoMm1O1sYG091oX9rKlS/mcoEMyNAdWcm2fp4SN1RvSRrwq90hMmB9pMmeR lEcYH0F0TCuhZdetWsQbTkkMOx/dUXU2uR3I0Nl/Zfjzy7f4K0fqP+Zm/Fw+VH1d2X2J BuQWCkVYGiQy2N8zrEnhQz7M174kJvcnS4yfYWp1H01Yde1xIRGBL0ylIfpaQ+Z9+5nj 49GoxBZQnUWCwUR7/wB5vjU+T9O/uoDrlwzpFpj9YcKCI9YXCd9AvgASU0N0cTvsnZNz IiXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=Bg7B0hfDb1LbDSK0bEabGd/Si+r1Y+auDWs+NQonZeA=; b=zTYy8fyma8NSZeydt8rI0oecUJrl5t8uzAdF8hLAerFffRhCk6upIM/YgtJNMsQEBR 8+OJiAEZvy+yvSYRTmsTO/CzJvM4wf/fTQ1CSk3odl1n708nnEelJkNCooUURK7XNRSy fiqH/rrVZTvllpSNMsLe4CeDCtXP3PZ++aw/bX7z6kuosfs/eq1AZYspuWqiuD9MpRM0 bfu6T4RETdYHrH6Q1cwI01SaCTi8bARtazNSFwFciRYLq5+waq3xupgX/w4zqwAwKq7G bw5Rv2W24oZU1cbIOjIti/XIPuvRvOKQlPAwCpg7IIUpaaJIzx2GTAGCj5rCuDOhU/t7 IEoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Em5SaGCp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k8-v6si3021978pli.490.2018.03.01.04.57.09; Thu, 01 Mar 2018 04:57:23 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Em5SaGCp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030602AbeCAMzT (ORCPT + 99 others); Thu, 1 Mar 2018 07:55:19 -0500 Received: from mail-pl0-f66.google.com ([209.85.160.66]:38816 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030486AbeCAMzQ (ORCPT ); Thu, 1 Mar 2018 07:55:16 -0500 Received: by mail-pl0-f66.google.com with SMTP id m22-v6so68448pls.5 for ; Thu, 01 Mar 2018 04:55:16 -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=Bg7B0hfDb1LbDSK0bEabGd/Si+r1Y+auDWs+NQonZeA=; b=Em5SaGCpHMUEesTntDI1e6IAQipJqfwccY/fZosi0Moa8emnCtEbFUQ2X3iwxzP5vJ 1LTBfEaeIhO+NplLsnd+skz3Q6gQUXR8FDC5jNmIw6r/bXo/fiy7RdOWEAjoPIy5e03t QiyMpjvHHS0VdERDPEMW6Cn7YP8k2AWlJ8hYY= 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=Bg7B0hfDb1LbDSK0bEabGd/Si+r1Y+auDWs+NQonZeA=; b=KQRsqCrPiw99p059mxjKcHcEPCjIP8xbJje2jCeMQRM0DEk4dIdN3fLPLnZ8sarQg5 6b90bzb9VCdteEx7UGo69e46jwDwxbYQWen6DCXjfgnHcpbzZAcrgTeM98lLrfPeB6cs IJoRNwYvh8Y4/DPTrI646g5rT+VxCOdYq8HGjm6jfGgTzScAXugqK7pxD9kGZBWMRLB7 dpDiR7AM15MTlQ6Mm4isOEurOu1GeA0W4WvF66mB3vScWukWphnN7Mr+89jN+ukj17vb nAqHMQWoWl63q3h2JhrXRjmlhedCYqu3q4XKGPQk7kS/32viS3FmtO/iOvSOXjrBqvDA HDGA== X-Gm-Message-State: APf1xPA5SccV9g3X3nVEGalKi9jJIfZC6LUSpDf0duFYobLEwZY9AHsr B3UVyAyii4jz0Caz6CLY7RbZCQ== X-Received: by 2002:a17:902:e85:: with SMTP id 5-v6mr1849535plx.420.1519908915951; Thu, 01 Mar 2018 04:55:15 -0800 (PST) Received: from localhost.localdomain (176.122.172.82.16clouds.com. [176.122.172.82]) by smtp.gmail.com with ESMTPSA id x4sm2289655pfb.46.2018.03.01.04.55.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 01 Mar 2018 04:55:15 -0800 (PST) From: Alex Shi To: Marc Zyngier , Will Deacon , Ard Biesheuvel , Catalin Marinas , stable@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Laura Abbott , Alex Shi Subject: [PATCH 01/45] mm: Introduce lm_alias Date: Thu, 1 Mar 2018 20:53:38 +0800 Message-Id: <1519908862-11425-2-git-send-email-alex.shi@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519908862-11425-1-git-send-email-alex.shi@linaro.org> References: <1519908862-11425-1-git-send-email-alex.shi@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/linux/mm.h b/include/linux/mm.h index 2217e2f..edd2480 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. -- 2.7.4