Skip to content

Commit b2c2ca2

Browse files
fyin1lijinxia
authored andcommitted
hv: not necessary to deal with '\n' of cmdline in ACRN.
We removed '\n' in bootargs file so there is no '\n' attached to cmdline when stitching ACRN. Then we don't need to deal with it in ACRN. Signed-off-by: Yin Fengwei <fengwei.yin@intel.com> Acked-by: Eddie Dong <Eddie.dong@intel.com>
1 parent 198f200 commit b2c2ca2

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

hypervisor/boot/sbl/multiboot.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ static void parse_other_modules(struct vm *vm,
9595
vm->sw.linux_info.bootargs_src_addr = load_addr;
9696
}
9797

98-
strcpy_s(load_addr + args_size - 1,
98+
strcpy_s(load_addr + args_size,
9999
100, dyn_bootargs);
100100
vm->sw.linux_info.bootargs_size =
101101
strnlen_s(load_addr, MEM_2K);

hypervisor/common/vm_load.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -190,12 +190,11 @@ int general_sw_loader(struct vm *vm, struct vcpu *vcpu)
190190
#ifdef CONFIG_CMA
191191
/* add "cma=XXXXM@0xXXXXXXXX" to cmdline*/
192192
if (is_vm0(vm) && (e820_mem.max_ram_blk_size > 0)) {
193-
snprintf(dyn_bootargs, 100, " cma=%dM@0x%llx\n",
193+
snprintf(dyn_bootargs, 100, " cma=%dM@0x%llx",
194194
(e820_mem.max_ram_blk_size >> 20),
195195
e820_mem.max_ram_blk_base);
196-
/* Delete '\n' at the end of cmdline */
197196
strcpy_s((char *)hva
198-
+vm->sw.linux_info.bootargs_size - 1,
197+
+vm->sw.linux_info.bootargs_size,
199198
100, dyn_bootargs);
200199
}
201200
#else
@@ -215,11 +214,10 @@ int general_sw_loader(struct vm *vm, struct vcpu *vcpu)
215214
#endif
216215
if (reserving_1g_pages > 0) {
217216
snprintf(dyn_bootargs, 100,
218-
" hugepagesz=1G hugepages=%d\n",
217+
" hugepagesz=1G hugepages=%d",
219218
reserving_1g_pages);
220-
/* Delete '\n' at the end of cmdline */
221219
strcpy_s((char *)hva
222-
+vm->sw.linux_info.bootargs_size - 1,
220+
+vm->sw.linux_info.bootargs_size,
223221
100, dyn_bootargs);
224222
}
225223
}

0 commit comments

Comments
 (0)