Kexec Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Wang Nan <wangnan0@huawei.com>
To: Dave Anderson <anderson@redhat.com>,
	kexec@lists.infradead.org,
	Atsushi Kumagai <kumagai-atsushi@mxc.nes.nec.co.jp>,
	Simon Horman <horms@verge.net.au>
Subject: Re: [BUG REPORT] kexec and makedumpfile can't detect PAGE_OFFSET on arm (Wang Nan)
Date: Tue, 20 May 2014 11:50:20 +0800	[thread overview]
Message-ID: <537AD0FC.1020202@huawei.com> (raw)
In-Reply-To: <1809090930.13449697.1400528518027.JavaMail.zimbra@redhat.com>


On 2014/5/20 3:41, Dave Anderson wrote:
> 
> 
> ----- Original Message -----
>>
>> Hi Atsushi and Simon,
>>
>> I find a problem about VMSPLIT on arm plarform, related to kexec and
>> makedumpfile.
>>
>> When CONFIG_VMSPLIT_1G/2G is selected by kernel, PAGE_OFFSET is actually
>> 0x40000000 or 0x80000000. However, kexec hard codes PAGE_OFFSET to
>> 0xc0000000 (in kexec/arch/arm/crashdump-arm.h), which is incorrect in
>> these situations. For example, on realview-pbx board with 1G/3G VMSPLIT,
>> PHDRs in generated /proc/vmcore is as follow:
>>
>>   Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
>>   NOTE           0x001000 0x00000000 0x00000000 0x00690 0x00690     0
>>   LOAD           0x002000 0xc0000000 0x00000000 0x10000000 0x10000000 RWE 0
>>   LOAD           0x10002000 0xe0000000 0x20000000 0x8000000 0x8000000 RWE 0
>>   LOAD           0x18002000 0xf0000000 0x30000000 0x10000000 0x10000000 RWE 0
>>   LOAD           0x28002000 0x40000000 0x80000000 0x10000000 0x10000000 RWE 0
>>
>> Which should be:
>>
>>   Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
>>   ...
>>   LOAD            ...     0x40000000 0x00000000 0x10000000 0x10000000 RWE 0
>>   LOAD            ...     0x60000000 0x20000000 0x8000000 0x8000000 RWE 0
>>   LOAD            ...     0x70000000 0x30000000 0x10000000 0x10000000 RWE 0
>>   LOAD            ...     0xc0000000 0x80000000 0x10000000 0x10000000 RWE 0
>>
>> I don't know why crash utility can deal with it without problem,
> 
> For ARM the crash utility masks the symbol value of "_stext" with 0x1fffffff
> to determine the PAGE_OFFSET value, which was basically copied from the way
> it was done for i386. 
> 

kexec-tools can do the same thing by reading /proc/kallsyms (crashdump-x86.c has already done this).
However, KALLSYMS and KALLSYMS_ALL are turned off on some embedded systems with memory limitation,
which is common on ARM.

>> but in makedumpfile such VMSPLIT setting causes segfault:
>>
>>  $ ./makedumpfile -c -d 31 /proc/vmcore ./out -f
>>  The kernel version is not supported.
>>  The created dumpfile may be incomplete.
>>  Excluding unnecessary pages        : [  0.0 %] /Segmentation fault
>>
>> There are many ways to deal with it, I want discuss them in the maillist and
>> make a decision:
>>
>>  1. Kexec changes, detect PAGE_OFFSET dynamically. However, I don't know
>>     whether there is a reliably way for this purpose, here I suggest
>>     kernel to export PAGE_OFFSET through sysfs, such as
>>     /sys/kernel/page_offset.
>>
>>  2. Or, kexec accepts PAGE_OFFSET as a command line arguments, let user
>>     provide correct information.
>>
>>  3. Or, makedumpfile changes, don't trust EHDR anymore. Kernel should
>>     export PAGE_OFFSET through VMCOREINFO.
>>
>> How do you feel?
>>
>> Thank you!
>>




_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

  reply	other threads:[~2014-05-20  3:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.5.1400526001.29113.kexec@lists.infradead.org>
2014-05-19 19:41 ` [BUG REPORT] kexec and makedumpfile can't detect PAGE_OFFSET on arm (Wang Nan) Dave Anderson
2014-05-20  3:50   ` Wang Nan [this message]
2014-05-20 12:51     ` Dave Anderson
2014-05-22  1:10       ` Wang Nan

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=537AD0FC.1020202@huawei.com \
    --to=wangnan0@huawei.com \
    --cc=anderson@redhat.com \
    --cc=horms@verge.net.au \
    --cc=kexec@lists.infradead.org \
    --cc=kumagai-atsushi@mxc.nes.nec.co.jp \
    /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