diff mbox

[V3] xen/arm: arm64: Update the Image header

Message ID 1473673432-11728-1-git-send-email-peng.fan@nxp.com (mailing list archive)
State New, archived
Headers show

Commit Message

Peng Fan Sept. 12, 2016, 9:43 a.m. UTC
According to Linux Kernel, Documentation/arm64/booting.txt
"
When image_size is zero, a bootloader should attempt to keep as much
memory as possible free for use by the kernel immediately after the
end of the kernel image. The amount of space required will vary
depending on selected features, and is effectively unbound.
"
This will consumes some memory and time, for example,
When booting xen from U-Boot, U-Boot will use the image size
info. Because this information is lacked in XEN image,U-Boot
assume the image size is 16MB to memmove, which will cost lots
time on simulation platform.

The flags field is also filled with value 0xA,
Bit3(physical placement):   1
Bit2-1(Page size):          1
Bit0(endianness):           0

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Julien Grall <julien.grall@arm.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>
---

V3:
 Drop the image.h macros.h from Linux, included in V2.
 Only update image size and flags entry. offset was kept 0 as before.
 Only little endian supported.

V2:
 According to Linux Kernel, a2c1d73b94ed49 "arm64: Update the Image header",
 included unneccessary stuff.

 xen/arch/arm/arm64/head.S | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Julien Grall Sept. 16, 2016, 12:28 p.m. UTC | #1
Hello Peng,

On 12/09/2016 11:43, Peng Fan wrote:
> According to Linux Kernel, Documentation/arm64/booting.txt
> "
> When image_size is zero, a bootloader should attempt to keep as much
> memory as possible free for use by the kernel immediately after the
> end of the kernel image. The amount of space required will vary
> depending on selected features, and is effectively unbound.
> "
> This will consumes some memory and time, for example,
> When booting xen from U-Boot, U-Boot will use the image size
> info. Because this information is lacked in XEN image,U-Boot
> assume the image size is 16MB to memmove, which will cost lots
> time on simulation platform.
>
> The flags field is also filled with value 0xA,
> Bit3(physical placement):   1
> Bit2-1(Page size):          1
> Bit0(endianness):           0

Please explain in the commit message why those values and, for instance, 
not 0 for Bit3.

>
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> Cc: Julien Grall <julien.grall@arm.com>
> Cc: Stefano Stabellini <sstabellini@kernel.org>
> ---
>
> V3:
>  Drop the image.h macros.h from Linux, included in V2.
>  Only update image size and flags entry. offset was kept 0 as before.
>  Only little endian supported.
>
> V2:
>  According to Linux Kernel, a2c1d73b94ed49 "arm64: Update the Image header",
>  included unneccessary stuff.
>
>  xen/arch/arm/arm64/head.S | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/xen/arch/arm/arm64/head.S b/xen/arch/arm/arm64/head.S
> index 91e2817..2cd3699 100644
> --- a/xen/arch/arm/arm64/head.S
> +++ b/xen/arch/arm/arm64/head.S
> @@ -115,8 +115,8 @@ efi_head:
>          add     x13, x18, #0x16
>          b       real_start           /* branch to kernel start */
>          .quad   0                    /* Image load offset from start of RAM */
> -        .quad   0                    /* reserved */
> -        .quad   0                    /* reserved */
> +	.quad   _end - start         /* Effective size of kernel image, little-endian */

NIT: Please use _start here.

> +	.quad   0xa                  /* Informative flags(Physical placement 1, 4KB, LE), little-endian */
>          .quad   0                    /* reserved */
>          .quad   0                    /* reserved */
>          .quad   0                    /* reserved */
>

Regards,
diff mbox

Patch

diff --git a/xen/arch/arm/arm64/head.S b/xen/arch/arm/arm64/head.S
index 91e2817..2cd3699 100644
--- a/xen/arch/arm/arm64/head.S
+++ b/xen/arch/arm/arm64/head.S
@@ -115,8 +115,8 @@  efi_head:
         add     x13, x18, #0x16
         b       real_start           /* branch to kernel start */
         .quad   0                    /* Image load offset from start of RAM */
-        .quad   0                    /* reserved */
-        .quad   0                    /* reserved */
+	.quad   _end - start         /* Effective size of kernel image, little-endian */
+	.quad   0xa                  /* Informative flags(Physical placement 1, 4KB, LE), little-endian */
         .quad   0                    /* reserved */
         .quad   0                    /* reserved */
         .quad   0                    /* reserved */