From patchwork Mon Feb 22 10:00:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 62548 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp1130977lbl; Mon, 22 Feb 2016 02:02:27 -0800 (PST) X-Received: by 10.67.6.10 with SMTP id cq10mr36886318pad.120.1456135347038; Mon, 22 Feb 2016 02:02:27 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id 17si38801156pfr.69.2016.02.22.02.02.26 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Feb 2016 02:02:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for 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; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org; dkim=neutral (body hash did not verify) header.i=@linaro.org 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 1aXnJA-0007ew-1M; Mon, 22 Feb 2016 10:01:36 +0000 Received: from mail-wm0-x232.google.com ([2a00:1450:400c:c09::232]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aXnIi-0006xI-Mj for linux-arm-kernel@lists.infradead.org; Mon, 22 Feb 2016 10:01:10 +0000 Received: by mail-wm0-x232.google.com with SMTP id c200so162405933wme.0 for ; Mon, 22 Feb 2016 02:00:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=yJh3iPhGrJ+pnpVPqKuSaD21BlG7L6TQ5MmLK6rrpNM=; b=ZzaBuAViE1mrk9AZOfZgFEuXIrKKQ/vUtDs3MQHdfxBsFR39XkmPvOSzIhF9Sr96DI S3DyVInlvK3/JZ860iNZkOPDAm8D3g8iqpqldl6XD8jFTHH9VHYDiHRXAELEkEiL9gD4 JJMiayiCjr3VrCI7v+McafhobtSxlYRZAhe7s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=yJh3iPhGrJ+pnpVPqKuSaD21BlG7L6TQ5MmLK6rrpNM=; b=JluuZx5xvy+pihYALaglLTnycrLp6TO+BDWKA+ije81EdL7jrvdgezaEWeDREh0Axb fQuMLV57WKDOz2sdPmx0ESeU4Z/xFVuBEEEA5/+M8EzTmwpWJhwFmkOmBqKC2oV2GDIE o6cVI7KMy4zGlSanjeiWkmW/azzI0ajMhlk5mghFcCjUl9VkN6DIKz5vqbJdLNIVkjhn DMKlRd1z4i4AJLYTQYfEFAVORB/5w0mCBf3Iw36sk9zQlN2gnjQCxnk0rH2oE8lW0Cjd jKymswNuhSjsClMOxjE4r3BhOqaEFPThImD5YR0IjQak3MExjaM6sH+luIg3eEXy+0wQ NR8Q== X-Gm-Message-State: AG10YOSQ6xRF0ZCIKtb/74AkwnBt4aSAhuIALhgx49jfXH7MweWdMrygRrn+QbCZ6w7P7naN X-Received: by 10.194.84.66 with SMTP id w2mr14911998wjy.6.1456135247061; Mon, 22 Feb 2016 02:00:47 -0800 (PST) Received: from localhost.localdomain ([195.55.142.58]) by smtp.gmail.com with ESMTPSA id e194sm20449019wma.19.2016.02.22.02.00.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 22 Feb 2016 02:00:46 -0800 (PST) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, keescook@chromium.org, catalin.marinas@arm.com Subject: [PATCH 1/3] arm64: ptdump: use static initializers for vmemmap region boundaries Date: Mon, 22 Feb 2016 11:00:37 +0100 Message-Id: <1456135239-3607-2-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1456135239-3607-1-git-send-email-ard.biesheuvel@linaro.org> References: <1456135239-3607-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160222_020108_901305_E2A86B9C X-CRM114-Status: GOOD ( 11.65 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:400c:c09:0:0:0:232 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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: matt@codeblueprint.co.uk, Ard Biesheuvel MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org There is no need to initialize the vmemmap region boundaries dynamically, since they are compile time constants. So just add these constants to the global struct initializer, and drop the dynamic assignment and related code. Signed-off-by: Ard Biesheuvel --- arch/arm64/mm/dump.c | 47 +++++--------------- 1 file changed, 12 insertions(+), 35 deletions(-) -- 2.5.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel Acked-by: Mark Rutland diff --git a/arch/arm64/mm/dump.c b/arch/arm64/mm/dump.c index 6be918478f85..eadcb70e733c 100644 --- a/arch/arm64/mm/dump.c +++ b/arch/arm64/mm/dump.c @@ -34,37 +34,21 @@ struct addr_marker { const char *name; }; -enum address_markers_idx { - MODULES_START_NR = 0, - MODULES_END_NR, - VMALLOC_START_NR, - VMALLOC_END_NR, -#ifdef CONFIG_SPARSEMEM_VMEMMAP - VMEMMAP_START_NR, - VMEMMAP_END_NR, -#endif - FIXADDR_START_NR, - FIXADDR_END_NR, - PCI_START_NR, - PCI_END_NR, - KERNEL_SPACE_NR, -}; - static struct addr_marker address_markers[] = { - { MODULES_VADDR, "Modules start" }, - { MODULES_END, "Modules end" }, - { VMALLOC_START, "vmalloc() Area" }, - { VMALLOC_END, "vmalloc() End" }, + { MODULES_VADDR, "Modules start" }, + { MODULES_END, "Modules end" }, + { VMALLOC_START, "vmalloc() Area" }, + { VMALLOC_END, "vmalloc() End" }, #ifdef CONFIG_SPARSEMEM_VMEMMAP - { 0, "vmemmap start" }, - { 0, "vmemmap end" }, + { (u64)vmemmap, "vmemmap start" }, + { (u64)vmemmap + VMEMMAP_SIZE, "vmemmap end" }, #endif - { FIXADDR_START, "Fixmap start" }, - { FIXADDR_TOP, "Fixmap end" }, - { PCI_IO_START, "PCI I/O start" }, - { PCI_IO_END, "PCI I/O end" }, - { PAGE_OFFSET, "Linear Mapping" }, - { -1, NULL }, + { FIXADDR_START, "Fixmap start" }, + { FIXADDR_TOP, "Fixmap end" }, + { PCI_IO_START, "PCI I/O start" }, + { PCI_IO_END, "PCI I/O end" }, + { PAGE_OFFSET, "Linear Mapping" }, + { -1, NULL }, }; /* @@ -349,13 +333,6 @@ static int ptdump_init(void) for (j = 0; j < pg_level[i].num; j++) pg_level[i].mask |= pg_level[i].bits[j].mask; -#ifdef CONFIG_SPARSEMEM_VMEMMAP - address_markers[VMEMMAP_START_NR].start_address = - (unsigned long)virt_to_page(PAGE_OFFSET); - address_markers[VMEMMAP_END_NR].start_address = - (unsigned long)virt_to_page(high_memory); -#endif - pe = debugfs_create_file("kernel_page_tables", 0400, NULL, NULL, &ptdump_fops); return pe ? 0 : -ENOMEM;