From patchwork Mon Aug 7 11:04:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miles Chen X-Patchwork-Id: 9885071 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 684F0602CC for ; Mon, 7 Aug 2017 11:37:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5A9FD2851A for ; Mon, 7 Aug 2017 11:37:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4F31328537; Mon, 7 Aug 2017 11:37:13 +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, RCVD_IN_DNSWL_NONE, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.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 C41662851A for ; Mon, 7 Aug 2017 11:37:12 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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:In-Reply-To:References: List-Owner; bh=w8aw7B5/Hl5OoAX/G8Ysdd9XdDs6zMaU5Z8g8/eRE+Q=; b=fzqOUX177PpvPN GNJudmTuLhmVmufXgHTy+IKMP8Fv3K7uey3DhQIAq2ue14Bw8iw6ibCM2euBNnNkfKpMbvjMBlKR5 3gQcyoyF7Q27/hNr2zt8slPJmElOOTqZOF6BXC3vioaA7Byyvu45VM93fMSLkAHRT40ezFsdjn8uq 2aWEQr/C/NjGvx4QvGqf6vV4mNMM88Cv/RYhgfJCHxQ1wWMtjoxxzKuzk504P61SyY5YzD7E2UBuK 4V64+6t2jvtTkNn0NIMam1UqJpW5YGaj0ogkZmS1fI3B0BqrMiDmAVr3nr71w9snqud36tZeFE/UH XBjIoTcNiq2fkcALc0qQ==; 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 1degLP-0002ac-Kp; Mon, 07 Aug 2017 11:37:11 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1degKu-00023t-6a; Mon, 07 Aug 2017 11:36:40 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Type:MIME-Version:Message-ID: Date:Subject:CC:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=1S+1OFSBIkSlXF6marPl2GZuL3iN3plN8fEEybujwl8=; b=RJ6FXA8HuzIISD9mmwzD4Zsix5 g0S9a4u51jzXx7eBEsIB4mar+rLzqcmQLXIs6OIs36yZUamz6JsHbBROnmvBNxVclXgARMICPv+V4 HsHdmp8oNZxY3mk1yxJOxStwoseFuXKUOgVhKcft/ri0faD6kgbkHwBtDB/hCdkenlJRpXfXJstsr CcASccr3TpbbRqHja9T8yqJn/TNX047JrHunXERqp24QgnNc2CqE0n/JGN7rEGnTTnNoO+h+1ou97 1cTUgOdaX7Iri69j7HHQ2Q990Vo3pw/BYarH4X86fOgaedqLNyhTiOdtfK+6Cy5ObsNwVwKf3EiuH yhZQxjrw==; Received: from [210.61.82.184] (helo=mailgw02.mediatek.com) by merlin.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1defqa-0001GX-H4; Mon, 07 Aug 2017 11:05:21 +0000 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1429076939; Mon, 07 Aug 2017 19:04:49 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs03n2.mediatek.inc (172.21.101.182) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Mon, 7 Aug 2017 19:04:48 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1210.3 via Frontend Transport; Mon, 7 Aug 2017 19:04:48 +0800 From: Miles Chen To: Catalin Marinas , Will Deacon Subject: [PATCH] arm64: correct modules range of kernel virtual memory layout Date: Mon, 7 Aug 2017 19:04:46 +0800 Message-ID: <1502103886-19725-1-git-send-email-miles.chen@mediatek.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-MTK: N X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Miles Chen , linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, wsd_upstream@mediatek.com Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The commit f80fb3a3d508 ("arm64: add support for kernel ASLR") moved module virtual address to [module_alloc_base, module_alloc_base + MODULES_VSIZE). Display module information of the virtual kernel memory layout by using module_alloc_base. testing output: 1) Current implementation: Virtual kernel memory layout: modules : 0xffffff8000000000 - 0xffffff8008000000 ( 128 MB) 2) this patch + KASLR: Virtual kernel memory layout: modules : 0xffffff8000560000 - 0xffffff8008560000 ( 128 MB) 3) this patch + KASLR and a dummy seed: Virtual kernel memory layout: modules : 0xffffffa7df637000 - 0xffffffa7e7637000 ( 128 MB) Signed-off-by: Miles Chen --- arch/arm64/mm/init.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index 5960bef..57a11d5 100644 --- a/arch/arm64/mm/init.c +++ b/arch/arm64/mm/init.c @@ -52,6 +52,7 @@ #include #include #include +#include /* * We need to be able to catch inadvertent references to memstart_addr @@ -609,8 +610,8 @@ void __init mem_init(void) pr_notice(" kasan : 0x%16lx - 0x%16lx (%6ld GB)\n", MLG(KASAN_SHADOW_START, KASAN_SHADOW_END)); #endif - pr_notice(" modules : 0x%16lx - 0x%16lx (%6ld MB)\n", - MLM(MODULES_VADDR, MODULES_END)); + pr_notice(" modules : 0x%16llx - 0x%16llx (%6lld MB)\n", + MLM(module_alloc_base, module_alloc_base + MODULES_VSIZE)); pr_notice(" vmalloc : 0x%16lx - 0x%16lx (%6ld GB)\n", MLG(VMALLOC_START, VMALLOC_END)); pr_notice(" .text : 0x%p" " - 0x%p" " (%6ld KB)\n",