[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v4] xen: arm: Update arm64 image header



On 29.06.2016 13:08, Dirk Behme wrote:
Hi Julien,

On 29.06.2016 12:32, Julien Grall wrote:
Hi Dirk,

On 27/06/2016 08:53, Dirk Behme wrote:
+    if ( (end - start) > size ) {
+        printk(XENLOG_ERR "Error: Kernel Image size: %lu bytes >
bootmodule size: %lu bytes\n",
+               zimage.image_size, (uint64_t)size);
+        printk(XENLOG_ERR "The field 'size' does not match the size
of blob!\n");
         return -EINVAL;
+    }

This patch is breaking boot on any ARM64 platform (UEFI and
bootwrapper).


Well, I wonder if it breaks because the kernel is too large? As intended?

You are the expert on this, so I just can give my (limited?) understanding:

In my use case, starting with the Xen development and not really knowing
the details, taking a random example from the net I had configured 10MB
in the device tree:

module@0x48200000 {
       compatible = "xen,linux-zimage", "xen,multiboot-module";
       reg = <0x48200000 0x00A00000>; /* Max Image size 10MB */
};

This failed silently. No error message.

Without knowing any details, my first workaround was to make the kernel
smaller. Having a kernel Image smaller than 10MB worked, then.

While debugging it, I found that these 0x00A00000 are used for 'size'.
And increasing it to 0x00F00000 (15MB) does work for me, now.

I don't know anything aobut UEFI and bootwrapper, but could you check
the size given for 'size' and the real size of the kernel Image? What's
about if you increase 'size'?

Yes, this check is there just to avoid the silent failing I observed. If
we have the error message, as I have implemented it, it would have saved
some debugging time for me ;) So it's not about using the size for real
loading, its just used for checking.

A short term workaround would be to convert the ERR into WARN and remove
the return.

It's somehow my feeling that there might be an issue regarding the sizes
if the warning is there.


Just fyi, with

13517824 arch/arm64/boot/Image

and a quick printk I get

(XEN) -> image_size: 13807616 bytes

So, yes, image_size is ~300k larger than the file size. Yes, that might be due to the BSS.

Best regards

Dirk


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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.