diff --git a/hypervisor/arch/x86/configs/apl-mrb/misc_cfg.h b/hypervisor/arch/x86/configs/apl-mrb/misc_cfg.h index f476b2bd0..a64ca561f 100644 --- a/hypervisor/arch/x86/configs/apl-mrb/misc_cfg.h +++ b/hypervisor/arch/x86/configs/apl-mrb/misc_cfg.h @@ -10,6 +10,27 @@ #define ROOTFS_0 "root=/dev/sda3 " #define ROOTFS_1 "root=/dev/mmcblk1p1 " +#define SOS_ROOTFS ROOTFS_1 #define SOS_CONSOLE "console=ttyS2 " +#ifndef CONFIG_RELEASE +#define BOOTARG_DEBUG "hvlog=2M@0x6de00000 " \ + "memmap=0x400000$0x6da00000 " \ + "ramoops.mem_address=0x6da00000 " \ + "ramoops.mem_size=0x400000 " \ + "ramoops.console_size=0x200000 " \ + "reboot_panic=p,w " +#else +#define BOOTARG_DEBUG "" +#endif + +#define SOS_BOOTARGS_DIFF BOOTARG_DEBUG \ + "module_blacklist=dwc3_pci " \ + "i915.enable_initial_modeset=1 " \ + "i915.enable_guc=0x02 " \ + "video=DP-1:d " \ + "video=DP-2:d " \ + "cma=64M@0- " \ + "panic_print=0x1f" + #endif /* MISC_CFG_H */ diff --git a/hypervisor/arch/x86/configs/apl-up2/misc_cfg.h b/hypervisor/arch/x86/configs/apl-up2/misc_cfg.h index f71fe9d9a..2ff573d4a 100644 --- a/hypervisor/arch/x86/configs/apl-up2/misc_cfg.h +++ b/hypervisor/arch/x86/configs/apl-up2/misc_cfg.h @@ -10,6 +10,23 @@ #define ROOTFS_0 "root=/dev/sda3 " #define ROOTFS_1 "root=/dev/mmcblk0p1 " +#define SOS_ROOTFS ROOTFS_1 #define SOS_CONSOLE "console=ttyS0 " +#ifndef CONFIG_RELEASE +#define BOOTARG_DEBUG "hvlog=2M@0x6de00000 " \ + "memmap=0x400000$0x6da00000 " \ + "ramoops.mem_address=0x6da00000 " \ + "ramoops.mem_size=0x400000 " \ + "ramoops.console_size=0x200000 " \ + "reboot_panic=p,w " +#else +#define BOOTARG_DEBUG "" +#endif + +#define SOS_BOOTARGS_DIFF BOOTARG_DEBUG \ + "module_blacklist=dwc3_pci " \ + "i915.enable_guc=0x02 " \ + "cma=64M@0- " + #endif /* MISC_CFG_H */ diff --git a/hypervisor/arch/x86/configs/dnv-cb2/misc_cfg.h b/hypervisor/arch/x86/configs/dnv-cb2/misc_cfg.h index 67a84f85f..7a67e15ac 100644 --- a/hypervisor/arch/x86/configs/dnv-cb2/misc_cfg.h +++ b/hypervisor/arch/x86/configs/dnv-cb2/misc_cfg.h @@ -9,6 +9,13 @@ #define ROOTFS_0 "root=/dev/sda3 " +#define SOS_ROOTFS ROOTFS_0 #define SOS_CONSOLE "console=ttyS0 " +#ifndef CONFIG_RELEASE +#define SOS_BOOTARGS_DIFF "hvlog=2M@0x1FE00000" +#else +#define SOS_BOOTARGS_DIFF "" +#endif + #endif /* MISC_CFG_H */ diff --git a/hypervisor/arch/x86/configs/generic/misc_cfg.h b/hypervisor/arch/x86/configs/generic/misc_cfg.h index f71fe9d9a..01d66b801 100644 --- a/hypervisor/arch/x86/configs/generic/misc_cfg.h +++ b/hypervisor/arch/x86/configs/generic/misc_cfg.h @@ -10,6 +10,13 @@ #define ROOTFS_0 "root=/dev/sda3 " #define ROOTFS_1 "root=/dev/mmcblk0p1 " +#define SOS_ROOTFS ROOTFS_0 #define SOS_CONSOLE "console=ttyS0 " +#ifndef CONFIG_RELEASE +#define SOS_BOOTARGS_DIFF "hvlog=2M@0x1FE00000" +#else +#define SOS_BOOTARGS_DIFF "" +#endif + #endif /* MISC_CFG_H */ diff --git a/hypervisor/arch/x86/configs/nuc6cayh/misc_cfg.h b/hypervisor/arch/x86/configs/nuc6cayh/misc_cfg.h index 67a84f85f..7a67e15ac 100644 --- a/hypervisor/arch/x86/configs/nuc6cayh/misc_cfg.h +++ b/hypervisor/arch/x86/configs/nuc6cayh/misc_cfg.h @@ -9,6 +9,13 @@ #define ROOTFS_0 "root=/dev/sda3 " +#define SOS_ROOTFS ROOTFS_0 #define SOS_CONSOLE "console=ttyS0 " +#ifndef CONFIG_RELEASE +#define SOS_BOOTARGS_DIFF "hvlog=2M@0x1FE00000" +#else +#define SOS_BOOTARGS_DIFF "" +#endif + #endif /* MISC_CFG_H */ diff --git a/hypervisor/arch/x86/configs/nuc7i7bnh/misc_cfg.h b/hypervisor/arch/x86/configs/nuc7i7bnh/misc_cfg.h index 09144d155..52e9a75df 100644 --- a/hypervisor/arch/x86/configs/nuc7i7bnh/misc_cfg.h +++ b/hypervisor/arch/x86/configs/nuc7i7bnh/misc_cfg.h @@ -10,6 +10,13 @@ #define ROOTFS_0 "root=/dev/sda3 " #define ROOTFS_1 "root=/dev/nvme0n1p3 " +#define SOS_ROOTFS ROOTFS_0 #define SOS_CONSOLE "console=ttyS0 " +#ifndef CONFIG_RELEASE +#define SOS_BOOTARGS_DIFF "hvlog=2M@0x1FE00000" +#else +#define SOS_BOOTARGS_DIFF "" +#endif + #endif /* MISC_CFG_H */ diff --git a/hypervisor/boot/guest/vboot_info.c b/hypervisor/boot/guest/vboot_info.c index ee0bf1e33..7017b15d1 100644 --- a/hypervisor/boot/guest/vboot_info.c +++ b/hypervisor/boot/guest/vboot_info.c @@ -130,7 +130,7 @@ static void merge_cmdline(const struct acrn_vm *vm, const char *cmdline, const c dst_avail -= 1U; cmd_dst += 1U; - /* copy mods[].mm_string */ + /* copy vm_config->os_config.bootargs */ (void)strncpy_s(cmd_dst, dst_avail, cmdstr, cmdstr_len); } } @@ -189,13 +189,11 @@ static int32_t init_general_vm_boot_info(struct acrn_vm *vm) dev_dbg(ACRN_DBG_BOOT, "mod counts=%d\n", mbi->mi_mods_count); - /* mod[0] is for kernel&cmdline, other mod for ramdisk/firmware info*/ + /* mod[0] is for kernel, other mod for ramdisk/firmware info*/ mods = (struct multiboot_module *)hpa2hva((uint64_t)mbi->mi_mods_addr); dev_dbg(ACRN_DBG_BOOT, "mod0 start=0x%x, end=0x%x", mods[0].mm_mod_start, mods[0].mm_mod_end); - dev_dbg(ACRN_DBG_BOOT, "cmd addr=0x%x, str=%s", mods[0].mm_string, - (char *)(uint64_t)mods[0].mm_string); vm->sw.kernel_type = vm_config->os_config.kernel_type; vm->sw.kernel_info.kernel_src_addr = hpa2hva((uint64_t)mods[0].mm_mod_start); @@ -210,20 +208,18 @@ static int32_t init_general_vm_boot_info(struct acrn_vm *vm) if ((mbi->mi_flags & MULTIBOOT_INFO_HAS_CMDLINE) != 0U) { /* * If there is cmdline from mbi->mi_cmdline, merge it with - * mods[0].mm_string + * vm_config->os_config.bootargs */ merge_cmdline(vm, hpa2hva((uint64_t)mbi->mi_cmdline), - hpa2hva((uint64_t)mods[0].mm_string)); + vm_config->os_config.bootargs); vm->sw.bootargs_info.src_addr = kernel_cmdline; vm->sw.bootargs_info.size = strnlen_s(kernel_cmdline, MAX_BOOTARGS_SIZE); } else { - vm->sw.bootargs_info.src_addr = - hpa2hva((uint64_t)mods[0].mm_string); + vm->sw.bootargs_info.src_addr = vm_config->os_config.bootargs; vm->sw.bootargs_info.size = - strnlen_s(hpa2hva((uint64_t)mods[0].mm_string), - MAX_BOOTARGS_SIZE); + strnlen_s(vm_config->os_config.bootargs, MAX_BOOTARGS_SIZE); } } diff --git a/hypervisor/scenarios/industry/vm_configurations.c b/hypervisor/scenarios/industry/vm_configurations.c index 4c6aafc0f..87b189a76 100644 --- a/hypervisor/scenarios/industry/vm_configurations.c +++ b/hypervisor/scenarios/industry/vm_configurations.c @@ -23,6 +23,7 @@ struct acrn_vm_config vm_configs[CONFIG_MAX_VM_NUM] = { .os_config = { .name = "ACRN Service OS", .kernel_type = KERNEL_BZIMAGE, + .bootargs = SOS_VM_BOOTARGS }, .vuart[0] = { .type = VUART_LEGACY_PIO, diff --git a/hypervisor/scenarios/industry/vm_configurations.h b/hypervisor/scenarios/industry/vm_configurations.h index b56b96626..ea86e93a3 100644 --- a/hypervisor/scenarios/industry/vm_configurations.h +++ b/hypervisor/scenarios/industry/vm_configurations.h @@ -7,11 +7,25 @@ #ifndef VM_CONFIGURATIONS_H #define VM_CONFIGURATIONS_H +#include + #define CONFIG_MAX_VM_NUM 4U /* Bits mask of guest flags that can be programmed by device model. Other bits are set by hypervisor only */ #define DM_OWNED_GUEST_FLAG_MASK (GUEST_FLAG_SECURE_WORLD_ENABLED | GUEST_FLAG_LAPIC_PASSTHROUGH | \ GUEST_FLAG_RT | GUEST_FLAG_IO_COMPLETION_POLLING) +#define SOS_VM_BOOTARGS SOS_ROOTFS \ + "rw rootwait " \ + "console=tty0 " \ + SOS_CONSOLE \ + "consoleblank=0 " \ + "no_timer_check " \ + "quiet loglevel=3 " \ + "i915.nuclear_pageflip=1 " \ + "i915.avail_planes_per_pipe=0x01010F " \ + "i915.domain_plane_owners=0x011111110000 " \ + "i915.enable_gvt=1 " \ + SOS_BOOTARGS_DIFF #endif /* VM_CONFIGURATIONS_H */ diff --git a/hypervisor/scenarios/sdc/vm_configurations.c b/hypervisor/scenarios/sdc/vm_configurations.c index b10213157..f3ec7109c 100644 --- a/hypervisor/scenarios/sdc/vm_configurations.c +++ b/hypervisor/scenarios/sdc/vm_configurations.c @@ -25,6 +25,7 @@ struct acrn_vm_config vm_configs[CONFIG_MAX_VM_NUM] = { .os_config = { .name = "ACRN Service OS", .kernel_type = KERNEL_BZIMAGE, + .bootargs = SOS_VM_BOOTARGS, }, .vuart[0] = { .type = VUART_LEGACY_PIO, diff --git a/hypervisor/scenarios/sdc/vm_configurations.h b/hypervisor/scenarios/sdc/vm_configurations.h index bba9515e3..7bb9a2d1c 100644 --- a/hypervisor/scenarios/sdc/vm_configurations.h +++ b/hypervisor/scenarios/sdc/vm_configurations.h @@ -7,11 +7,25 @@ #ifndef VM_CONFIGURATIONS_H #define VM_CONFIGURATIONS_H +#include + #define CONFIG_MAX_VM_NUM 2U /* Bits mask of guest flags that can be programmed by device model. Other bits are set by hypervisor only */ #define DM_OWNED_GUEST_FLAG_MASK (GUEST_FLAG_SECURE_WORLD_ENABLED | GUEST_FLAG_LAPIC_PASSTHROUGH | \ GUEST_FLAG_RT | GUEST_FLAG_IO_COMPLETION_POLLING) +#define SOS_VM_BOOTARGS SOS_ROOTFS \ + "rw rootwait " \ + "console=tty0 " \ + SOS_CONSOLE \ + "consoleblank=0 " \ + "no_timer_check " \ + "quiet loglevel=3 " \ + "i915.nuclear_pageflip=1 " \ + "i915.avail_planes_per_pipe=0x01010F " \ + "i915.domain_plane_owners=0x011111110000 " \ + "i915.enable_gvt=1 " \ + SOS_BOOTARGS_DIFF #endif /* VM_CONFIGURATIONS_H */