From: Simon Horman <horms@verge.net.au>
To: HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>
Cc: surovegin@google.com, kexec@lists.infradead.org,
linux-kernel@vger.kernel.org, vgoyal@redhat.com,
ebiederm@xmission.com
Subject: Re: [PATCH] kdump: force page alignment for per-CPU crash notes.
Date: Thu, 1 Mar 2012 11:50:39 +0900 [thread overview]
Message-ID: <20120301025038.GD10053@verge.net.au> (raw)
In-Reply-To: <20120301.105126.193682835.d.hatayama@jp.fujitsu.com>
On Thu, Mar 01, 2012 at 10:51:26AM +0900, HATAYAMA Daisuke wrote:
> From: Eugene Surovegin <surovegin@google.com>
> Subject: Re: [PATCH] kdump: force page alignment for per-CPU crash notes.
> Date: Wed, 29 Feb 2012 17:39:55 -0800
>
> > On Wed, Feb 29, 2012 at 5:32 PM, Simon Horman <horms@verge.net.au> wrote:
> >> On Wed, Feb 29, 2012 at 05:23:10PM -0800, Eugene Surovegin wrote:
> >>> On Wed, Feb 29, 2012 at 5:18 PM, Simon Horman <horms@verge.net.au> wrote:
> >>>
> >>> > On Wed, Feb 29, 2012 at 09:21:23AM -0800, Eugene Surovegin wrote:
> >>> > > Per-CPU allocations are not guaranteed to be physically contiguous.
> >>> > > However, kdump kernel and user-space code assumes that per-CPU
> >>> > > memory, used for saving CPU registers on crash, is.
> >>> > > This can cause corrupted /proc/vmcore in some cases - the main
> >>> > > symptom being huge ELF note section.
> >>> > >
> >>> > > Force page alignment for note_buf_t to ensure that this assumption holds.
> >>> >
> >>> > Ouch. I'm surprised there is an allocation on crash, perhaps
> >>> > it could at least be done earlier? And am I right in thinking
> >>> > that this change increases the likely hood that the allocation
> >>> > could fail?
> >>> >
> >>>
> >>> I'm not following. This allocation is done on start-up, not on crash.
> >>> If you cannot allocate this much memory on system boot, I'm not sure what
> >>> else you can do on this system....
> >>
> >> Sorry, my eyes deceived me. You are correct and I agree.
> >>
> >> Is it the case that note_buf_t is never larger than PAGE_SIZE?
> >> If so I your patch looks good to me.
> >
> > Currently, maximum note size is hardcoded in kexec-tools to 1024
> > (MAX_NOTE_BYTES).
> > Usually it's way less. IIRC on x86_64 it's 336 bytes.
I presume that MAX_NOTE_BYTES was chosen to be large to
minimise the chance that it would ever need to be changed.
> This is elf_prstatus and I guess it's mostly equal to registers.
>
> crash> p sizeof(struct elf_prstatus)
> $3 = 336
> crash> ptype struct elf_prstatus
> type = struct elf_prstatus {
> struct elf_siginfo pr_info;
> short int pr_cursig;
> long unsigned int pr_sigpend;
> long unsigned int pr_sighold;
> pid_t pr_pid;
> pid_t pr_ppid;
> pid_t pr_pgrp;
> pid_t pr_sid;
> struct timeval pr_utime;
> struct timeval pr_stime;
> struct timeval pr_cutime;
> struct timeval pr_cstime;
> elf_gregset_t pr_reg; <-- this
> int pr_fpvalid;
> }
>
> What kinds of architecture does have so many registers? It's just my
> interest. Or possibly other kinds of notes is written here?
The winner seems to be ia64 with 128.
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
next prev parent reply other threads:[~2012-03-01 2:50 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-29 17:21 [PATCH] kdump: force page alignment for per-CPU crash notes Eugene Surovegin
2012-03-01 1:18 ` Simon Horman
2012-03-01 1:23 ` Eugene Surovegin
2012-03-01 1:32 ` Simon Horman
2012-03-01 1:39 ` Eugene Surovegin
2012-03-01 1:51 ` HATAYAMA Daisuke
2012-03-01 1:56 ` Eugene Surovegin
2012-03-01 2:50 ` Simon Horman [this message]
2012-03-01 2:53 ` Simon Horman
2012-03-01 15:09 ` Vivek Goyal
2012-03-01 17:04 ` Eugene Surovegin
2012-03-01 18:31 ` Vivek Goyal
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=20120301025038.GD10053@verge.net.au \
--to=horms@verge.net.au \
--cc=d.hatayama@jp.fujitsu.com \
--cc=ebiederm@xmission.com \
--cc=kexec@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=surovegin@google.com \
--cc=vgoyal@redhat.com \
/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