Neil Horman | 3 Mar 2008 15:30
Favicon

[PATCH] reduce alignment constraint on ia64 elf core header

Hey all-
	Patch to reduce the alignment constraints on ia64 elf core headers.
>From what I can see there is no need to align the elf core header structure to
the EFI_PAGE_SIZE (given that the EFI will never read this data, only the kernel
will when booting a kdump kernel).  And since this is going into our reserved
memory, it saves us 3K (4K vs 1K alignment).  Tested successfully by myself on
several ia64 boxes.

Thanks & Regards
Neil

Signed-off-by: Neil Horman <nhorman@...>

 crashdump-ia64.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kexec/arch/ia64/crashdump-ia64.c b/kexec/arch/ia64/crashdump-ia64.c
index e365b3e..2aa2b12 100644
--- a/kexec/arch/ia64/crashdump-ia64.c
+++ b/kexec/arch/ia64/crashdump-ia64.c
 <at>  <at>  -231,7 +231,7  <at>  <at>  int load_crashdump_segments(struct kexec_info *info, struct mem_ehdr *ehdr,
 						       crash_memory_range,
 						       nr_ranges,
 						       &tmp, &sz,
-						       EFI_PAGE_SIZE) < 0)
+						       ELF_CORE_HEADER_ALIGN) < 0)
 				return -1;

 			elfcorehdr = add_buffer(info, tmp, sz, sz,
--

-- 
(Continue reading)

Bernhard Walle | 3 Mar 2008 16:56
Picon

Re: [PATCH] reduce alignment constraint on ia64 elf core header

* Neil Horman <nhorman@...> [2008-03-03 15:30]:
> Hey all-
> 	Patch to reduce the alignment constraints on ia64 elf core headers.
> >From what I can see there is no need to align the elf core header structure to
> the EFI_PAGE_SIZE (given that the EFI will never read this data, only the kernel
> will when booting a kdump kernel).  And since this is going into our reserved
> memory, it saves us 3K (4K vs 1K alignment).  Tested successfully by myself on
> several ia64 boxes.

This is wrong. Please read this thead:

https://lists.linux-foundation.org/pipermail/fastboot/2007-February/012882.html

        Bernhard
Simon Horman | 4 Mar 2008 03:52
Picon
Gravatar

Re: [PATCH] ia64 kern_vaddr_start was calculated incorrectly

On Mon, Mar 03, 2008 at 05:53:26PM -0800, Jay Lan wrote:
> I tested in a rhel5.1 root with:
>    2.6.24 kernel
>    kexec-tools-testing-20080227
>    crash-4.0-5.1
> 
> Crash failed to initialize:
> 
> crash: read error: kernel virtual address: a0000001007f0868  type:
> "kernel_config_data"
> WARNING: cannot read kernel_config_data
> crash: read error: kernel virtual address: a000000100f370b0  type: "xtime"
> 
> It turned out that the kexec sets info->kern_vaddr_start incorrectly
> on ia64 platform.
> 
> Jonathan Lim posted a fix to the fastboot list in March 2007:
> https://lists.linux-foundation.org/pipermail/fastboot/2007-March/013645.html
> This patch derived from Jonathan's patch, but fixes the problem at
> kexec/arch/ia64/crashdump-ia64.c.
> 
> 
> Signed-off-by: Jay Lan  <jlan@...>

Thanks Jay, Thanks Jonathan.

Sorry for not picking this up earlier. I have applied it now.

--

-- 
Horms
(Continue reading)

Simon Horman | 4 Mar 2008 05:28
Picon
Gravatar

Re: [PATCH] reduce alignment constraint on ia64 elf core header

On Mon, Mar 03, 2008 at 04:56:44PM +0100, Bernhard Walle wrote:
> * Neil Horman <nhorman@...> [2008-03-03 15:30]:
> > Hey all-
> > 	Patch to reduce the alignment constraints on ia64 elf core headers.
> > >From what I can see there is no need to align the elf core header structure to
> > the EFI_PAGE_SIZE (given that the EFI will never read this data, only the kernel
> > will when booting a kdump kernel).  And since this is going into our reserved
> > memory, it saves us 3K (4K vs 1K alignment).  Tested successfully by myself on
> > several ia64 boxes.
> 
> This is wrong. Please read this thead:
> 
> https://lists.linux-foundation.org/pipermail/fastboot/2007-February/012882.html

Hi Neil, Hi Bernhard,

I can confirm that with Neil's patch I end up with a zero
byte long /proc/vmcore

--

-- 
Horms
Neil Horman | 4 Mar 2008 12:49
Favicon

Re: [PATCH] reduce alignment constraint on ia64 elf core header

On Tue, Mar 04, 2008 at 01:28:16PM +0900, Simon Horman wrote:
> On Mon, Mar 03, 2008 at 04:56:44PM +0100, Bernhard Walle wrote:
> > * Neil Horman <nhorman@...> [2008-03-03 15:30]:
> > > Hey all-
> > > 	Patch to reduce the alignment constraints on ia64 elf core headers.
> > > >From what I can see there is no need to align the elf core header structure to
> > > the EFI_PAGE_SIZE (given that the EFI will never read this data, only the kernel
> > > will when booting a kdump kernel).  And since this is going into our reserved
> > > memory, it saves us 3K (4K vs 1K alignment).  Tested successfully by myself on
> > > several ia64 boxes.
> > 
> > This is wrong. Please read this thead:
> > 
> > https://lists.linux-foundation.org/pipermail/fastboot/2007-February/012882.html
> 
> Hi Neil, Hi Bernhard,
> 
> I can confirm that with Neil's patch I end up with a zero
> byte long /proc/vmcore
> 
> -- 
> Horms

Rescinded.  My bad, I didn't think to check that.

Thanks!
Nei

--

-- 
/****************************************************
(Continue reading)

Simon Horman | 5 Mar 2008 02:57
Picon
Gravatar

Re: [PATCH] reduce alignment constraint on ia64 elf core header

On Tue, Mar 04, 2008 at 06:49:44AM -0500, Neil Horman wrote:
> On Tue, Mar 04, 2008 at 01:28:16PM +0900, Simon Horman wrote:
> > On Mon, Mar 03, 2008 at 04:56:44PM +0100, Bernhard Walle wrote:
> > > * Neil Horman <nhorman@...> [2008-03-03 15:30]:
> > > > Hey all-
> > > > 	Patch to reduce the alignment constraints on ia64 elf core headers.
> > > > >From what I can see there is no need to align the elf core header structure to
> > > > the EFI_PAGE_SIZE (given that the EFI will never read this data, only the kernel
> > > > will when booting a kdump kernel).  And since this is going into our reserved
> > > > memory, it saves us 3K (4K vs 1K alignment).  Tested successfully by myself on
> > > > several ia64 boxes.
> > > 
> > > This is wrong. Please read this thead:
> > > 
> > > https://lists.linux-foundation.org/pipermail/fastboot/2007-February/012882.html
> > 
> > Hi Neil, Hi Bernhard,
> > 
> > I can confirm that with Neil's patch I end up with a zero
> > byte long /proc/vmcore
> > 
> > -- 
> > Horms
> 
> Rescinded.  My bad, I didn't think to check that.

Thanks to Bernhard for spotting this,
I likely would have merged it otherwise.

--

-- 
(Continue reading)

Scott D. Davilla | 5 Mar 2008 04:02

bug/patch for i386 EFI boot

Problem:
	kexec fails under i386 EFI boot for hardware that does not 
have a VGA bios or PC bios present. The EFI bootloader properly set 
the initial screen_info boot params but kexec assumes an 
orig_video_isVGA type of 1. This causes the kexec'd kernel assume the 
presence of both VGA bios and normal PC BIOS and starts probing which 
then panics somewhere I can't see because I have no console output 
nor serial ports.

Solution:
	For EFI, efifb is a linear VGA framebuffer and can handle the 
kexec kernel switch, kexec just has to setup the kernel boot params 
properly. The below patch fixes this issue and allow a i386 EFI 
booted kernel with no VGA bios/PC bios to kexec to another kernel.

Questions:
	Why is kexec assuming i386 x86 == VGA bios in the first 
place. The existing kernel has a perfectly good screen_info stucture 
that is an exported symbol by the kernel and could be accessed by 
kexec. Since kexec is just pretending to be a boot loader, why does 
it ignore information that the real bootloader (which knows a lot 
more about the hardware) has passed? The below patch just hacks in a 
trap for efifb and will fail in the future as other x86 hardware 
without VGA bios/PC bios become available.

My first mainline submitted patch so be gentle :).

Scott

diff -Naur 
(Continue reading)

Simon Horman | 5 Mar 2008 10:27
Picon
Gravatar

Re: bug/patch for i386 EFI boot

On Tue, Mar 04, 2008 at 10:02:31PM -0500, Scott D. Davilla wrote:
> Problem:
> 	kexec fails under i386 EFI boot for hardware that does not 
> have a VGA bios or PC bios present. The EFI bootloader properly set 
> the initial screen_info boot params but kexec assumes an 
> orig_video_isVGA type of 1. This causes the kexec'd kernel assume the 
> presence of both VGA bios and normal PC BIOS and starts probing which 
> then panics somewhere I can't see because I have no console output 
> nor serial ports.
> 
> Solution:
> 	For EFI, efifb is a linear VGA framebuffer and can handle the 
> kexec kernel switch, kexec just has to setup the kernel boot params 
> properly. The below patch fixes this issue and allow a i386 EFI 
> booted kernel with no VGA bios/PC bios to kexec to another kernel.
> 
> Questions:
> 	Why is kexec assuming i386 x86 == VGA bios in the first 
> place. The existing kernel has a perfectly good screen_info stucture 
> that is an exported symbol by the kernel and could be accessed by 
> kexec. Since kexec is just pretending to be a boot loader, why does 
> it ignore information that the real bootloader (which knows a lot 
> more about the hardware) has passed? The below patch just hacks in a 
> trap for efifb and will fail in the future as other x86 hardware 
> without VGA bios/PC bios become available.
> 
> My first mainline submitted patch so be gentle :).

Hi Scott,

(Continue reading)

Scott D. Davilla | 5 Mar 2008 15:57

[PATCH] kexec: fix i386 EFI boot using efifb

Problem:
	kexec fails under i386 EFI boot for hardware that does not 
have a VGA bios or PC bios present. The EFI bootloader properly set 
the initial screen_info boot params but kexec assumes an 
orig_video_isVGA type of 1. This causes the kexec'd kernel assume the 
presence of both VGA bios and normal PC BIOS and starts probing which 
then panics somewhere I can't see because I have no console output 
nor serial ports.

Solution:
	For EFI, efifb is a linear VGA framebuffer and can handle the 
kexec kernel switch, kexec just has to setup the kernel boot params 
properly. The below patch fixes this issue and allow a i386 EFI 
booted kernel with no VGA bios/PC bios to kexec to another kernel.

Questions:
	Why is kexec assuming i386 x86 == VGA bios in the first 
place. The existing kernel has a perfectly good screen_info stucture 
that is an exported symbol by the kernel and could be accessed by 
kexec. Since kexec is just pretending to be a boot loader, why does 
it ignore information that the real bootloader (which knows a lot 
more about the hardware) has passed? The below patch just hacks in a 
trap for efifb and will fail in the future as other x86 hardware 
without VGA bios/PC bios become available.

diff -rup 
kexec-tools-testing-20080227-org/kexec/arch/i386/x86-linux-setup.c 
kexec-tools-testing-20080227/kexec/arch/i386/x86-linux-setup.c
--- kexec-tools-testing-20080227-org/kexec/arch/i386/x86-linux-setup.c
+++ kexec-tools-testing-20080227/kexec/arch/i386/x86-linux-setup.c
(Continue reading)

Scott D. Davilla | 5 Mar 2008 16:08

Re: bug/patch for i386 EFI boot

>this looks good to me, though there is no need
>to comment out unneeded lines, just remove them.
>
>Also, if you could provide a sign-off line, as
>per Section 5 of http://linux.yyz.us/patch-format.html
>that would be great.
>
>Finally, your mail reader (or something else) seems
>to have mangled the patch such that leading <space><tab>
>has been turned into <space><space><tab>. This isn't a bit
>deal as its is easy enough for me to un-mangle it by hand.
>But just so you know.
>
>Thanks
>
>--
>Horms

Done and resubmitted with a proper subject line with commented out 
lines removed. VMware was mangling the leading tabs on the drag and 
drop from Linux to OS X ???

And as follow up question. It there any access to 
screen_info.orig_video_isVGA besides linking to the kernel? If there 
is access to orig_video_isVGA then kexec can setup the screen boot 
params as the bootloader intended instead of assuming a default VGA 
config. The orig_video_isVGA is the only parameter missing to clone 
the initial screen_info information.

Scott
(Continue reading)


Gmane