From patchwork Tue May 26 09:27:44 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 48974 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2633F21411 for ; Tue, 26 May 2015 09:30:07 +0000 (UTC) Received: by lalw1 with SMTP id w1sf7305665lal.0 for ; Tue, 26 May 2015 02:30:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id:cc :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list; bh=/GMvMKgNgO24ar+qXPHtZ6CQc2apfGKWbACeXlIFk0c=; b=j9NwjWsqJvthUPOqJtTl8tvFoJI1nF7sfOz98u0pQEAyn7wr6ZACSTYoPGRczT2Pzc 297yFg/3xesDC9JWffOWKcvUd2vxlZCgvgMLgUPZV2HzC193m9i0cjRb8eB4TdCCXUaz gmDKGJQOAIiljD4G2s9DFPsCxsAnqDDoNIQLbCWnt8nIK9D+WeLD5wJ0pyVXH+ClGrPQ 4mTOor5Te6yOVNiG0P8ib99zaBcztWXjyG6mbxhHH++wUcjHfYZHJdnqO0NcmJYeWWOn vqAkyIk8qD41XGBGoS+LoznukyXGYdihi89BAdtQsYLlBw982X0jXZEYV5OWnCg5bJBF nqXw== X-Gm-Message-State: ALoCoQnUyk8HPatfPFufUPSkC4F0BqkYHZdGtPSoPxyeR+xyiHab5b+qHBxrbHPkt2kr7yrzHSd6 X-Received: by 10.152.4.230 with SMTP id n6mr26595339lan.2.1432632605807; Tue, 26 May 2015 02:30:05 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.27.229 with SMTP id w5ls806730lag.44.gmail; Tue, 26 May 2015 02:30:05 -0700 (PDT) X-Received: by 10.112.161.66 with SMTP id xq2mr22288459lbb.31.1432632605645; Tue, 26 May 2015 02:30:05 -0700 (PDT) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com. [209.85.217.179]) by mx.google.com with ESMTPS id kx6si10516340lac.108.2015.05.26.02.30.05 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 May 2015 02:30:05 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) client-ip=209.85.217.179; Received: by lbcmx3 with SMTP id mx3so66039890lbc.1 for ; Tue, 26 May 2015 02:30:05 -0700 (PDT) X-Received: by 10.152.87.204 with SMTP id ba12mr22310757lab.35.1432632605528; Tue, 26 May 2015 02:30:05 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp2407005lbb; Tue, 26 May 2015 02:30:04 -0700 (PDT) X-Received: by 10.66.242.79 with SMTP id wo15mr48033605pac.6.1432632603709; Tue, 26 May 2015 02:30:03 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id y10si20205951pdn.1.2015.05.26.02.30.02 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 May 2015 02:30:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; 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 1YxB9n-0005Ut-J2; Tue, 26 May 2015 09:28:19 +0000 Received: from mail-la0-f42.google.com ([209.85.215.42]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YxB9h-0005KW-Pt for linux-arm-kernel@lists.infradead.org; Tue, 26 May 2015 09:28:14 +0000 Received: by laat2 with SMTP id t2so63324205laa.1 for ; Tue, 26 May 2015 02:27:51 -0700 (PDT) X-Received: by 10.112.157.36 with SMTP id wj4mr21538406lbb.115.1432632471160; Tue, 26 May 2015 02:27:51 -0700 (PDT) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id wh9sm2892355lbb.45.2015.05.26.02.27.49 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 May 2015 02:27:50 -0700 (PDT) From: Linus Walleij To: linux-arm-kernel@lists.infradead.org, Andrey Ryabinin Subject: [PATCH] ARM64: kasan: print memory assignment Date: Tue, 26 May 2015 11:27:44 +0200 Message-Id: <1432632464-12248-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 1.9.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150526_022814_056373_559A04FA X-CRM114-Status: GOOD ( 11.04 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.215.42 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.215.42 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders Cc: Catalin Marinas , Linus Walleij , Will Deacon X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: linus.walleij@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 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 MB) 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 --- Done on top of Andrey's patch set obviously. Andrey: do what you want with this, I think it's kinda nice, you can harvest this patch for your patch series if you like, or squash into the ARM64 enablement patch, I have no preference. I'm testing out KASan on the Juno hardware. --- 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 597831bdddf3..066dc5e15c48 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 MB)\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,