mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-22 13:37:10 +00:00
DM: Decouple and increase kernel boot args length
Currently, we use STR_LEN for all checking the size of all the acrn-dm parameters. But some parameters like kernel boot args can grow based on different needs. For example, when kata launches guest VM using acrn, the kernel boot args increases by 256 bytes (i.e 1024 +256). Just increasing STR_LEN will unnecessarily increase allocations for other acrn-dm parameters. So decoupling only boot_args length and increasing it to 2048. PS: If other parameters like ramdisk path, kernel path, elf_path etc. don't need 1024 bytes, we can reduce STR_LEN to 256 or 512 bytes. Tracked-On: #3138 Signed-off-by: Vijay Dhanraj <vijay.dhanraj@intel.com> Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
parent
f2fe35472b
commit
f010f99d67
@ -36,7 +36,7 @@
|
||||
#include "pci_core.h"
|
||||
|
||||
int with_bootargs;
|
||||
static char bootargs[STR_LEN];
|
||||
static char bootargs[BOOT_ARG_LEN];
|
||||
|
||||
/*
|
||||
* Default e820 mem map:
|
||||
@ -106,9 +106,9 @@ const struct e820_entry e820_default_entries[NUM_E820_ENTRIES] = {
|
||||
int
|
||||
acrn_parse_bootargs(char *arg)
|
||||
{
|
||||
size_t len = strnlen(arg, STR_LEN);
|
||||
size_t len = strnlen(arg, BOOT_ARG_LEN);
|
||||
|
||||
if (len < STR_LEN) {
|
||||
if (len < BOOT_ARG_LEN) {
|
||||
strncpy(bootargs, arg, len + 1);
|
||||
with_bootargs = 1;
|
||||
printf("SW_LOAD: get bootargs %s\n", bootargs);
|
||||
|
@ -29,6 +29,7 @@
|
||||
#define _CORE_SW_LOAD_
|
||||
|
||||
#define STR_LEN 1024
|
||||
#define BOOT_ARG_LEN 2048
|
||||
|
||||
/* E820 memory types */
|
||||
#define E820_TYPE_RAM 1 /* EFI 1, 2, 3, 4, 5, 6, 7 */
|
||||
|
Loading…
Reference in New Issue
Block a user