From a68dadb74a6035728744369e0572b09f8c311c78 Mon Sep 17 00:00:00 2001 From: "Li, Fei1" Date: Fri, 10 May 2019 07:33:50 +0800 Subject: [PATCH] hv: vm: minor fix about vRTC For prelaunched VM, Service OS and postlaunched RT VM, we only need the vRTC provides backed-up date, so we could use the simple vRTC which implemented in hypervisor. For postlaunched VM (which is not a RT VM), we needs the device module to emulate the vRTC for it. Tracked-On: #1842 Signed-off-by: Li, Fei1 Reviewed-by: Yu Wang --- hypervisor/arch/x86/guest/vm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hypervisor/arch/x86/guest/vm.c b/hypervisor/arch/x86/guest/vm.c index eb90bc387..d314004e0 100644 --- a/hypervisor/arch/x86/guest/vm.c +++ b/hypervisor/arch/x86/guest/vm.c @@ -417,7 +417,9 @@ int32_t create_vm(uint16_t vm_id, struct acrn_vm_config *vm_config, struct acrn_ /* Create virtual uart;*/ vuart_init(vm, vm_config->vuart); - vrtc_init(vm); + if (is_rt_vm(vm) || !is_postlaunched_vm(vm)) { + vrtc_init(vm); + } vpci_init(vm);