From: Omar Sandoval <osandov@osandov.com>
To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>
Cc: Alexey Dobriyan <adobriyan@gmail.com>,
Eric Biederman <ebiederm@xmission.com>,
James Morse <james.morse@arm.com>,
Bhupesh Sharma <bhsharma@redhat.com>,
kernel-team@fb.com
Subject: [PATCH v4 8/9] crash_core: use VMCOREINFO_SYMBOL_ARRAY() for swapper_pg_dir
Date: Wed, 25 Jul 2018 16:59:19 -0700 [thread overview]
Message-ID: <c05f9781ec204f40fc96f95086e7b6de6a3eb2c3.1532563124.git.osandov@fb.com> (raw)
In-Reply-To: <cover.1532563124.git.osandov@fb.com>
From: Omar Sandoval <osandov@fb.com>
This is preparation for allowing CRASH_CORE to be enabled for any
architecture.
swapper_pg_dir is always either an array or a macro expanding to NULL.
In the latter case, VMCOREINFO_SYMBOL() won't work, as it tries to take
the address of the given symbol:
#define VMCOREINFO_SYMBOL(name) \
vmcoreinfo_append_str("SYMBOL(%s)=%lx\n", #name, (unsigned long)&name)
Instead, use VMCOREINFO_SYMBOL_ARRAY(), which uses the value:
#define VMCOREINFO_SYMBOL_ARRAY(name) \
vmcoreinfo_append_str("SYMBOL(%s)=%lx\n", #name, (unsigned long)name)
This is the same thing for the array case but isn't an error for the
macro case.
Signed-off-by: Omar Sandoval <osandov@fb.com>
---
kernel/crash_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/crash_core.c b/kernel/crash_core.c
index b66aced5e8c2..e7b4025c7b24 100644
--- a/kernel/crash_core.c
+++ b/kernel/crash_core.c
@@ -401,7 +401,7 @@ static int __init crash_save_vmcoreinfo_init(void)
VMCOREINFO_SYMBOL(init_uts_ns);
VMCOREINFO_SYMBOL(node_online_map);
#ifdef CONFIG_MMU
- VMCOREINFO_SYMBOL(swapper_pg_dir);
+ VMCOREINFO_SYMBOL_ARRAY(swapper_pg_dir);
#endif
VMCOREINFO_SYMBOL(_stext);
VMCOREINFO_SYMBOL(vmap_area_list);
--
2.18.0
next prev parent reply other threads:[~2018-07-25 23:59 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-25 23:59 [PATCH v4 0/9] /proc/kcore improvements Omar Sandoval
2018-07-25 23:59 ` [PATCH v4 1/9] proc/kcore: don't grab lock for kclist_add() Omar Sandoval
2018-08-07 5:05 ` Bhupesh Sharma
2018-07-25 23:59 ` [PATCH v4 2/9] proc/kcore: don't grab lock for memory hotplug notifier Omar Sandoval
2018-07-25 23:59 ` [PATCH v4 3/9] proc/kcore: replace kclist_lock rwlock with rwsem Omar Sandoval
2018-07-25 23:59 ` [PATCH v4 4/9] proc/kcore: fix memory hotplug vs multiple opens race Omar Sandoval
2018-07-25 23:59 ` [PATCH v4 5/9] proc/kcore: hold lock during read Omar Sandoval
2018-07-25 23:59 ` [PATCH v4 6/9] proc/kcore: clean up ELF header generation Omar Sandoval
2018-07-25 23:59 ` [PATCH v4 7/9] proc/kcore: optimize multiple page reads Omar Sandoval
2018-07-25 23:59 ` Omar Sandoval [this message]
2018-07-25 23:59 ` [PATCH v4 9/9] proc/kcore: add vmcoreinfo note to /proc/kcore Omar Sandoval
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=c05f9781ec204f40fc96f95086e7b6de6a3eb2c3.1532563124.git.osandov@fb.com \
--to=osandov@osandov.com \
--cc=adobriyan@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=bhsharma@redhat.com \
--cc=ebiederm@xmission.com \
--cc=james.morse@arm.com \
--cc=kernel-team@fb.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.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).