All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@arm.com>
To: Artem Mygaiev <Artem_Mygaiev@epam.com>,
	"andrew.cooper3@citrix.com" <andrew.cooper3@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Cc: "sstabellini@kernel.org" <sstabellini@kernel.org>,
	"wei.liu2@citrix.com" <wei.liu2@citrix.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>,
	"George.Dunlap@eu.citrix.com" <George.Dunlap@eu.citrix.com>,
	"tim@xen.org" <tim@xen.org>,
	"JBeulich@suse.com" <JBeulich@suse.com>,
	"ian.jackson@citrix.com" <ian.jackson@citrix.com>
Subject: Re: [PATCH 2/2] docs/hypervisor-guide: Code Coverage
Date: Thu, 4 Apr 2019 13:29:22 +0100	[thread overview]
Message-ID: <d29a3a6f-937c-25b8-517d-54946654a049@arm.com> (raw)
In-Reply-To: <b59b01933577e78c305e425cd3bf17efa88d4a3a.camel@epam.com>



On 04/04/2019 13:07, Artem Mygaiev wrote:
> Hello Andrew

Hi,

> Minor note below.
> 
> On Wed, 2019-04-03 at 16:00 +0100, Andrew Cooper wrote:
> 
> [snip]
> 
>> +  For ARM builds, while Xen will compile with ``CONFIG_COVERAGE``
>> enabled, the
>> +  resulting binary will not successfully boot if it exceeds 2MB in
>> size.
>> +  Xen's early memory management code needs adjusting to resolve this
>> issue.
> 
> Julien mentioned that on staging the binary is 1.5MB only so we must be
> able to run it without changes to Xen mem management. I will ask
> someone to try it today or tomorrow and get back with results

I tried with a different .config and Xen will use 1.8MB. I have 
computed the size using (_start - _end).

This is dangerously close to 2MB and it might be possible be
possible that we reach the limit with another .config.

I think Andrew's statement is correct. It does not say the binary
will always be above 2MB but it might exceeds it. It only warns
that it may happen and fail to boot.

The boot failure may not be obvious for the user. I wrote the
patch below to fail when linking instead. We can consider it
for backporting as well:

commit 256528c97b4c265911d960073facd4fdffcc650a
Author: Julien Grall <julien.grall@arm.com>
Date:   Thu Apr 4 13:22:46 2019 +0100

    xen/arm: Check Xen size when linking
    
    The linker will happily link Xen if it is bigger than what we can handle
    (e.g 2MB). This will result to unexpected failure after boot.
    
    This unexpected failure can be prevented by forbidding linking if Xen is
    bigger than 2MB.
    
    Signed-off-by: Julien Grall <julien.grall@arm.com>

diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S
index 1e72906477..28dc2a6070 100644
--- a/xen/arch/arm/xen.lds.S
+++ b/xen/arch/arm/xen.lds.S
@@ -242,3 +242,4 @@ ASSERT( _end_boot - start <= PAGE_SIZE, "Boot code is larger than 4K")
  */
 ASSERT(IS_ALIGNED(__init_begin,     4), "__init_begin is misaligned")
 ASSERT(IS_ALIGNED(__init_end,       4), "__init_end is misaligned")
+ASSERT(_end - start < XEN_SLOT_SIZE, "Xen is larger than 2M")
diff --git a/xen/include/asm-arm/config.h b/xen/include/asm-arm/config.h
index bc89e84f4d..98d7765410 100644
--- a/xen/include/asm-arm/config.h
+++ b/xen/include/asm-arm/config.h
@@ -107,6 +107,7 @@
  *  Unused
  */
 
+#define XEN_SLOT_SIZE         MB(2)
 #define XEN_VIRT_START         _AT(vaddr_t,0x00200000)
 #define FIXMAP_ADDR(n)        (_AT(vaddr_t,0x00400000) + (n) * PAGE_SIZE)

-- 
Julien Grall

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

  reply	other threads:[~2019-04-04 12:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-03 14:59 [PATCH 0/2] docs: Improve coverage docs Andrew Cooper
2019-04-03 14:59 ` [PATCH 1/2] docs/sphinx: Introduce a hypervisor guide section Andrew Cooper
2019-04-04 12:10   ` Wei Liu
2019-04-03 15:00 ` [PATCH 2/2] docs/hypervisor-guide: Code Coverage Andrew Cooper
2019-04-04 12:07   ` Artem Mygaiev
2019-04-04 12:29     ` Julien Grall [this message]
2019-04-04 12:46       ` Andrew Cooper
2019-04-04 13:26         ` Julien Grall
2019-04-04 12:10   ` Wei Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d29a3a6f-937c-25b8-517d-54946654a049@arm.com \
    --to=julien.grall@arm.com \
    --cc=Artem_Mygaiev@epam.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ian.jackson@citrix.com \
    --cc=konrad.wilk@oracle.com \
    --cc=sstabellini@kernel.org \
    --cc=tim@xen.org \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.