xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* boot-wrapped xen image barfs with overlapped sections
@ 2016-09-16 21:44 Jun Sun
  2016-09-21  0:52 ` Jun Sun
  0 siblings, 1 reply; 2+ messages in thread
From: Jun Sun @ 2016-09-16 21:44 UTC (permalink / raw)
  To: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 1759 bytes --]

Hi, all,

I have been following the instructions at
https://wiki.linaro.org/LEG/Engineering/Virtualization/Xen_on_ARMv8_Foundation
to build xen for arm64.

When I tried to use the latest kernel instead of v3.13 as suggested, I
failed when building boot-wrapped image.  See below.

=======================
jsun@ubuntu:~/work/xen/linaro-2014-guide/boot-wrapper-aarch64$ make
CROSS_COMPILE=aarch64-linux-gnu- FDT_SRC=foundation-v8.dts xen-system.axf
aarch64-linux-gnu-ld -o xen-system.axf --script=model.xen.lds
aarch64-linux-gnu-ld: section .xen loaded at
[0000000080a00000,0000000080ac061f] overlaps section .kernel loaded at
[0000000080080000,0000000080c50dff]
Makefile:78: recipe for target 'xen-system.axf' failed
make: *** [xen-system.axf] Error 1
=======================

Obviously the issue is that linker script gives about 8.5MB space for
kernel which is too small. If I modify the linker script to give more space
to kernel, the xen will halt during boot up right before Dom0 starts:

==========================
(XEN) *** LOADING DOMAIN 0 ***
(XEN) Loading kernel from boot module @ 0000000080080000
(XEN) Allocating 1:1 mappings totalling 512MB for dom0:
(XEN) BANK[0] 0x000000a0000000-0x000000c0000000 (512MB)
(XEN) Grant table range: 0x000000ffe00000-0x000000ffe5e000
(XEN) Loading zImage from 0000000080080000 to
00000000a0080000-00000000a0880000
(XEN) Allocating PPI 16 for event channel interrupt
(XEN) Loading dom0 DTB to 0x00000000a8000000-0x00000000a8000fe7
(XEN) Std. Loglevel: All
(XEN) Guest Loglevel: All
(XEN) *** Serial input -> DOM0 (type 'CTRL-x' three times to switch input
to Xen)
(XEN) Freed 276kB init memory.
==========================

Any pointers on the right way to get modern kernel working with xen on
ARM64?

Thanks.

Jun

[-- Attachment #1.2: Type: text/html, Size: 2314 bytes --]

[-- Attachment #2: Type: text/plain, Size: 127 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

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

* Re: boot-wrapped xen image barfs with overlapped sections
  2016-09-16 21:44 boot-wrapped xen image barfs with overlapped sections Jun Sun
@ 2016-09-21  0:52 ` Jun Sun
  0 siblings, 0 replies; 2+ messages in thread
From: Jun Sun @ 2016-09-21  0:52 UTC (permalink / raw)
  To: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 3494 bytes --]

I finally resolved this issue after hunting around.  The clue comes from
this page,
https://wiki.linaro.org/LEG/Engineering/Virtualization/Xen_ARM_Guide:

/chosen/module@1/reg should match bootwrapper model.lds.
>

Basically if I increase memory region for kernel, I should also update dts
file on  /chosen/module@1/reg.

Here is what in model.xen.lds.  As you can see, kernel area is increased to
14MB.

OUTPUT_FORMAT("elf64-littleaarch64")
OUTPUT_ARCH(aarch64)
TARGET(binary)
INPUT(./boot.xen.o)
INPUT(Xen)
INPUT(Image)
INPUT(./fdt.dtb)
SECTIONS
{
 . = 0x80000000;
 .text : { boot.xen.o }
 . = 0x80000000 + 0xfff8;
 mbox = .;
 .mbox : { QUAD(0x0) }
 . = 0x80000000 + 0xE00000;
 xen = .;
 .xen : { Xen }
 . = 0x80000000 + 0x80000;
 kernel = .;
 .kernel : { Image }
 . = 0x80000000 + 0x08000000;
 dtb = .;
 .dtb : { ./fdt.dtb }
 .data : { *(.data) }
 .bss : { *(.bss) }
}

And here is what in foundation-v8.dts for chosen:

        chosen {
                #address-cells = <0x1>;
                #size-cells = <0x1>;
                xen,xen-bootargs = "dom0_mem=512M dom0_max_vcpus=2
dtuart=serial0 conswitch=x loglvl=all guest_loglvl=all no-bootscrub";

                module@1 {
                        compatible = "xen,linux-zimage",
"xen,multiboot-module";
                        reg = <0x80080000 0xe00000>;
                        bootargs = "earlyprintk=pl011,0x1c090000
console=hvc0 root=/dev/vda2 debug rw";
                };
        };

Kernels can be any recent 4.x kernel from torvalds, stable or linaro trees.

Now move to on to boot kernel with initrd.

Jun

On Fri, Sep 16, 2016 at 2:44 PM, Jun Sun <jsun@junsun.net> wrote:

>
> Hi, all,
>
> I have been following the instructions at https://wiki.linaro.org/
> LEG/Engineering/Virtualization/Xen_on_ARMv8_Foundation to build xen for
> arm64.
>
> When I tried to use the latest kernel instead of v3.13 as suggested, I
> failed when building boot-wrapped image.  See below.
>
> =======================
> jsun@ubuntu:~/work/xen/linaro-2014-guide/boot-wrapper-aarch64$ make
> CROSS_COMPILE=aarch64-linux-gnu- FDT_SRC=foundation-v8.dts xen-system.axf
> aarch64-linux-gnu-ld -o xen-system.axf --script=model.xen.lds
> aarch64-linux-gnu-ld: section .xen loaded at [0000000080a00000,0000000080ac061f]
> overlaps section .kernel loaded at [0000000080080000,0000000080c50dff]
> Makefile:78: recipe for target 'xen-system.axf' failed
> make: *** [xen-system.axf] Error 1
> =======================
>
> Obviously the issue is that linker script gives about 8.5MB space for
> kernel which is too small. If I modify the linker script to give more space
> to kernel, the xen will halt during boot up right before Dom0 starts:
>
> ==========================
> (XEN) *** LOADING DOMAIN 0 ***
> (XEN) Loading kernel from boot module @ 0000000080080000
> (XEN) Allocating 1:1 mappings totalling 512MB for dom0:
> (XEN) BANK[0] 0x000000a0000000-0x000000c0000000 (512MB)
> (XEN) Grant table range: 0x000000ffe00000-0x000000ffe5e000
> (XEN) Loading zImage from 0000000080080000 to 00000000a0080000-
> 00000000a0880000
> (XEN) Allocating PPI 16 for event channel interrupt
> (XEN) Loading dom0 DTB to 0x00000000a8000000-0x00000000a8000fe7
> (XEN) Std. Loglevel: All
> (XEN) Guest Loglevel: All
> (XEN) *** Serial input -> DOM0 (type 'CTRL-x' three times to switch input
> to Xen)
> (XEN) Freed 276kB init memory.
> ==========================
>
> Any pointers on the right way to get modern kernel working with xen on
> ARM64?
>
> Thanks.
>
> Jun
>

[-- Attachment #1.2: Type: text/html, Size: 5357 bytes --]

[-- Attachment #2: Type: text/plain, Size: 127 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

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

end of thread, other threads:[~2016-09-21  0:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-16 21:44 boot-wrapped xen image barfs with overlapped sections Jun Sun
2016-09-21  0:52 ` Jun Sun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).