mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-08-13 22:06:49 +00:00
dm: bug fix & code refine
1. Fix the bug that RTVM may fail to launch when its allocated memory is too little and makes use of pSRAM. Now we added an assert to inform users to allocate enough memory for RTVM. 2. Refined some codes. Tracked-On: #5330 Signed-off-by: Qian Wang <qian1.wang@intel.com>
This commit is contained in:
parent
793b99e3f6
commit
78f42ca16b
@ -145,7 +145,7 @@ usage(int code)
|
||||
" %*s [--vtpm2 sock_path] [--virtio_poll interval] [--mac_seed seed_string]\n"
|
||||
" %*s [--vmcfg sub_options] [--dump vm_idx] [--debugexit] \n"
|
||||
" %*s [--logger-setting param_setting] [--pm_notify_channel]\n"
|
||||
" %*s [--psram psram_size]\n"
|
||||
" %*s [--psram]\n"
|
||||
" %*s [--pm_by_vuart vuart_node] <vm>\n"
|
||||
" -A: create ACPI tables\n"
|
||||
" -B: bootargs for kernel\n"
|
||||
@ -168,7 +168,7 @@ usage(int code)
|
||||
" --dump: show build-in VM configurations\n"
|
||||
#endif
|
||||
" --vsbl: vsbl file path\n"
|
||||
" --psram: <psram_size in MB> Allocate pSRAM of psram_size MB for this VM. This VM must be an RTVM\n"
|
||||
" --psram: Enable support for pSRAM for this VM. This VM must be an RTVM\n"
|
||||
" --ovmf: ovmf file path\n"
|
||||
" --cpu_affinity: list of pCPUs assigned to this VM\n"
|
||||
" --part_info: guest partition info file path\n"
|
||||
@ -794,7 +794,7 @@ static struct option long_options[] = {
|
||||
{"vtpm2", required_argument, 0, CMD_OPT_VTPM2},
|
||||
{"lapic_pt", no_argument, 0, CMD_OPT_LAPIC_PT},
|
||||
{"rtvm", no_argument, 0, CMD_OPT_RTVM},
|
||||
{"psram", no_argument, 0, CMD_OPT_PSRAM}, /* TODO: Need argument*/
|
||||
{"psram", no_argument, 0, CMD_OPT_PSRAM},
|
||||
{"logger_setting", required_argument, 0, CMD_OPT_LOGGER_SETTING},
|
||||
{"pm_notify_channel", required_argument, 0, CMD_OPT_PM_NOTIFY_CHANNEL},
|
||||
{"pm_by_vuart", required_argument, 0, CMD_OPT_PM_BY_VUART},
|
||||
@ -939,6 +939,7 @@ main(int argc, char *argv[])
|
||||
is_rtvm = true;
|
||||
break;
|
||||
case CMD_OPT_PSRAM:
|
||||
/* TODO: we need to support parameter to specify pSRAM size in the future */
|
||||
pt_ptct = true;
|
||||
break;
|
||||
case CMD_OPT_ACPIDEV_PT:
|
||||
|
@ -271,7 +271,10 @@ acrn_create_e820_table(struct vmctx *ctx, struct e820_entry *e820)
|
||||
/* Fix-Me: e820[LOWRAM_E820_ENTRY+2] can be used as RAM
|
||||
only when ctx->lowmem is higher than PSRAM area.
|
||||
also, the length should be adjusted to ctx->lowmem-baseaddr */
|
||||
/* TODO: this is a temporary workaround. needs further refine to remove the >=2G restriction */
|
||||
assert(ctx->lowmem >= 2 * GB);
|
||||
e820[LOWRAM_E820_ENTRY+2].type = E820_TYPE_RAM;
|
||||
|
||||
}
|
||||
|
||||
/* remove [5GB, highmem) if it's empty */
|
||||
|
@ -1093,8 +1093,9 @@ int create_and_inject_vptct(struct vmctx *ctx)
|
||||
.type = VM_MMIO,
|
||||
.gpa = PSRAM_BASE_GPA,
|
||||
.hpa = PSRAM_BASE_HPA,
|
||||
/* TODO: the .len should be set as the psram_size passed-in via the DM argument "psram <psram_size>"*/
|
||||
.len = 0x208000UL,
|
||||
/* Extra 32 KB is for PTCM binary image*/
|
||||
/* TODO: .len should be psram_size+32kb. we need to modify guest E820 to adapt to real config */
|
||||
.len = 0x400000U + 32 * KB,
|
||||
.prot = PROT_ALL
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user