hv: fill region ID to hv-land ivshmem PCI config space

1) region ID shall be configured by user via config tool.
   2) region ID is programmed to "Subsystem ID" of PCI config space.
   2) "Subsystem Vendor ID" is harded coded as 0x8086

Tracked-On: #8566
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
This commit is contained in:
Yonghua Huang 2024-03-10 23:46:50 +08:00 committed by acrnsi-robot
parent a7a6732580
commit ddfe218747
2 changed files with 7 additions and 0 deletions

View File

@ -329,6 +329,9 @@ static void init_ivshmem_bar(struct pci_vdev *vdev, uint32_t bar_idx)
static void init_ivshmem_vdev(struct pci_vdev *vdev)
{
struct acrn_vm_pci_dev_config *dev_config = vdev->pci_dev_config;
struct ivshmem_shm_region *region = find_shm_region(dev_config->shm_region_name);
create_ivshmem_device(vdev);
/* initialize ivshmem config */
@ -338,6 +341,9 @@ static void init_ivshmem_vdev(struct pci_vdev *vdev)
pci_vdev_write_vcfg(vdev, PCIR_CLASS, 1U, IVSHMEM_CLASS);
pci_vdev_write_vcfg(vdev, PCIR_HDRTYPE, 1U,
PCIM_HDRTYPE_NORMAL | ((vdev->bdf.bits.f == 0U) ? PCIM_MFDEV : 0U));
pci_vdev_write_vcfg(vdev, PCIV_SUB_VENDOR_ID, 2U, IVSHMEM_INTEL_SUBVENDOR_ID);
pci_vdev_write_vcfg(vdev, PCIV_SUB_SYSTEM_ID, 2U, region->region_id);
add_vmsix_capability(vdev, MAX_IVSHMEM_MSIX_TBL_ENTRY_NUM, IVSHMEM_MSIX_BAR);
/* initialize ivshmem bars */

View File

@ -9,6 +9,7 @@
#define IVSHMEM_VENDOR_ID 0x1af4U
#define IVSHMEM_DEVICE_ID 0x1110U
#define IVSHMEM_INTEL_SUBVENDOR_ID 0x8086U
#ifdef CONFIG_IVSHMEM_ENABLED
/*