From 47ff99fd64339bd801e38f2edef8af26b1529db9 Mon Sep 17 00:00:00 2001 From: Yuanyuan Zhao Date: Thu, 20 Jan 2022 02:28:14 +0000 Subject: [PATCH] dm: rtvm enable lapic_pt automatically Enable `lapic_pt` automatically for rtvm for better performance. Reserve `--lapic_pt` for future use. If VM is not in realtime mode, `--lapic_pt` will cause a warning. Tracked-On: #6690 Signed-off-by: Yuanyuan Zhao Acked-by: Wang, Yu1 --- devicemodel/core/main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/devicemodel/core/main.c b/devicemodel/core/main.c index cf1cc65df..1d1b581b5 100644 --- a/devicemodel/core/main.c +++ b/devicemodel/core/main.c @@ -932,10 +932,10 @@ main(int argc, char *argv[]) break; case CMD_OPT_LAPIC_PT: lapic_pt = true; - is_rtvm = true; break; case CMD_OPT_RTVM: is_rtvm = true; + lapic_pt = true; break; case CMD_OPT_SOFTWARE_SRAM: if (parse_vssram_buf_params(optarg) != 0) @@ -1003,6 +1003,10 @@ main(int argc, char *argv[]) usage(1); } + if (lapic_pt == true && is_rtvm == false) { + lapic_pt = false; + pr_warn("Only a Realtime VM can use local APIC pass through, '--lapic_pt' is invalid here.\n"); + } vmname = argv[0]; if (strnlen(vmname, MAX_VM_NAME_LEN) >= MAX_VM_NAME_LEN) {