DM: Add new parameter --rtvm for soft/hard real-time guest

This patch add one new parameter --rtvm to indicate if the guest is a RTVM or not.
For RTVM, it may be not interference by SOS.

Tracked-On: #2865
Signed-off-by: Kaige Fu <kaige.fu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Kaige Fu 2019-04-02 20:46:51 +00:00 committed by wenlingz
parent 336ed72250
commit 469ce711c5
3 changed files with 14 additions and 1 deletions

View File

@ -88,6 +88,7 @@ uint8_t trusty_enabled;
char *mac_seed;
bool stdio_in_use;
bool lapic_pt;
bool is_rtvm;
bool skip_pci_mem64bar_workaround = false;
static int virtio_msix = 1;
@ -172,7 +173,8 @@ usage(int code)
" its params: threshold/s,probe-period(s),delay_time(ms),delay_duration(ms)\n"
" --virtio_poll: enable virtio poll mode with poll interval with ns\n"
" --vtpm2: Virtual TPM2 args: sock_path=$PATH_OF_SWTPM_SOCKET\n"
" --lapic_pt: enable local apic passthrough\n",
" --lapic_pt: enable local apic passthrough\n"
" --rtvm: indicate that the guest is rtvm\n",
progname, (int)strnlen(progname, PATH_MAX), "", (int)strnlen(progname, PATH_MAX), "",
(int)strnlen(progname, PATH_MAX), "", (int)strnlen(progname, PATH_MAX), "",
(int)strnlen(progname, PATH_MAX), "", (int)strnlen(progname, PATH_MAX), "");
@ -708,6 +710,7 @@ enum {
CMD_OPT_INTR_MONITOR,
CMD_OPT_VTPM2,
CMD_OPT_LAPIC_PT,
CMD_OPT_RTVM,
};
static struct option long_options[] = {
@ -747,6 +750,7 @@ static struct option long_options[] = {
{"intr_monitor", required_argument, 0, CMD_OPT_INTR_MONITOR},
{"vtpm2", required_argument, 0, CMD_OPT_VTPM2},
{"lapic_pt", no_argument, 0, CMD_OPT_LAPIC_PT},
{"rtvm", no_argument, 0, CMD_OPT_RTVM},
{0, 0, 0, 0 },
};
@ -894,6 +898,9 @@ dm_run(int argc, char *argv[])
case CMD_OPT_LAPIC_PT:
lapic_pt = true;
break;
case CMD_OPT_RTVM:
is_rtvm = true;
break;
case CMD_OPT_VTPM2:
if (acrn_parse_vtpm2(optarg) != 0) {
errx(EX_USAGE, "invalid vtpm2 param %s", optarg);

View File

@ -149,6 +149,11 @@ vm_create(const char *name, uint64_t req_buf)
create_vm.vm_flag &= (~GUEST_FLAG_IO_COMPLETION_POLLING);
}
if (is_rtvm) {
create_vm.vm_flag |= GUEST_FLAG_RT;
create_vm.vm_flag |= GUEST_FLAG_IO_COMPLETION_POLLING;
}
create_vm.req_buf = req_buf;
while (retry > 0) {
error = ioctl(ctx->fd, IC_CREATE_VM, &create_vm);

View File

@ -46,6 +46,7 @@ extern char *vmname;
extern bool stdio_in_use;
extern char *mac_seed;
extern bool lapic_pt;
extern bool is_rtvm;
int vmexit_task_switch(struct vmctx *ctx, struct vhm_request *vhm_req,
int *vcpu);