From: ard.biesheuvel@linaro.org (Ard Biesheuvel)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 1/6] arm64: ptdump: use static initializers for vmemmap region boundaries
Date: Fri, 22 Apr 2016 18:48:03 +0200 [thread overview]
Message-ID: <1461343688-8552-2-git-send-email-ard.biesheuvel@linaro.org> (raw)
In-Reply-To: <1461343688-8552-1-git-send-email-ard.biesheuvel@linaro.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 <ard.biesheuvel@linaro.org>
---
arch/arm64/mm/dump.c | 49 ++++++--------------
1 file changed, 13 insertions(+), 36 deletions(-)
diff --git a/arch/arm64/mm/dump.c b/arch/arm64/mm/dump.c
index a21f47421b0c..493461159462 100644
--- a/arch/arm64/mm/dump.c
+++ b/arch/arm64/mm/dump.c
@@ -32,37 +32,21 @@ struct addr_marker {
const char *name;
};
-enum address_markers_idx {
- MODULES_START_NR = 0,
- MODULES_END_NR,
- VMALLOC_START_NR,
- VMALLOC_END_NR,
- FIXADDR_START_NR,
- FIXADDR_END_NR,
- PCI_START_NR,
- PCI_END_NR,
+static const struct addr_marker address_markers[] = {
+ { MODULES_VADDR, "Modules start" },
+ { MODULES_END, "Modules end" },
+ { VMALLOC_START, "vmalloc() Area" },
+ { VMALLOC_END, "vmalloc() End" },
+ { FIXADDR_START, "Fixmap start" },
+ { FIXADDR_TOP, "Fixmap end" },
+ { PCI_IO_START, "PCI I/O start" },
+ { PCI_IO_END, "PCI I/O end" },
#ifdef CONFIG_SPARSEMEM_VMEMMAP
- VMEMMAP_START_NR,
- VMEMMAP_END_NR,
+ { VMEMMAP_START, "vmemmap start" },
+ { VMEMMAP_START + VMEMMAP_SIZE, "vmemmap end" },
#endif
- 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" },
- { FIXADDR_START, "Fixmap start" },
- { FIXADDR_TOP, "Fixmap end" },
- { PCI_IO_START, "PCI I/O start" },
- { PCI_IO_END, "PCI I/O end" },
-#ifdef CONFIG_SPARSEMEM_VMEMMAP
- { 0, "vmemmap start" },
- { 0, "vmemmap end" },
-#endif
- { PAGE_OFFSET, "Linear Mapping" },
- { -1, NULL },
+ { PAGE_OFFSET, "Linear Mapping" },
+ { -1, NULL },
};
/*
@@ -347,13 +331,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;
--
2.7.4
next prev parent reply other threads:[~2016-04-22 16:48 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-22 16:48 [PATCH v2 0/6] arm64/ARM pt dumper changes Ard Biesheuvel
2016-04-22 16:48 ` Ard Biesheuvel [this message]
2016-04-22 17:07 ` [PATCH v2 1/6] arm64: ptdump: use static initializers for vmemmap region boundaries Mark Rutland
2016-04-22 16:48 ` [PATCH v2 2/6] arm64: ptdump: add region marker for kasan shadow region Ard Biesheuvel
2016-04-22 17:09 ` Mark Rutland
2016-04-22 16:48 ` [PATCH v2 3/6] arm64: ptdump: fold string literals into address_markers[] and pte_bits[] Ard Biesheuvel
2016-04-22 16:48 ` [PATCH v2 4/6] arm64: mm: dump: make page table dumping reusable Ard Biesheuvel
2016-04-25 11:07 ` Will Deacon
2016-05-13 12:56 ` Mark Rutland
2016-05-31 13:25 ` Will Deacon
2016-04-22 16:48 ` [PATCH v2 5/6] arm: " Ard Biesheuvel
2016-04-22 16:48 ` [PATCH v2 6/6] efi/arm*: add support to dump the EFI page tables Ard Biesheuvel
2016-04-22 17:01 ` Mark Rutland
2016-04-22 17:20 ` Ard Biesheuvel
2016-04-22 17:25 ` Mark Rutland
2016-04-25 11:26 ` Ard Biesheuvel
2016-04-27 20:12 ` Russell King - ARM Linux
2016-04-26 11:29 ` [PATCH v2 0/6] arm64/ARM pt dumper changes Will Deacon
2016-04-26 11:34 ` Ard Biesheuvel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1461343688-8552-2-git-send-email-ard.biesheuvel@linaro.org \
--to=ard.biesheuvel@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).