hv: add support for shutdown for pre-launched VMs

Currently, ACRN only support shutdown when triple fault happens, because ACRN
doesn't present/emulate a virtual HW, i.e. port IO, to support shutdown. This
patch emulate a virtual shutdown component, and the vACPI method for guest OS
to use.

Pre-launched VM uses ACPI reduced HW mode, intercept the virtual sleep control/status
registers for pre-launched VMs shutdown

Tracked-On: #5411
Signed-off-by: dongshen <dongsheng.x.zhang@intel.com>
This commit is contained in:
dongshen
2020-10-22 16:06:16 -07:00
committed by wenlingz
parent 8f79ceefbd
commit ca5683f78d
3 changed files with 88 additions and 6 deletions

View File

@@ -27,8 +27,8 @@
#define KB_PIO_IDX (VIRTUAL_PM1A_CNT_PIO_IDX + 1U)
#define CF9_PIO_IDX (KB_PIO_IDX + 1U)
#define PIO_RESET_REG_IDX (CF9_PIO_IDX + 1U)
#define EMUL_PIO_IDX_MAX (PIO_RESET_REG_IDX + 1U)
#define SLEEP_CTL_PIO_IDX (PIO_RESET_REG_IDX + 1U)
#define EMUL_PIO_IDX_MAX (SLEEP_CTL_PIO_IDX + 1U)
/**
* @brief The handler of VM exits on I/O instructions
*