From 43d7eb5d76bff0393632ef108212523c2a7b69a1 Mon Sep 17 00:00:00 2001 From: dongshen Date: Thu, 22 Oct 2020 15:42:00 -0700 Subject: [PATCH] hv: fix out-of-date comments related to pre-launched VMs rebooting Like post-launched VMs, for pre-launched VMs, the ACPI reset register is also fixed at 0xcf9 and the reset value is 0xE, so pre-launched VMs now also use ACPI reset register for rebooting. Tracked-On: #5411 Signed-off-by: dongshen --- hypervisor/arch/x86/guest/vm_reset.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/hypervisor/arch/x86/guest/vm_reset.c b/hypervisor/arch/x86/guest/vm_reset.c index dd5b30568..bf9a72156 100644 --- a/hypervisor/arch/x86/guest/vm_reset.c +++ b/hypervisor/arch/x86/guest/vm_reset.c @@ -117,9 +117,9 @@ static bool handle_common_reset_reg_write(struct acrn_vcpu *vcpu, bool reset) ret = false; } /* - * ignore writes from SOS and pre-launched VM. - * equivalent to hide this port from guests. - */ + * ignore writes from SOS and pre-launched VM. + * equivalent to hide this port from guests. + */ } put_vm_lock(vm); @@ -211,12 +211,11 @@ void register_reset_port_handler(struct acrn_vm *vm) io_range.base = 0x64U; register_pio_emulation_handler(vm, KB_PIO_IDX, &io_range, handle_kb_read, handle_kb_write); + /* ACPI reset register is fixed at 0xcf9 for post-launched and pre-launched VMs */ io_range.base = 0xcf9U; register_pio_emulation_handler(vm, CF9_PIO_IDX, &io_range, handle_reset_reg_read, handle_cf9_write); /* - * - pre-launched VMs don't support ACPI; - * - ACPI reset register is fixed at 0xcf9 for post-launched VMs; * - here is taking care of SOS only: * Don't support MMIO or PCI based reset register for now. * ACPI Spec: Register_Bit_Width must be 8 and Register_Bit_Offset must be 0.