mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
x86/pvh: pass module command line to dom0
Both the multiboot and the HVM start info structures allow passing a
string together with a module. Implement the missing support in
pvh_load_kernel so that module strings found in the multiboot
structure are forwarded to dom0.
Fixes: 62ba982424 ('x86: parse Dom0 kernel for PVHv2')
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Release-Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
This commit is contained in:
1 parent
7e5cffcd1e
commit
0ecb8eb09f
1 file changed
+16
-1
@@ -617,7 +617,22 @@ static int __init pvh_load_kernel(struct domain *d, const module_t *image,
|
||||
|
||||
mod.paddr = last_addr;
|
||||
mod.size = initrd->mod_end;
|
||||
last_addr += ROUNDUP(initrd->mod_end, PAGE_SIZE);
|
||||
last_addr += ROUNDUP(initrd->mod_end, elf_64bit(&elf) ? 8 : 4);
|
||||
if ( initrd->string )
|
||||
{
|
||||
char *str = __va(initrd->string);
|
||||
size_t len = strlen(str) + 1;
|
||||
|
||||
rc = hvm_copy_to_guest_phys(last_addr, str, len, v);
|
||||
if ( rc )
|
||||
{
|
||||
printk("Unable to copy module command line\n");
|
||||
return rc;
|
||||
}
|
||||
mod.cmdline_paddr = last_addr;
|
||||
last_addr += len;
|
||||
}
|
||||
last_addr = ROUNDUP(last_addr, PAGE_SIZE);
|
||||
}
|
||||
|
||||
/* Free temporary buffers. */
|
||||
|
||||