hv: mmio_dev: add hypercall to support mmio device pass through

Add two hypercalls to support MMIO device pass through for post-launched VM.
And when we support MMIO pass through for pre-launched VM, we could re-use
the code in mmio_dev.c

Tracked-On: #5053
Signed-off-by: Li Fei1 <fei1.li@intel.com>
This commit is contained in:
Li Fei1
2020-07-16 13:45:06 +08:00
committed by wenlingz
parent 5034087a4f
commit baf77a79ad
7 changed files with 184 additions and 0 deletions

View File

@@ -66,6 +66,8 @@
#define HC_RESET_PTDEV_INTR_INFO BASE_HC_ID(HC_ID, HC_ID_PCI_BASE + 0x04UL)
#define HC_ASSIGN_PCIDEV BASE_HC_ID(HC_ID, HC_ID_PCI_BASE + 0x05UL)
#define HC_DEASSIGN_PCIDEV BASE_HC_ID(HC_ID, HC_ID_PCI_BASE + 0x06UL)
#define HC_ASSIGN_MMIODEV BASE_HC_ID(HC_ID, HC_ID_PCI_BASE + 0x07UL)
#define HC_DEASSIGN_MMIODEV BASE_HC_ID(HC_ID, HC_ID_PCI_BASE + 0x08UL)
/* DEBUG */
#define HC_ID_DBG_BASE 0x60UL
@@ -300,6 +302,26 @@ struct acrn_assign_pcidev {
} __attribute__((aligned(8)));
/**
* @brief Info to assign or deassign a MMIO device for a VM
*
* the parameter for HC_ASSIGN_MMIODEV or HC_DEASSIGN_MMIODEV hypercall
*/
struct acrn_mmiodev {
/** the gpa of the MMIO region for the MMIO device */
uint64_t base_gpa;
/** the hpa of the MMIO region for the MMIO device */
uint64_t base_hpa;
/** the size of the MMIO region for the MMIO device */
uint64_t size;
/** reserved for extension */
uint64_t reserved[13];
} __attribute__((aligned(8)));
/**
* Hypervisor api version info, return it for HC_GET_API_VERSION hypercall
*/