The start_info size calculated in bootlate_hvm is wrong. It should use HVMLOADER_MODULE_MAX_COUNT instead of dom->num_modules and it doesn't take into account the size of the modules command line.
This is not a problem so far because the actually used amount of memory doesn't cross a page boundary, and so no page-fault is triggered. Signed-off-by: Roger Pau Monné <roger....@citrix.com> --- Cc: Ian Jackson <ian.jack...@eu.citrix.com> Cc: Wei Liu <wei.l...@citrix.com> --- tools/libxc/xc_dom_x86.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c index 0b65dab4bc..e29c666b89 100644 --- a/tools/libxc/xc_dom_x86.c +++ b/tools/libxc/xc_dom_x86.c @@ -1671,7 +1671,11 @@ static int bootlate_hvm(struct xc_dom_image *dom) unsigned int i; start_info_size = sizeof(*start_info) + dom->cmdline_size; - start_info_size += sizeof(struct hvm_modlist_entry) * dom->num_modules; + start_info_size += sizeof(struct hvm_modlist_entry) * + HVMLOADER_MODULE_MAX_COUNT; + start_info_size += HVMLOADER_MODULE_CMDLINE_SIZE * + HVMLOADER_MODULE_MAX_COUNT; + if ( start_info_size > dom->start_info_seg.pages << XC_DOM_PAGE_SHIFT(dom) ) -- 2.16.2 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel