From a7a673258077ab0b918c1120deaa050c87348f69 Mon Sep 17 00:00:00 2001 From: Yonghua Huang Date: Sun, 17 Mar 2024 21:25:55 +0800 Subject: [PATCH] config_tools: support IVSHMEM devices region ID configuration This patch adds ivshmem region ID configuration support when user configure ACRN IVSHMEM devices via ACRN config tool, this ID provides VMs with a stable identification of multiple shared memory regions. Also add logic to generate launch script with region ID configured as below: `add_virtual_device 8 ivshmem hv:/shm_region_0,256,1` Tracked-On: #8566 Signed-off-by: Kunhui-Li Signed-off-by: Yonghua Huang Reviewed-by: Junjie Mao --- hypervisor/include/dm/ivshmem.h | 2 ++ .../ConfigForm/CustomWidget/IVSHMEM_REGION.vue | 16 ++++++++++++++++ misc/config_tools/schema/types.xsd | 5 +++++ misc/config_tools/xforms/ivshmem_cfg.h.xsl | 2 ++ 4 files changed, 25 insertions(+) diff --git a/hypervisor/include/dm/ivshmem.h b/hypervisor/include/dm/ivshmem.h index 520d01551..776f2400e 100644 --- a/hypervisor/include/dm/ivshmem.h +++ b/hypervisor/include/dm/ivshmem.h @@ -21,6 +21,8 @@ #define MAX_IVSHMEM_MSIX_TBL_ENTRY_NUM 8U struct ivshmem_shm_region { char name[32]; + uint16_t region_id; + uint8_t reserved[6]; uint64_t hpa; uint64_t size; struct ivshmem_device *doorbell_peers[MAX_IVSHMEM_PEER_NUM]; diff --git a/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/IVSHMEM_REGION.vue b/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/IVSHMEM_REGION.vue index ba22f59ee..a2e02ad22 100644 --- a/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/IVSHMEM_REGION.vue +++ b/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/IVSHMEM_REGION.vue @@ -55,6 +55,22 @@ + + + + + + + + +
Shared VMs

Select all VMs that will use this shared memory region

diff --git a/misc/config_tools/schema/types.xsd b/misc/config_tools/schema/types.xsd index 808c6d68f..94be5c620 100644 --- a/misc/config_tools/schema/types.xsd +++ b/misc/config_tools/schema/types.xsd @@ -286,6 +286,11 @@ in megabytes. The value should be a power of 2 and no more than 512. + + + A stable identification when multiple shared memory regions are provided. + + Select all VMs that use the shared memory region. diff --git a/misc/config_tools/xforms/ivshmem_cfg.h.xsl b/misc/config_tools/xforms/ivshmem_cfg.h.xsl index 97ec6697c..63f973847 100644 --- a/misc/config_tools/xforms/ivshmem_cfg.h.xsl +++ b/misc/config_tools/xforms/ivshmem_cfg.h.xsl @@ -64,9 +64,11 @@ + { \ +