Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1350420 > unrolled thread

[PATCH v3 02/19] x86, boot: Move compressed kernel to end of buffer before decompressing

Started byBaoquan He <bhe@redhat.com>
First post2016-03-04 17:30 +0100
Last post2016-03-08 06:00 +0100
Articles 3 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v3 02/19] x86, boot: Move compressed kernel to end of buffer before decompressing Baoquan He <bhe@redhat.com> - 2016-03-04 17:30 +0100
    Re: [PATCH v3 02/19] x86, boot: Move compressed kernel to end of  buffer before decompressing Kees Cook <keescook@chromium.org> - 2016-03-07 23:40 +0100
      Re: [PATCH v3 02/19] x86, boot: Move compressed kernel to end of  buffer before decompressing Baoquan He <bhe@redhat.com> - 2016-03-08 06:00 +0100

#1350420 — [PATCH v3 02/19] x86, boot: Move compressed kernel to end of buffer before decompressing

FromBaoquan He <bhe@redhat.com>
Date2016-03-04 17:30 +0100
Subject[PATCH v3 02/19] x86, boot: Move compressed kernel to end of buffer before decompressing
Message-ID<r90M3-Y1-57@gated-at.bofh.it>
From: Yinghai Lu <yinghai@kernel.org>

For better understanding clarify what are VO and ZO firstly. They are
introduced in below commits by hpa.
77d1a49 x86, boot: make symbols from the main vmlinux available
37ba7ab x86, boot: make kernel_alignment adjustable; new bzImage fields

VO:
- uncompressed kernel
- size: VO__end - VO__text

ZO:
- boot/compressed/vmlinux
- head text + compressed (VO+relocs) + decompressor code
- size: ZO__end - ZO_startup_32

And also copy INIT_SIZE definition here for reference. From below macros
we can see INIT_SIZE is either bigger than VO_INIT_SIZE or equal to
VO_INIT_SIZE.

 #define ZO_INIT_SIZE    (ZO__end - ZO_startup_32 + ZO_z_extract_offset)
 #define VO_INIT_SIZE    (VO__end - VO__text)
 #if ZO_INIT_SIZE > VO_INIT_SIZE
 #define INIT_SIZE ZO_INIT_SIZE
 #else
 #define INIT_SIZE VO_INIT_SIZE
 #endif

Current code uses extract_offset to decide the copied ZO position, it
put ZO starting from extract_offset. When INIT_SIZE is bigger than
VO_INIT_SIZE copied ZO occupies space from extract_offset to the end
of decompressing buffer, just like below.

0                       extract_offset                       init_size
|-----------|---------------|------------------------|---------|
            |               |                        |         |
          VO__text      startup_32 of ZO         VO__end     ZO__end

However when INIT_SIZE is euqal to VO_INIT_SIZE there's still space left
from end of ZO to the end of decompressing buffer, like below.

0                       extract_offset                       init_size
|-----------|---------------|------------------------|---------|
            |               |                        |         |
          VO__text      startup_32 of ZO         ZO__end     VO__end

It's better to always put ZO right in the end of decompressing buffer.
Anyway, who doesn't like it to be better.

So in this patch add BP_init_size into asm-offsets.c to make it visible
to asm modules. And find the starting position of copied ZO by init_size
and ZO run size, namely (ZO__end - startup_32) when move ZO.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
---
v2->v3:
    Adjust the patch log.

 arch/x86/boot/compressed/head_32.S     | 11 +++++++++--
 arch/x86/boot/compressed/head_64.S     |  8 ++++++--
 arch/x86/boot/compressed/mkpiggy.c     |  3 ---
 arch/x86/boot/compressed/vmlinux.lds.S |  1 +
 arch/x86/kernel/asm-offsets.c          |  1 +
 arch/x86/kernel/vmlinux.lds.S          |  1 +
 6 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/arch/x86/boot/compressed/head_32.S b/arch/x86/boot/compressed/head_32.S
index 8ef964d..0c140f9 100644
--- a/arch/x86/boot/compressed/head_32.S
+++ b/arch/x86/boot/compressed/head_32.S
@@ -148,7 +148,9 @@ preferred_addr:
 1:
 
 	/* Target address to relocate to for decompression */
-	addl	$z_extract_offset, %ebx
+	movl    BP_init_size(%esi), %eax
+	subl    $_end, %eax
+	addl    %eax, %ebx
 
 	/* Set up the stack */
 	leal	boot_stack_end(%ebx), %esp
@@ -210,8 +212,13 @@ relocated:
 				/* push arguments for decompress_kernel: */
 	pushl	$z_run_size	/* size of kernel with .bss and .brk */
 	pushl	$z_output_len	/* decompressed length, end of relocs */
-	leal	z_extract_offset_negative(%ebx), %ebp
+
+	movl    BP_init_size(%esi), %eax
+	subl    $_end, %eax
+	movl    %ebx, %ebp
+	subl    %eax, %ebp
 	pushl	%ebp		/* output address */
+
 	pushl	$z_input_len	/* input_len */
 	leal	input_data(%ebx), %eax
 	pushl	%eax		/* input_data */
diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S
index b0c0d16..67dd8d3 100644
--- a/arch/x86/boot/compressed/head_64.S
+++ b/arch/x86/boot/compressed/head_64.S
@@ -102,7 +102,9 @@ ENTRY(startup_32)
 1:
 
 	/* Target address to relocate to for decompression */
-	addl	$z_extract_offset, %ebx
+	movl	BP_init_size(%esi), %eax
+	subl	$_end, %eax
+	addl	%eax, %ebx
 
 /*
  * Prepare for entering 64 bit mode
@@ -330,7 +332,9 @@ preferred_addr:
 1:
 
 	/* Target address to relocate to for decompression */
-	leaq	z_extract_offset(%rbp), %rbx
+	movl	BP_init_size(%rsi), %ebx
+	subl	$_end, %ebx
+	addq	%rbp, %rbx
 
 	/* Set up the stack */
 	leaq	boot_stack_end(%rbx), %rsp
diff --git a/arch/x86/boot/compressed/mkpiggy.c b/arch/x86/boot/compressed/mkpiggy.c
index d8222f2..b980046 100644
--- a/arch/x86/boot/compressed/mkpiggy.c
+++ b/arch/x86/boot/compressed/mkpiggy.c
@@ -85,9 +85,6 @@ int main(int argc, char *argv[])
 	printf("z_output_len = %lu\n", (unsigned long)olen);
 	printf(".globl z_extract_offset\n");
 	printf("z_extract_offset = 0x%lx\n", offs);
-	/* z_extract_offset_negative allows simplification of head_32.S */
-	printf(".globl z_extract_offset_negative\n");
-	printf("z_extract_offset_negative = -0x%lx\n", offs);
 	printf(".globl z_run_size\n");
 	printf("z_run_size = %lu\n", run_size);
 
diff --git a/arch/x86/boot/compressed/vmlinux.lds.S b/arch/x86/boot/compressed/vmlinux.lds.S
index 34d047c..e24e0a0 100644
--- a/arch/x86/boot/compressed/vmlinux.lds.S
+++ b/arch/x86/boot/compressed/vmlinux.lds.S
@@ -70,5 +70,6 @@ SECTIONS
 		_epgtable = . ;
 	}
 #endif
+	. = ALIGN(PAGE_SIZE);	/* keep ZO size page aligned */
 	_end = .;
 }
diff --git a/arch/x86/kernel/asm-offsets.c b/arch/x86/kernel/asm-offsets.c
index 84a7524..506de14 100644
--- a/arch/x86/kernel/asm-offsets.c
+++ b/arch/x86/kernel/asm-offsets.c
@@ -81,6 +81,7 @@ void common(void) {
 	OFFSET(BP_hardware_subarch, boot_params, hdr.hardware_subarch);
 	OFFSET(BP_version, boot_params, hdr.version);
 	OFFSET(BP_kernel_alignment, boot_params, hdr.kernel_alignment);
+	OFFSET(BP_init_size, boot_params, hdr.init_size);
 	OFFSET(BP_pref_address, boot_params, hdr.pref_address);
 	OFFSET(BP_code32_start, boot_params, hdr.code32_start);
 
diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S
index 74e4bf1..217d5b1 100644
--- a/arch/x86/kernel/vmlinux.lds.S
+++ b/arch/x86/kernel/vmlinux.lds.S
@@ -325,6 +325,7 @@ SECTIONS
 		__brk_limit = .;
 	}
 
+	. = ALIGN(PAGE_SIZE);		/* keep VO_INIT_SIZE page aligned */
 	_end = .;
 
         STABS_DEBUG
-- 
2.5.0

[toc] | [next] | [standalone]


#1352027 — Re: [PATCH v3 02/19] x86, boot: Move compressed kernel to end of buffer before decompressing

FromKees Cook <keescook@chromium.org>
Date2016-03-07 23:40 +0100
SubjectRe: [PATCH v3 02/19] x86, boot: Move compressed kernel to end of buffer before decompressing
Message-ID<rabYJ-uQ-13@gated-at.bofh.it>
In reply to#1350420
On Fri, Mar 4, 2016 at 8:25 AM, Baoquan He <bhe@redhat.com> wrote:
> From: Yinghai Lu <yinghai@kernel.org>
>
> For better understanding clarify what are VO and ZO firstly. They are
> introduced in below commits by hpa.
> 77d1a49 x86, boot: make symbols from the main vmlinux available
> 37ba7ab x86, boot: make kernel_alignment adjustable; new bzImage fields
>
> VO:
> - uncompressed kernel
> - size: VO__end - VO__text
>
> ZO:
> - boot/compressed/vmlinux
> - head text + compressed (VO+relocs) + decompressor code
> - size: ZO__end - ZO_startup_32
>
> And also copy INIT_SIZE definition here for reference. From below macros
> we can see INIT_SIZE is either bigger than VO_INIT_SIZE or equal to
> VO_INIT_SIZE.
>
>  #define ZO_INIT_SIZE    (ZO__end - ZO_startup_32 + ZO_z_extract_offset)
>  #define VO_INIT_SIZE    (VO__end - VO__text)
>  #if ZO_INIT_SIZE > VO_INIT_SIZE
>  #define INIT_SIZE ZO_INIT_SIZE
>  #else
>  #define INIT_SIZE VO_INIT_SIZE
>  #endif
>
> Current code uses extract_offset to decide the copied ZO position, it
> put ZO starting from extract_offset. When INIT_SIZE is bigger than
> VO_INIT_SIZE copied ZO occupies space from extract_offset to the end
> of decompressing buffer, just like below.
>
> 0                       extract_offset                       init_size
> |-----------|---------------|------------------------|---------|
>             |               |                        |         |
>           VO__text      startup_32 of ZO         VO__end     ZO__end
>
> However when INIT_SIZE is euqal to VO_INIT_SIZE there's still space left

typo: "equal"

> from end of ZO to the end of decompressing buffer, like below.
>
> 0                       extract_offset                       init_size
> |-----------|---------------|------------------------|---------|
>             |               |                        |         |
>           VO__text      startup_32 of ZO         ZO__end     VO__end
>
> It's better to always put ZO right in the end of decompressing buffer.
> Anyway, who doesn't like it to be better.

It looks to me like it's just cleaner to always have ZO__end ==
VO__end? Is that the motivation for moving it? What problem is solved
with this change?

-Kees

>
> So in this patch add BP_init_size into asm-offsets.c to make it visible
> to asm modules. And find the starting position of copied ZO by init_size
> and ZO run size, namely (ZO__end - startup_32) when move ZO.
>
> Signed-off-by: Yinghai Lu <yinghai@kernel.org>
> ---
> v2->v3:
>     Adjust the patch log.
>
>  arch/x86/boot/compressed/head_32.S     | 11 +++++++++--
>  arch/x86/boot/compressed/head_64.S     |  8 ++++++--
>  arch/x86/boot/compressed/mkpiggy.c     |  3 ---
>  arch/x86/boot/compressed/vmlinux.lds.S |  1 +
>  arch/x86/kernel/asm-offsets.c          |  1 +
>  arch/x86/kernel/vmlinux.lds.S          |  1 +
>  6 files changed, 18 insertions(+), 7 deletions(-)
>
> diff --git a/arch/x86/boot/compressed/head_32.S b/arch/x86/boot/compressed/head_32.S
> index 8ef964d..0c140f9 100644
> --- a/arch/x86/boot/compressed/head_32.S
> +++ b/arch/x86/boot/compressed/head_32.S
> @@ -148,7 +148,9 @@ preferred_addr:
>  1:
>
>         /* Target address to relocate to for decompression */
> -       addl    $z_extract_offset, %ebx
> +       movl    BP_init_size(%esi), %eax
> +       subl    $_end, %eax
> +       addl    %eax, %ebx
>
>         /* Set up the stack */
>         leal    boot_stack_end(%ebx), %esp
> @@ -210,8 +212,13 @@ relocated:
>                                 /* push arguments for decompress_kernel: */
>         pushl   $z_run_size     /* size of kernel with .bss and .brk */
>         pushl   $z_output_len   /* decompressed length, end of relocs */
> -       leal    z_extract_offset_negative(%ebx), %ebp
> +
> +       movl    BP_init_size(%esi), %eax
> +       subl    $_end, %eax
> +       movl    %ebx, %ebp
> +       subl    %eax, %ebp
>         pushl   %ebp            /* output address */
> +
>         pushl   $z_input_len    /* input_len */
>         leal    input_data(%ebx), %eax
>         pushl   %eax            /* input_data */
> diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S
> index b0c0d16..67dd8d3 100644
> --- a/arch/x86/boot/compressed/head_64.S
> +++ b/arch/x86/boot/compressed/head_64.S
> @@ -102,7 +102,9 @@ ENTRY(startup_32)
>  1:
>
>         /* Target address to relocate to for decompression */
> -       addl    $z_extract_offset, %ebx
> +       movl    BP_init_size(%esi), %eax
> +       subl    $_end, %eax
> +       addl    %eax, %ebx
>
>  /*
>   * Prepare for entering 64 bit mode
> @@ -330,7 +332,9 @@ preferred_addr:
>  1:
>
>         /* Target address to relocate to for decompression */
> -       leaq    z_extract_offset(%rbp), %rbx
> +       movl    BP_init_size(%rsi), %ebx
> +       subl    $_end, %ebx
> +       addq    %rbp, %rbx
>
>         /* Set up the stack */
>         leaq    boot_stack_end(%rbx), %rsp
> diff --git a/arch/x86/boot/compressed/mkpiggy.c b/arch/x86/boot/compressed/mkpiggy.c
> index d8222f2..b980046 100644
> --- a/arch/x86/boot/compressed/mkpiggy.c
> +++ b/arch/x86/boot/compressed/mkpiggy.c
> @@ -85,9 +85,6 @@ int main(int argc, char *argv[])
>         printf("z_output_len = %lu\n", (unsigned long)olen);
>         printf(".globl z_extract_offset\n");
>         printf("z_extract_offset = 0x%lx\n", offs);
> -       /* z_extract_offset_negative allows simplification of head_32.S */
> -       printf(".globl z_extract_offset_negative\n");
> -       printf("z_extract_offset_negative = -0x%lx\n", offs);
>         printf(".globl z_run_size\n");
>         printf("z_run_size = %lu\n", run_size);
>
> diff --git a/arch/x86/boot/compressed/vmlinux.lds.S b/arch/x86/boot/compressed/vmlinux.lds.S
> index 34d047c..e24e0a0 100644
> --- a/arch/x86/boot/compressed/vmlinux.lds.S
> +++ b/arch/x86/boot/compressed/vmlinux.lds.S
> @@ -70,5 +70,6 @@ SECTIONS
>                 _epgtable = . ;
>         }
>  #endif
> +       . = ALIGN(PAGE_SIZE);   /* keep ZO size page aligned */
>         _end = .;
>  }
> diff --git a/arch/x86/kernel/asm-offsets.c b/arch/x86/kernel/asm-offsets.c
> index 84a7524..506de14 100644
> --- a/arch/x86/kernel/asm-offsets.c
> +++ b/arch/x86/kernel/asm-offsets.c
> @@ -81,6 +81,7 @@ void common(void) {
>         OFFSET(BP_hardware_subarch, boot_params, hdr.hardware_subarch);
>         OFFSET(BP_version, boot_params, hdr.version);
>         OFFSET(BP_kernel_alignment, boot_params, hdr.kernel_alignment);
> +       OFFSET(BP_init_size, boot_params, hdr.init_size);
>         OFFSET(BP_pref_address, boot_params, hdr.pref_address);
>         OFFSET(BP_code32_start, boot_params, hdr.code32_start);
>
> diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S
> index 74e4bf1..217d5b1 100644
> --- a/arch/x86/kernel/vmlinux.lds.S
> +++ b/arch/x86/kernel/vmlinux.lds.S
> @@ -325,6 +325,7 @@ SECTIONS
>                 __brk_limit = .;
>         }
>
> +       . = ALIGN(PAGE_SIZE);           /* keep VO_INIT_SIZE page aligned */
>         _end = .;
>
>          STABS_DEBUG
> --
> 2.5.0
>



-- 
Kees Cook
Chrome OS & Brillo Security

[toc] | [prev] | [next] | [standalone]


#1352628 — Re: [PATCH v3 02/19] x86, boot: Move compressed kernel to end of buffer before decompressing

FromBaoquan He <bhe@redhat.com>
Date2016-03-08 06:00 +0100
SubjectRe: [PATCH v3 02/19] x86, boot: Move compressed kernel to end of buffer before decompressing
Message-ID<rahUu-4rJ-5@gated-at.bofh.it>
In reply to#1352027
Hi Kees,

Many thanks for your review and suggestions!

On 03/07/16 at 02:35pm, Kees Cook wrote:
> > Current code uses extract_offset to decide the copied ZO position, it
> > put ZO starting from extract_offset. When INIT_SIZE is bigger than
> > VO_INIT_SIZE copied ZO occupies space from extract_offset to the end
> > of decompressing buffer, just like below.
> >
> > 0                       extract_offset                       init_size
> > |-----------|---------------|------------------------|---------|
> >             |               |                        |         |
> >           VO__text      startup_32 of ZO         VO__end     ZO__end
> >
> > However when INIT_SIZE is euqal to VO_INIT_SIZE there's still space left
> 
> typo: "equal"

Yes, will change it in next post.

> 
> > from end of ZO to the end of decompressing buffer, like below.
> >
> > 0                       extract_offset                       init_size
> > |-----------|---------------|------------------------|---------|
> >             |               |                        |         |
> >           VO__text      startup_32 of ZO         ZO__end     VO__end
> >
> > It's better to always put ZO right in the end of decompressing buffer.
> > Anyway, who doesn't like it to be better.
> 
> It looks to me like it's just cleaner to always have ZO__end ==
> VO__end? Is that the motivation for moving it? What problem is solved
> with this change?

As you can see there are 2 cases. The first case is depicted in the 1st
graph. In that case ZO__end is after VO__end. In the 2nd case, yes, we
move ZO__end to make that happen ZO__end == VO__end. In fact this patch
is not trying to make them equal, what it is trying to do is adjusting
the behaviour. We always put ZO just in the end by getting init_size
which is the deompressing buffer and ZO_INIT_SIZE, not like before we
just put ZO starting from extract_offset. We change a different way to
get the starting position of ZO.
> 
> -Kees
> 
> >
> > So in this patch add BP_init_size into asm-offsets.c to make it visible
> > to asm modules. And find the starting position of copied ZO by init_size
> > and ZO run size, namely (ZO__end - startup_32) when move ZO.
> >
> > Signed-off-by: Yinghai Lu <yinghai@kernel.org>
> > ---
> > v2->v3:
> >     Adjust the patch log.
> >
> >  arch/x86/boot/compressed/head_32.S     | 11 +++++++++--
> >  arch/x86/boot/compressed/head_64.S     |  8 ++++++--
> >  arch/x86/boot/compressed/mkpiggy.c     |  3 ---
> >  arch/x86/boot/compressed/vmlinux.lds.S |  1 +
> >  arch/x86/kernel/asm-offsets.c          |  1 +
> >  arch/x86/kernel/vmlinux.lds.S          |  1 +
> >  6 files changed, 18 insertions(+), 7 deletions(-)
> >
> > diff --git a/arch/x86/boot/compressed/head_32.S b/arch/x86/boot/compressed/head_32.S
> > index 8ef964d..0c140f9 100644
> > --- a/arch/x86/boot/compressed/head_32.S
> > +++ b/arch/x86/boot/compressed/head_32.S
> > @@ -148,7 +148,9 @@ preferred_addr:
> >  1:
> >
> >         /* Target address to relocate to for decompression */
> > -       addl    $z_extract_offset, %ebx
> > +       movl    BP_init_size(%esi), %eax
> > +       subl    $_end, %eax
> > +       addl    %eax, %ebx
> >
> >         /* Set up the stack */
> >         leal    boot_stack_end(%ebx), %esp
> > @@ -210,8 +212,13 @@ relocated:
> >                                 /* push arguments for decompress_kernel: */
> >         pushl   $z_run_size     /* size of kernel with .bss and .brk */
> >         pushl   $z_output_len   /* decompressed length, end of relocs */
> > -       leal    z_extract_offset_negative(%ebx), %ebp
> > +
> > +       movl    BP_init_size(%esi), %eax
> > +       subl    $_end, %eax
> > +       movl    %ebx, %ebp
> > +       subl    %eax, %ebp
> >         pushl   %ebp            /* output address */
> > +
> >         pushl   $z_input_len    /* input_len */
> >         leal    input_data(%ebx), %eax
> >         pushl   %eax            /* input_data */
> > diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S
> > index b0c0d16..67dd8d3 100644
> > --- a/arch/x86/boot/compressed/head_64.S
> > +++ b/arch/x86/boot/compressed/head_64.S
> > @@ -102,7 +102,9 @@ ENTRY(startup_32)
> >  1:
> >
> >         /* Target address to relocate to for decompression */
> > -       addl    $z_extract_offset, %ebx
> > +       movl    BP_init_size(%esi), %eax
> > +       subl    $_end, %eax
> > +       addl    %eax, %ebx
> >
> >  /*
> >   * Prepare for entering 64 bit mode
> > @@ -330,7 +332,9 @@ preferred_addr:
> >  1:
> >
> >         /* Target address to relocate to for decompression */
> > -       leaq    z_extract_offset(%rbp), %rbx
> > +       movl    BP_init_size(%rsi), %ebx
> > +       subl    $_end, %ebx
> > +       addq    %rbp, %rbx
> >
> >         /* Set up the stack */
> >         leaq    boot_stack_end(%rbx), %rsp
> > diff --git a/arch/x86/boot/compressed/mkpiggy.c b/arch/x86/boot/compressed/mkpiggy.c
> > index d8222f2..b980046 100644
> > --- a/arch/x86/boot/compressed/mkpiggy.c
> > +++ b/arch/x86/boot/compressed/mkpiggy.c
> > @@ -85,9 +85,6 @@ int main(int argc, char *argv[])
> >         printf("z_output_len = %lu\n", (unsigned long)olen);
> >         printf(".globl z_extract_offset\n");
> >         printf("z_extract_offset = 0x%lx\n", offs);
> > -       /* z_extract_offset_negative allows simplification of head_32.S */
> > -       printf(".globl z_extract_offset_negative\n");
> > -       printf("z_extract_offset_negative = -0x%lx\n", offs);
> >         printf(".globl z_run_size\n");
> >         printf("z_run_size = %lu\n", run_size);
> >
> > diff --git a/arch/x86/boot/compressed/vmlinux.lds.S b/arch/x86/boot/compressed/vmlinux.lds.S
> > index 34d047c..e24e0a0 100644
> > --- a/arch/x86/boot/compressed/vmlinux.lds.S
> > +++ b/arch/x86/boot/compressed/vmlinux.lds.S
> > @@ -70,5 +70,6 @@ SECTIONS
> >                 _epgtable = . ;
> >         }
> >  #endif
> > +       . = ALIGN(PAGE_SIZE);   /* keep ZO size page aligned */
> >         _end = .;
> >  }
> > diff --git a/arch/x86/kernel/asm-offsets.c b/arch/x86/kernel/asm-offsets.c
> > index 84a7524..506de14 100644
> > --- a/arch/x86/kernel/asm-offsets.c
> > +++ b/arch/x86/kernel/asm-offsets.c
> > @@ -81,6 +81,7 @@ void common(void) {
> >         OFFSET(BP_hardware_subarch, boot_params, hdr.hardware_subarch);
> >         OFFSET(BP_version, boot_params, hdr.version);
> >         OFFSET(BP_kernel_alignment, boot_params, hdr.kernel_alignment);
> > +       OFFSET(BP_init_size, boot_params, hdr.init_size);
> >         OFFSET(BP_pref_address, boot_params, hdr.pref_address);
> >         OFFSET(BP_code32_start, boot_params, hdr.code32_start);
> >
> > diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S
> > index 74e4bf1..217d5b1 100644
> > --- a/arch/x86/kernel/vmlinux.lds.S
> > +++ b/arch/x86/kernel/vmlinux.lds.S
> > @@ -325,6 +325,7 @@ SECTIONS
> >                 __brk_limit = .;
> >         }
> >
> > +       . = ALIGN(PAGE_SIZE);           /* keep VO_INIT_SIZE page aligned */
> >         _end = .;
> >
> >          STABS_DEBUG
> > --
> > 2.5.0
> >
> 
> 
> 
> -- 
> Kees Cook
> Chrome OS & Brillo Security

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web