hv: implement ivshmem device creation and destruction

For ivshmem vdev creation, the vdev vBDF, vBARs, shared memory region
name and size are set by device model. The shared memory name and size
must be same as the corresponding device configuration which is configured
by offline tool.

v3: add a comment to the vbar_base member of the acrn_vm_pci_dev_config
    structure that vbar_base is power-on default value

Tracked-On: #4853

Signed-off-by: Yuan Liu <yuan1.liu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Yuan Liu
2020-08-25 14:27:36 +08:00
committed by wenlingz
parent 8a34cf03ca
commit 6d0f0ebd8a
4 changed files with 69 additions and 4 deletions

View File

@@ -20,6 +20,7 @@
#include <logmsg.h>
#include <ioapic.h>
#include <mmio_dev.h>
#include <ivshmem.h>
#define DBG_LEVEL_HYCALL 6U
@@ -36,7 +37,11 @@ struct emul_dev_ops {
};
static struct emul_dev_ops emul_dev_ops_tbl[] = {
{0, NULL, NULL}, /* implemented in next patch */
#ifdef CONFIG_IVSHMEM_ENABLED
{(IVSHMEM_VENDOR_ID | (IVSHMEM_DEVICE_ID << 16U)), create_ivshmem_vdev , destroy_ivshmem_vdev},
#else
{(IVSHMEM_VENDOR_ID | (IVSHMEM_DEVICE_ID << 16U)), NULL, NULL},
#endif
};
bool is_hypercall_from_ring0(void)