From: osandov@osandov.com (Omar Sandoval)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm64/mm: Introduce a variable to hold base address of linear region
Date: Wed, 11 Jul 2018 09:24:23 -0700 [thread overview]
Message-ID: <20180711162423.GA27477@vader> (raw)
In-Reply-To: <CACi5LpMRSuLEA0BSnbaxmQNZOdyp19XZEJK1AHntxTvnuquj_g@mail.gmail.com>
On Wed, Jul 11, 2018 at 09:06:27PM +0530, Bhupesh Sharma wrote:
> Hi James,
>
> On Wed, Jul 11, 2018 at 6:54 PM, James Morse <james.morse@arm.com> wrote:
> > Hi Bhupesh,
> >
> > (CC: +Omar)
> >
> > On 20/06/18 08:26, Bhupesh Sharma wrote:
> >> On Wed, Jun 20, 2018 at 7:46 AM, Jin, Yanjiang
> >> <yanjiang.jin@hxt-semitech.com> wrote:
> >>>> From: Bhupesh Sharma [mailto:bhsharma at redhat.com]
> >>>> On Tue, Jun 19, 2018 at 4:56 PM, James Morse <james.morse@arm.com> wrote:
> >>>>> I'm suggesting adding the contents of vmcoreinfo as a PT_NOTE section
> >>>>> of /proc/kcore's ELF header. No special knowledge necessary, any
> >>>>> elf-parser should be able to dump the values.
> >
> > [..]
> >>>> I am working on fixes on the above lines for kernel and user-space tools (like
> >>>> makedumpfile, crash-utility and kexec-tools).
> >>>>
> >>>> I will post some RFC patches on the same lines (or come back in case I get stuck
> >>>> somewhere) shortly.
> >
> > I spotted this series from Omar:
> > https://lkml.org/lkml/2018/7/6/866
> >
> > Hopefully it does what you need?
>
> Thanks a lot for sharing this useful series.
>
> BTW, I am sorry for taking a long time to reply to this thread, but I
> was reading some x86_64/ppc legacy code and also experimenting with
> approaches in both user-space and kernel-space and have some
> interesting updates.
>
> Just to recap, there are two separate issues we are seeing with arm64
> with user-space utilities which are used for debugging live systems or
> crashed kernels:
>
> - Availability of PHYS_OFFSET in user-space (both for KASLR and
> non-KASLR boot cases):
>
> I see two approaches to fix this issue:
> 1. Fix inside Kernel:
> a). See <https://www.spinics.net/lists/kexec/msg20847.html> for
> background details. Having PHY_OFFSET added to the '/proc/kcore' as a
> PT_NOTE (it is already added to vmcore as a NUMBER) would suffice.
>
> b). Omar's series add the vmcoreinfo to the kcore itself, so it would
> be sufficient for the above case as well, since PHYS_OFFSET is already
> added to the vmcoreinfo inside 'arch/arm64/kernel/machine_kexec.c':
>
> void arch_crash_save_vmcoreinfo(void)
> {
> <..snip..>
> vmcoreinfo_append_str("NUMBER(PHYS_OFFSET)=0x%llx\n",
> PHYS_OFFSET);
> <..snip..>
> }
>
> c). This will help the cases where we are debugging a 'live' (or
> running system).
>
> 2. Fix inside user-space:
> a). See as an example a flaky reference implementation in
> 'kexec-tools': See
> <https://github.com/bhupesh-sharma/kexec-tools/commit/e8f920158ce57399c770c7160711a72fc740f1d6>
> - Note that the calculation of 'ARM64_MEMSTART_ALIGN' value in
> user-space is quite tricky (as is evident from the above
> implementation and I took an easy route for my specific PAGE_SIZE and
> VA_BITS combination).
>
> b). For some user-space tools like crash and makedumpfile, the
> underlying macros like PMD_SHIFT etc have been added as arch-specific
> code, so they can handle such implementation better.
>
> c). But this again means adding more arch specific code to user-space,
> which probably not advisable.
>
> So, we will be better suited to go with a KERNEL fix for this case and
> Omar's series should help. I will go ahead and give it a try for
> arm64.
Thanks, please do take a look. A Reviewed-by (or at least Tested-by)
would help get it merged.
Note that for my use case, the workaround I've been using for now is to
get the physical address and size of vmcoreinfo from
/sys/kernel/vmcoreinfo, then reading from that physical address in
/proc/kcore (assuming that your kernel is new enough to fill in p_paddr
in the /proc/kcore segments).
prev parent reply other threads:[~2018-07-11 16:24 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-12 6:36 [PATCH] arm64/mm: Introduce a variable to hold base address of linear region Bhupesh Sharma
2018-06-12 6:53 ` Ard Biesheuvel
2018-06-12 8:25 ` Bhupesh Sharma
2018-06-12 10:12 ` James Morse
2018-06-13 5:16 ` Bhupesh Sharma
2018-06-13 10:11 ` Will Deacon
2018-06-14 6:23 ` Bhupesh Sharma
2018-06-15 16:52 ` Will Deacon
2018-06-15 20:02 ` Bhupesh Sharma
2018-06-13 10:29 ` James Morse
2018-06-14 7:53 ` Bhupesh Sharma
2018-06-14 16:17 ` James Morse
2018-06-19 3:02 ` Jin, Yanjiang
2018-06-19 8:55 ` Will Deacon
2018-06-19 9:34 ` Jin, Yanjiang
2018-06-19 9:40 ` Will Deacon
2018-06-19 9:57 ` Jin, Yanjiang
2018-06-19 10:16 ` James Morse
2018-06-19 10:37 ` Bhupesh Sharma
2018-06-19 11:26 ` James Morse
2018-06-19 11:58 ` Bhupesh Sharma
2018-06-20 2:16 ` Jin, Yanjiang
2018-06-20 7:26 ` Bhupesh Sharma
2018-06-20 10:06 ` James Morse
2018-07-11 13:24 ` James Morse
2018-07-11 15:36 ` Bhupesh Sharma
2018-07-11 16:24 ` Omar Sandoval [this message]
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=20180711162423.GA27477@vader \
--to=osandov@osandov.com \
--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).