From patchwork Mon Oct 12 15:52:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Ryabinin X-Patchwork-Id: 7377461 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6758F9F1D5 for ; Mon, 12 Oct 2015 15:55:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8346A208EA for ; Mon, 12 Oct 2015 15:55:26 +0000 (UTC) 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.kernel.org (Postfix) with ESMTPS id B0F4020522 for ; Mon, 12 Oct 2015 15:55:24 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZlfQ0-0007CP-2k; Mon, 12 Oct 2015 15:53:44 +0000 Received: from mail-lb0-x231.google.com ([2a00:1450:4010:c04::231]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZlfPc-0006zh-06 for linux-arm-kernel@lists.infradead.org; Mon, 12 Oct 2015 15:53:21 +0000 Received: by lbbk10 with SMTP id k10so35200659lbb.0 for ; Mon, 12 Oct 2015 08:52:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=z5cmzfqJsQuaxiT289B73+9j8ZxaWp8u4Nljtdj7sC4=; b=ASiVQeP7OCheNYxM9gpIFlBEz10dTrxREwFUOd/xKTa7o8cyo7gpWd7wlrjJcwyeHc qzWBi9j/CO8OU8gPW/RYg8/ADyo9AQaj+t8gljGAH3cRLVKg5MhJMs4k8y61IdpzInB6 W/WNYNLFNIK1w1yXBCRlnm4yqAQ5xN+/LAIbSJr0rCDPrbtXT2FnPFHkJ6S6Oc+OwCUD QYVQxXKwbHvYzrP1C9IIjpkvxRdTQDwvL6S7Y6vduvMSNmth/rfjl0jPyw1u+gBQuhJL wQ/ocylZSZeDkRg2opG9H35yyX5quXuAZwHBi2fkMti+axGU+4a81rg0nNDu/xSSQtjh sBKg== X-Received: by 10.112.170.70 with SMTP id ak6mr9397638lbc.107.1444665178168; Mon, 12 Oct 2015 08:52:58 -0700 (PDT) Received: from localhost.sw.ru (swsoft-msk-nat.sw.ru. [195.214.232.10]) by smtp.gmail.com with ESMTPSA id oi5sm2157876lbb.13.2015.10.12.08.52.57 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 12 Oct 2015 08:52:57 -0700 (PDT) From: Andrey Ryabinin To: Will Deacon , Catalin Marinas , linux-arm-kernel@lists.infradead.org Subject: [PATCH v7 3/4] ARM64: kasan: print memory assignment Date: Mon, 12 Oct 2015 18:52:59 +0300 Message-Id: <1444665180-301-4-git-send-email-ryabinin.a.a@gmail.com> X-Mailer: git-send-email 2.4.9 In-Reply-To: <1444665180-301-1-git-send-email-ryabinin.a.a@gmail.com> References: <1444665180-301-1-git-send-email-ryabinin.a.a@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151012_085320_351096_5FBAA448 X-CRM114-Status: UNSURE ( 8.61 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.7 (--) 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: Yury , Alexey Klimov , Arnd Bergmann , linux-mm@kvack.org, Andrey Konovalov , Linus Walleij , Ard Biesheuvel , linux-kernel@vger.kernel.org, kasan-dev , David Keitel , Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Linus Walleij This prints out the virtual memory assigned to KASan in the boot crawl along with other memory assignments, if and only if KASan is activated. Example dmesg from the Juno Development board: Memory: 1691156K/2080768K available (5465K kernel code, 444K rwdata, 2160K rodata, 340K init, 217K bss, 373228K reserved, 16384K cma-reserved) Virtual kernel memory layout: kasan : 0xffffff8000000000 - 0xffffff9000000000 ( 64 GB) vmalloc : 0xffffff9000000000 - 0xffffffbdbfff0000 ( 182 GB) vmemmap : 0xffffffbdc0000000 - 0xffffffbfc0000000 ( 8 GB maximum) 0xffffffbdc2000000 - 0xffffffbdc3fc0000 ( 31 MB actual) fixed : 0xffffffbffabfd000 - 0xffffffbffac00000 ( 12 KB) PCI I/O : 0xffffffbffae00000 - 0xffffffbffbe00000 ( 16 MB) modules : 0xffffffbffc000000 - 0xffffffc000000000 ( 64 MB) memory : 0xffffffc000000000 - 0xffffffc07f000000 ( 2032 MB) .init : 0xffffffc0007f5000 - 0xffffffc00084a000 ( 340 KB) .text : 0xffffffc000080000 - 0xffffffc0007f45b4 ( 7634 KB) .data : 0xffffffc000850000 - 0xffffffc0008bf200 ( 445 KB) Signed-off-by: Linus Walleij Signed-off-by: Andrey Ryabinin Acked-by: Catalin Marinas --- arch/arm64/mm/init.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index f5c0680..7a1f9a0 100644 --- a/arch/arm64/mm/init.c +++ b/arch/arm64/mm/init.c @@ -298,6 +298,9 @@ void __init mem_init(void) #define MLK_ROUNDUP(b, t) b, t, DIV_ROUND_UP(((t) - (b)), SZ_1K) pr_notice("Virtual kernel memory layout:\n" +#ifdef CONFIG_KASAN + " kasan : 0x%16lx - 0x%16lx (%6ld GB)\n" +#endif " vmalloc : 0x%16lx - 0x%16lx (%6ld GB)\n" #ifdef CONFIG_SPARSEMEM_VMEMMAP " vmemmap : 0x%16lx - 0x%16lx (%6ld GB maximum)\n" @@ -310,6 +313,9 @@ void __init mem_init(void) " .init : 0x%p" " - 0x%p" " (%6ld KB)\n" " .text : 0x%p" " - 0x%p" " (%6ld KB)\n" " .data : 0x%p" " - 0x%p" " (%6ld KB)\n", +#ifdef CONFIG_KASAN + MLG(KASAN_SHADOW_START, KASAN_SHADOW_END), +#endif MLG(VMALLOC_START, VMALLOC_END), #ifdef CONFIG_SPARSEMEM_VMEMMAP MLG((unsigned long)vmemmap,