mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] x86: update vmlinux.lds.S to place .data section on a page boundary
@ 2006-09-28 20:12 Neil Horman
  2006-09-28 20:42 ` Sam Ravnborg
  0 siblings, 1 reply; 6+ messages in thread
From: Neil Horman @ 2006-09-28 20:12 UTC (permalink / raw)
  To: linux-kernel; +Cc: mj, davej, nhorman

Patch to update vmlinux linker script so that .data section is on a page
boundary.  without this change the kernel's .data section is on a non-4k
boundary, and this prevents kexec from loading a new kernel.  Tested
successfully by me.

Thanks & Regards
Neil

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


 vmlinux.lds.S |    1 +
 1 files changed, 1 insertion(+)


diff --git a/arch/i386/kernel/vmlinux.lds.S b/arch/i386/kernel/vmlinux.lds.S
index 1e7ac1c..43ed5be 100644
--- a/arch/i386/kernel/vmlinux.lds.S
+++ b/arch/i386/kernel/vmlinux.lds.S
@@ -50,6 +50,7 @@ SECTIONS
   }
   __tracedata_end = .;
 
+  . = ALIGN(4096);
   /* writeable */
   .data : AT(ADDR(.data) - LOAD_OFFSET) {	/* Data */
 	*(.data)
-- 
/***************************************************
 *Neil Horman
 *Software Engineer
 *gpg keyid: 1024D / 0x92A74FA1 - http://pgp.mit.edu
 ***************************************************/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] x86: update vmlinux.lds.S to place .data section on a page boundary
  2006-09-28 20:12 [PATCH] x86: update vmlinux.lds.S to place .data section on a page boundary Neil Horman
@ 2006-09-28 20:42 ` Sam Ravnborg
  2006-09-28 23:22   ` Neil Horman
  0 siblings, 1 reply; 6+ messages in thread
From: Sam Ravnborg @ 2006-09-28 20:42 UTC (permalink / raw)
  To: Neil Horman; +Cc: linux-kernel, mj, davej

On Thu, Sep 28, 2006 at 04:12:49PM -0400, Neil Horman wrote:
> Patch to update vmlinux linker script so that .data section is on a page
> boundary.  without this change the kernel's .data section is on a non-4k
> boundary, and this prevents kexec from loading a new kernel.  Tested
> successfully by me.
NAK

> +  . = ALIGN(4096);

Do not use magic numbers like this.
Please replace 4096 with PAGE_SIZE - page.h is already included so it is
available.
This servers two purposes:
1) This make it more self documenting
2) It makes it more portable should we decide to do this in a general
way for all arch's.

And then maybe a comment why it is desireable to waste a lot of RAM
in some cases. For the embedded people wasting up to 4088 bytes
of RAM is not desireable.


	Sam

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] x86: update vmlinux.lds.S to place .data section on a page boundary
  2006-09-28 20:42 ` Sam Ravnborg
@ 2006-09-28 23:22   ` Neil Horman
  2006-09-29  0:03     ` Neil Horman
  0 siblings, 1 reply; 6+ messages in thread
From: Neil Horman @ 2006-09-28 23:22 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: linux-kernel, mj, davej

On Thu, Sep 28, 2006 at 10:42:20PM +0200, Sam Ravnborg wrote:
> On Thu, Sep 28, 2006 at 04:12:49PM -0400, Neil Horman wrote:
> > Patch to update vmlinux linker script so that .data section is on a page
> > boundary.  without this change the kernel's .data section is on a non-4k
> > boundary, and this prevents kexec from loading a new kernel.  Tested
> > successfully by me.
> NAK
> 
> > +  . = ALIGN(4096);
> 
> Do not use magic numbers like this.
> Please replace 4096 with PAGE_SIZE - page.h is already included so it is
> available.
> This servers two purposes:
> 1) This make it more self documenting
> 2) It makes it more portable should we decide to do this in a general
> way for all arch's.
> 
I'm happy to do this if that is the consensus, but if you look at the rest of
the file, I'm simply following the standard that is currently in the file.  Are
you sure you want me to go and revamp that through the entire script?

> And then maybe a comment why it is desireable to waste a lot of RAM
> in some cases. For the embedded people wasting up to 4088 bytes
> of RAM is not desireable.
> 
Again, its the standard of the script.  All other sections are page aligned (or
rather were).  some recent changes have added a section data (a __tracedata
section I think), which is 4 byte aligned, which shifted the subsequent section
to be 4 byte aligned (the following note section as described in the PHDRS
section is prefixed with a simmilar ALIGN macro to bring it back into page
alignment.

Again, I'll repost with the adjustments you request, but first I'd like you please to
look at the file and make sure thats best.  Currently, I'm more comfortable with
the above, as it reflects the current standard of the script.

Regards
Neil

> 
> 	Sam

-- 
/***************************************************
 *Neil Horman
 *Software Engineer
 *gpg keyid: 1024D / 0x92A74FA1 - http://pgp.mit.edu
 ***************************************************/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] x86: update vmlinux.lds.S to place .data section on a page boundary
  2006-09-28 23:22   ` Neil Horman
@ 2006-09-29  0:03     ` Neil Horman
  2006-09-30  1:13       ` Eric W. Biederman
  0 siblings, 1 reply; 6+ messages in thread
From: Neil Horman @ 2006-09-29  0:03 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: linux-kernel, mj, davej

On Thu, Sep 28, 2006 at 07:22:06PM -0400, Neil Horman wrote:
> On Thu, Sep 28, 2006 at 10:42:20PM +0200, Sam Ravnborg wrote:
> > On Thu, Sep 28, 2006 at 04:12:49PM -0400, Neil Horman wrote:
> > > Patch to update vmlinux linker script so that .data section is on a page
> > > boundary.  without this change the kernel's .data section is on a non-4k
> > > boundary, and this prevents kexec from loading a new kernel.  Tested
> > > successfully by me.
> > NAK
> > 
> > > +  . = ALIGN(4096);
> > 
> > Do not use magic numbers like this.
> > Please replace 4096 with PAGE_SIZE - page.h is already included so it is
> > available.
> > This servers two purposes:
> > 1) This make it more self documenting
> > 2) It makes it more portable should we decide to do this in a general
> > way for all arch's.
> > 
> I'm happy to do this if that is the consensus, but if you look at the rest of
> the file, I'm simply following the standard that is currently in the file.  Are
> you sure you want me to go and revamp that through the entire script?
> 
> > And then maybe a comment why it is desireable to waste a lot of RAM
> > in some cases. For the embedded people wasting up to 4088 bytes
> > of RAM is not desireable.
> > 
> Again, its the standard of the script.  All other sections are page aligned (or
> rather were).  some recent changes have added a section data (a __tracedata
> section I think), which is 4 byte aligned, which shifted the subsequent section
> to be 4 byte aligned (the following note section as described in the PHDRS
> section is prefixed with a simmilar ALIGN macro to bring it back into page
> alignment.
> 
> Again, I'll repost with the adjustments you request, but first I'd like you please to
> look at the file and make sure thats best.  Currently, I'm more comfortable with
> the above, as it reflects the current standard of the script.
> 
> Regards
> Neil
> 
> > 
> > 	Sam
> 
Sorry, Replying to myself.  I forgot to mention in my last note why specifically
I was calling for this change, and why it was necessecary.  In addition to being
the standard in the script for executable sections, kexec also appears to rely
on PT_LOAD sections being on page boundaries.  With vmlinux.ld.s as it is, that
isn't the case, and so we can't load any kernels with kexec at the moment.  I've
seen this on the most recent fedora kernels (which have the latest version of
this linker script), and this patch corrects that.

Please look at the file in its entirety, and if you still feel that modifying
the script so all the ALIGN(4096) directives to be ALIGN(PAGE_SIZE) instead is
the direction to go, I'll implement the change and test it out.

Regards
Neil

> -- 
> /***************************************************
>  *Neil Horman
>  *Software Engineer
>  *gpg keyid: 1024D / 0x92A74FA1 - http://pgp.mit.edu
>  ***************************************************/
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

-- 
/***************************************************
 *Neil Horman
 *Software Engineer
 *gpg keyid: 1024D / 0x92A74FA1 - http://pgp.mit.edu
 ***************************************************/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] x86: update vmlinux.lds.S to place .data section on a page boundary
  2006-09-29  0:03     ` Neil Horman
@ 2006-09-30  1:13       ` Eric W. Biederman
  2006-10-01 21:47         ` Neil Horman
  0 siblings, 1 reply; 6+ messages in thread
From: Eric W. Biederman @ 2006-09-30  1:13 UTC (permalink / raw)
  To: Neil Horman; +Cc: Sam Ravnborg, linux-kernel, mj, davej

Neil Horman <nhorman@tuxdriver.com> writes:

> Sorry, Replying to myself.  I forgot to mention in my last note why specifically
> I was calling for this change, and why it was necessecary.  In addition to being
> the standard in the script for executable sections, kexec also appears to rely
> on PT_LOAD sections being on page boundaries.  With vmlinux.ld.s as it is, that
> isn't the case, and so we can't load any kernels with kexec at the moment.  I've
> seen this on the most recent fedora kernels (which have the latest version of
> this linker script), and this patch corrects that.
>
> Please look at the file in its entirety, and if you still feel that modifying
> the script so all the ALIGN(4096) directives to be ALIGN(PAGE_SIZE) instead is
> the direction to go, I'll implement the change and test it out.

Is there a reason you don't want to kexec the bzImage?

Eric

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] x86: update vmlinux.lds.S to place .data section on a page boundary
  2006-09-30  1:13       ` Eric W. Biederman
@ 2006-10-01 21:47         ` Neil Horman
  0 siblings, 0 replies; 6+ messages in thread
From: Neil Horman @ 2006-10-01 21:47 UTC (permalink / raw)
  To: Eric W. Biederman; +Cc: Sam Ravnborg, linux-kernel, mj, davej

On Fri, Sep 29, 2006 at 07:13:46PM -0600, Eric W. Biederman wrote:
> Neil Horman <nhorman@tuxdriver.com> writes:
> 
> > Sorry, Replying to myself.  I forgot to mention in my last note why specifically
> > I was calling for this change, and why it was necessecary.  In addition to being
> > the standard in the script for executable sections, kexec also appears to rely
> > on PT_LOAD sections being on page boundaries.  With vmlinux.ld.s as it is, that
> > isn't the case, and so we can't load any kernels with kexec at the moment.  I've
> > seen this on the most recent fedora kernels (which have the latest version of
> > this linker script), and this patch corrects that.
> >
> > Please look at the file in its entirety, and if you still feel that modifying
> > the script so all the ALIGN(4096) directives to be ALIGN(PAGE_SIZE) instead is
> > the direction to go, I'll implement the change and test it out.
> 
> Is there a reason you don't want to kexec the bzImage?
> 
Not so much that I don't want to, but I don't think you should have to.  There
isn't any reason that we shouldn't be able to boot uncompressed kernels, is
there?
Regards
Neil

> Eric
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

-- 
/***************************************************
 *Neil Horman
 *Software Engineer
 *gpg keyid: 1024D / 0x92A74FA1 - http://pgp.mit.edu
 ***************************************************/

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-10-01 21:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-28 20:12 [PATCH] x86: update vmlinux.lds.S to place .data section on a page boundary Neil Horman
2006-09-28 20:42 ` Sam Ravnborg
2006-09-28 23:22   ` Neil Horman
2006-09-29  0:03     ` Neil Horman
2006-09-30  1:13       ` Eric W. Biederman
2006-10-01 21:47         ` Neil Horman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®