[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 2/2] docs/hypervisor-guide: Code Coverage
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@xxxxxxx> 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@xxxxxxx> 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@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |