On Wed, Mar 21, 2018 at 06:09:57PM +0000, Wei Liu wrote:
> On Wed, Mar 21, 2018 at 02:42:10PM +0000, Roger Pau Monne wrote:
> > 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.
> 
> I get the cmdline bit.
> 
> What does it need to be HVMLOADER_MODULE_MAX_COUNT? Isn't better to just
> map what we need here?

Because the position of the modules command line is:

modlist_paddr + sizeof(struct hvm_modlist_entry) * HVMLOADER_MODULE_MAX_COUNT;

(This is from add_module_to_list).

So if dom->num_modules < HVMLOADER_MODULE_MAX_COUNT the mapped region
is smaller that what we might end up using.

I'm not sure why HVMLOADER_MODULE_MAX_COUNT is used when allocating
memory (in alloc_magic_pages_hvm) instead of the actual number of
modules (dom->num_modules), but the proposed change seems to be the
easier way to fix the mapping issue.

I've CC'ed the original authors of this code in another thread, but
got no response.

Thanks, Roger.

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

Reply via email to