Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp535091ybi; Wed, 17 Jul 2019 00:51:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqwMbrJRVKZmcNNt2rlAkJiu/0xXXIhtK8Kf+aLF8mcF2ich6Z1BTb7eOEx5pvpKcsDPe3H9 X-Received: by 2002:a63:125c:: with SMTP id 28mr6184001pgs.255.1563349875834; Wed, 17 Jul 2019 00:51:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563349875; cv=none; d=google.com; s=arc-20160816; b=lxh71WfIMIeFReXG2nYeJxSsF5DocuWZvWF4090ag6d+yolgihSFc9XgKJUTsVuKEp NBq+EPCyh10HbMBStWjOJhhp88MzhVu6sBXMIGO1Y6zLnPv1Jcto+9SbJd7hIY3zPscN 4GZAHobu2RprN7xFz0zbavhEjr39QcURfp0taLXcAXZDWFOHpW340xprfOu1VxKbJBZL +fbWAl0Yr+F8bbX2xZUFw0g0NrsYxPvE5UUdIQf2fzVTp286Ic9K1nth/fS7/8eDN8Ee NXuywKN8ClO1q3sW0viRCADWkNq2AY3TTtUm2pEkX2Wug6vn4fd/gmxhJtiRtMbmDS0b 1LoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=KIQ3VvL835mgwhQqErWgfWzR+E/04ZM2GevtJYNnIK0=; b=gJyDZ3ym7TT4sq6KOVLyl9m13MiyGXMzPlEG56yv4UzevAJGTM8ri9Y67TPiK2tIOG kK0BxpjwBu/eOec1+6c9B6DbpUYA58OIV8zTYHDc5HvKvGS36e6KYZqT5mUYXN5AD+dy QofgEnjye9o9IJDZwKU9VRfzPt5HgCRR/rECxRXCzOO9BvdkkLKTrHvVWrpj7oIhyHil AOC+KyG5w93uRFpPb7BgwJ3ivsmYGTjoPjQGWbjBICnkI2G7N6ISA+qpKekGAqR+4KOL rNKFB8LGgYETYKXWHrMqD+gs/NHCD9kp2VQCjk+BYRMBKixm+jhUUgq+5IOUdH++2CQ+ OWkQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m12si22288971pgn.149.2019.07.17.00.50.59; Wed, 17 Jul 2019 00:51:15 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730479AbfGQHuH (ORCPT + 99 others); Wed, 17 Jul 2019 03:50:07 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:2670 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727996AbfGQHtZ (ORCPT ); Wed, 17 Jul 2019 03:49:25 -0400 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 09709305C8229913BB49; Wed, 17 Jul 2019 15:49:24 +0800 (CST) Received: from huawei.com (10.175.124.28) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.439.0; Wed, 17 Jul 2019 15:49:13 +0800 From: Jason Yan To: , , , , , , , , CC: , , , , , , Jason Yan Subject: [RFC PATCH 03/10] powerpc: introduce kimage_vaddr to store the kernel base Date: Wed, 17 Jul 2019 16:06:14 +0800 Message-ID: <20190717080621.40424-4-yanaijie@huawei.com> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190717080621.40424-1-yanaijie@huawei.com> References: <20190717080621.40424-1-yanaijie@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.124.28] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now the kernel base is a fixed value - KERNELBASE. To support KASLR, we need a variable to store the kernel base. Signed-off-by: Jason Yan Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Nicholas Piggin Cc: Kees Cook --- arch/powerpc/include/asm/page.h | 2 ++ arch/powerpc/mm/init-common.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/arch/powerpc/include/asm/page.h b/arch/powerpc/include/asm/page.h index 0d52f57fca04..60a68d3a54b1 100644 --- a/arch/powerpc/include/asm/page.h +++ b/arch/powerpc/include/asm/page.h @@ -315,6 +315,8 @@ void arch_free_page(struct page *page, int order); struct vm_area_struct; +extern unsigned long kimage_vaddr; + #include #endif /* __ASSEMBLY__ */ #include diff --git a/arch/powerpc/mm/init-common.c b/arch/powerpc/mm/init-common.c index 9273c38009cb..c7a98c73e5c1 100644 --- a/arch/powerpc/mm/init-common.c +++ b/arch/powerpc/mm/init-common.c @@ -25,6 +25,8 @@ phys_addr_t memstart_addr = (phys_addr_t)~0ull; EXPORT_SYMBOL(memstart_addr); phys_addr_t kernstart_addr; EXPORT_SYMBOL(kernstart_addr); +unsigned long kimage_vaddr = KERNELBASE; +EXPORT_SYMBOL(kimage_vaddr); static bool disable_kuep = !IS_ENABLED(CONFIG_PPC_KUEP); static bool disable_kuap = !IS_ENABLED(CONFIG_PPC_KUAP); -- 2.17.2