hv: emulate reset register 0xcf9 and 0x64

- post-launched RTVM: intercept both PIO ports so that hypervisor has a
  chance to set VM_POWERING_OFF flag.
- all other type of VMs: deny these 2 ports from guest access so that
  guests are not able to reset host.

Tracked-On: #2700
Signed-off-by: Zide Chen <zide.chen@intel.com>
Signed-off-by: Sainath Grandhi <sainath.grandhi@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Zide Chen
2019-05-08 22:34:32 -07:00
committed by wenlingz
parent 8ad0fd98a3
commit 9aa3fe646b
4 changed files with 102 additions and 2 deletions

View File

@@ -7,6 +7,7 @@
#ifndef VM_RESET_H_
#define VM_RESET_H_
void register_reset_port_handler(struct acrn_vm *vm);
void shutdown_vm_from_idle(uint16_t pcpu_id);
#endif /* VM_RESET_H_ */

View File

@@ -24,7 +24,9 @@
#define PM1B_CNT_PIO_IDX (PM1B_EVT_PIO_IDX + 1U)
#define RTC_PIO_IDX (PM1B_CNT_PIO_IDX + 1U)
#define VIRTUAL_PM1A_CNT_PIO_IDX (RTC_PIO_IDX + 1U)
#define EMUL_PIO_IDX_MAX (VIRTUAL_PM1A_CNT_PIO_IDX + 1U)
#define KB_PIO_IDX (VIRTUAL_PM1A_CNT_PIO_IDX + 1U)
#define CF9_PIO_IDX (KB_PIO_IDX + 1U)
#define EMUL_PIO_IDX_MAX (CF9_PIO_IDX + 1U)
/**
* @brief The handler of VM exits on I/O instructions