HV: use tag to specify multiboot module

Previously multiboot mods[0] is designed for kernel module for all
pre-launched VMs including SOS VM, and mods[0].mm_string is used
to store kernel cmdline. This design could not satisfy the requirement
of hybrid mode scenarios that each VM might use their own kernel image
also ramdisk image. To resolve this problem, we will use a tag in
mods mm_string field to specify the module type. If the tag could
be matched with os_config of VM configurations, the corresponding
module would be loaded;

Tracked-On: #3214

Signed-off-by: Victor Sun <victor.sun@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
This commit is contained in:
Victor Sun
2019-06-03 00:05:09 +08:00
committed by wenlingz
parent d0fa83b2cb
commit ea7ca8595c
7 changed files with 143 additions and 124 deletions

View File

@@ -18,6 +18,7 @@
#define PLUG_CPU(n) (1U << (n))
#define MAX_VUART_NUM_PER_VM 2U
#define MAX_VM_OS_NAME_LEN 32U
#define MAX_MOD_TAG_LEN 32U
/*
* PRE_LAUNCHED_VM is launched by ACRN hypervisor, with LAPIC_PT;
@@ -68,6 +69,8 @@ enum os_kernel_type {
struct acrn_vm_os_config {
char name[MAX_VM_OS_NAME_LEN]; /* OS name, useful for debug */
enum os_kernel_type kernel_type; /* used for kernel specifc loading method */
char kernel_mod_tag[MAX_MOD_TAG_LEN]; /* multiboot module tag for kernel */
char ramdisk_mod_tag[MAX_MOD_TAG_LEN]; /* multiboot module tag for ramdisk */
char bootargs[MAX_BOOTARGS_SIZE]; /* boot args/cmdline */
} __aligned(8);