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: 54799 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by patches.linaro.org (Postfix) with ESMTPS id 56FA322DB6 for ; Mon, 12 Oct 2015 15:53:11 +0000 (UTC) Received: by lbbti1 with SMTP id ti1sf71808299lbb.3 for ; Mon, 12 Oct 2015 08:53:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=Gto7pazzAEq5t4L4llDdm5fPltNs0sbvyQMGgkOPdVc=; b=NnOZK4iuY6a/1pzKMYwWdrZ6Sbu2sGeBxuxJ8t7HuF8SX/fNH5J6sbb+AsR8widcWp xEYSKB7TwtMdts+zsNRg4KoEUrBWibSeO7O2gN1Hp3O9JswFb/xKTNmqslljhnjw4Q7k gQnBp4g30zxaYkjK2vnob5VCfLqW9Y1ArcRItBbnHALbtJ7oKN1WdeSmghXxh1BQJqi2 gGAFixLq9PrVCgoKz7MSlMDMv/wiqhmQAKMJ1ZyATuW/6vo9PIjPhrhJe3l+mazAGGMW xXMH1EkkqvjsMhQ7BcCUQVCEUYF8b4Y8FZDsnXAqCWesIyfbBHrkNLw4mpNn74CP5UgR +pgA== X-Gm-Message-State: ALoCoQm3NwrKS+t6JJtNF1VSVKODzCCSLzjTetWeKUmGKdvW+AavJpbDzmLW6/o5XrLxfBgh+238 X-Received: by 10.180.210.71 with SMTP id ms7mr3065955wic.4.1444665190236; Mon, 12 Oct 2015 08:53:10 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.37.144 with SMTP id l138ls543801lfl.8.gmail; Mon, 12 Oct 2015 08:53:10 -0700 (PDT) X-Received: by 10.112.170.70 with SMTP id ak6mr9398023lbc.107.1444665190005; Mon, 12 Oct 2015 08:53:10 -0700 (PDT) Received: from mail-lb0-x233.google.com (mail-lb0-x233.google.com. [2a00:1450:4010:c04::233]) by mx.google.com with ESMTPS id i5si8633574lbd.1.2015.10.12.08.53.09 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Oct 2015 08:53:09 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::233 as permitted sender) client-ip=2a00:1450:4010:c04::233; Received: by lbbck17 with SMTP id ck17so27184279lbb.1 for ; Mon, 12 Oct 2015 08:53:09 -0700 (PDT) X-Received: by 10.112.64.72 with SMTP id m8mr12421025lbs.41.1444665189689; Mon, 12 Oct 2015 08:53:09 -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.59.35 with SMTP id w3csp1623247lbq; Mon, 12 Oct 2015 08:53:08 -0700 (PDT) X-Received: by 10.107.30.135 with SMTP id e129mr3778496ioe.99.1444665188562; Mon, 12 Oct 2015 08:53:08 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 28si12578700iod.44.2015.10.12.08.53.08; Mon, 12 Oct 2015 08:53:08 -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; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752352AbbJLPxE (ORCPT + 30 others); Mon, 12 Oct 2015 11:53:04 -0400 Received: from mail-lb0-f171.google.com ([209.85.217.171]:33994 "EHLO mail-lb0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752052AbbJLPw7 (ORCPT ); Mon, 12 Oct 2015 11:52:59 -0400 Received: by lbbck17 with SMTP id ck17so27178737lbb.1 for ; Mon, 12 Oct 2015 08:52:58 -0700 (PDT) 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 Cc: Linus Walleij , Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov , Arnd Bergmann , linux-kernel@vger.kernel.org, David Keitel , linux-mm@kvack.org, kasan-dev , Alexey Klimov , Yury , Andrey Konovalov , Ard Biesheuvel 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Original-Sender: Ryabinin.A.A@gmail.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::233 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=neutral (body hash did not verify) header.i=@gmail.com; dmarc=fail (p=NONE dis=NONE) header.from=gmail.com Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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,