From f838dbaaf96113f2a09d202901f45663e85510df Mon Sep 17 00:00:00 2001 From: Shuang Zheng Date: Wed, 16 Sep 2020 16:25:14 +0800 Subject: [PATCH] acrn-config: move source code of IVSHMEM region name to ivshmem_cfg.h move MACRO of IVSHMEM region name to ivshmem_cfg.h and bug fix that avoids multiple declarations of mem_regions in ivshmem_cfg.h Tracked-On: #4853 Signed-off-by: Shuang Zheng Acked-by: Victor Sun --- .../hybrid_rt/ehl-crb-b/ivshmem_cfg.h | 13 ++- .../scenarios/hybrid_rt/ehl-crb-b/pci_dev.c | 2 +- .../scenarios/hybrid_rt/vm_configurations.h | 2 +- .../hybrid_rt/whl-ipc-i5/ivshmem_cfg.h | 8 +- .../scenarios/hybrid_rt/whl-ipc-i5/pci_dev.c | 2 +- .../hybrid_rt/whl-ipc-i7/ivshmem_cfg.h | 13 ++- .../scenarios/hybrid_rt/whl-ipc-i7/pci_dev.c | 2 +- .../scenarios/industry/vm_configurations.c | 79 +++++++++++++++++++ .../scenarios/industry/vm_configurations.h | 4 +- 9 files changed, 101 insertions(+), 24 deletions(-) diff --git a/misc/vm_configs/scenarios/hybrid_rt/ehl-crb-b/ivshmem_cfg.h b/misc/vm_configs/scenarios/hybrid_rt/ehl-crb-b/ivshmem_cfg.h index 3a91f92ff..3104f28d8 100644 --- a/misc/vm_configs/scenarios/hybrid_rt/ehl-crb-b/ivshmem_cfg.h +++ b/misc/vm_configs/scenarios/hybrid_rt/ehl-crb-b/ivshmem_cfg.h @@ -8,7 +8,8 @@ #include #include -#include + +#define IVSHMEM_SHM_REGION_0 "hv:/shm_region_0" /* * The IVSHMEM_SHM_SIZE is the sum of all memory regions. @@ -18,12 +19,10 @@ #define IVSHMEM_DEV_NUM 2UL /* All user defined memory regions */ - -struct ivshmem_shm_region mem_regions[] = { - { - .name = IVSHMEM_SHM_REGION_0, - .size = 0x200000UL, /* 2M */ +#define IVSHMEM_SHM_REGIONS \ + { \ + .name = IVSHMEM_SHM_REGION_0, \ + .size = 0x200000UL, /* 2M */ \ }, -}; #endif /* IVSHMEM_CFG_H */ diff --git a/misc/vm_configs/scenarios/hybrid_rt/ehl-crb-b/pci_dev.c b/misc/vm_configs/scenarios/hybrid_rt/ehl-crb-b/pci_dev.c index a6f6e2be5..3a10600a8 100644 --- a/misc/vm_configs/scenarios/hybrid_rt/ehl-crb-b/pci_dev.c +++ b/misc/vm_configs/scenarios/hybrid_rt/ehl-crb-b/pci_dev.c @@ -10,7 +10,7 @@ #include #include #include -#include +#include /* * TODO: remove PTDEV macro and add DEV_PRIVINFO macro to initialize pbdf for diff --git a/misc/vm_configs/scenarios/hybrid_rt/vm_configurations.h b/misc/vm_configs/scenarios/hybrid_rt/vm_configurations.h index f2363ffd1..a177a9ae6 100644 --- a/misc/vm_configs/scenarios/hybrid_rt/vm_configurations.h +++ b/misc/vm_configs/scenarios/hybrid_rt/vm_configurations.h @@ -23,7 +23,7 @@ GUEST_FLAG_RT | GUEST_FLAG_IO_COMPLETION_POLLING) #define VM0_CONFIG_MEM_START_HPA 0x100000000UL -#define VM0_CONFIG_MEM_SIZE 0x40000000UL +#define VM0_CONFIG_MEM_SIZE 0xC0000000UL #define VM0_CONFIG_MEM_START_HPA2 0x0UL #define VM0_CONFIG_MEM_SIZE_HPA2 0x0UL diff --git a/misc/vm_configs/scenarios/hybrid_rt/whl-ipc-i5/ivshmem_cfg.h b/misc/vm_configs/scenarios/hybrid_rt/whl-ipc-i5/ivshmem_cfg.h index 734c8801c..3104f28d8 100644 --- a/misc/vm_configs/scenarios/hybrid_rt/whl-ipc-i5/ivshmem_cfg.h +++ b/misc/vm_configs/scenarios/hybrid_rt/whl-ipc-i5/ivshmem_cfg.h @@ -8,7 +8,8 @@ #include #include -#include + +#define IVSHMEM_SHM_REGION_0 "hv:/shm_region_0" /* * The IVSHMEM_SHM_SIZE is the sum of all memory regions. @@ -18,11 +19,10 @@ #define IVSHMEM_DEV_NUM 2UL /* All user defined memory regions */ - #define IVSHMEM_SHM_REGIONS \ { \ - .name = IVSHMEM_SHM_REGION_0,\ - .size = 0x200000UL, /* 2MB */\ + .name = IVSHMEM_SHM_REGION_0, \ + .size = 0x200000UL, /* 2M */ \ }, #endif /* IVSHMEM_CFG_H */ diff --git a/misc/vm_configs/scenarios/hybrid_rt/whl-ipc-i5/pci_dev.c b/misc/vm_configs/scenarios/hybrid_rt/whl-ipc-i5/pci_dev.c index a9cde5724..3cba194db 100644 --- a/misc/vm_configs/scenarios/hybrid_rt/whl-ipc-i5/pci_dev.c +++ b/misc/vm_configs/scenarios/hybrid_rt/whl-ipc-i5/pci_dev.c @@ -10,7 +10,7 @@ #include #include #include -#include +#include /* * TODO: remove PTDEV macro and add DEV_PRIVINFO macro to initialize pbdf for diff --git a/misc/vm_configs/scenarios/hybrid_rt/whl-ipc-i7/ivshmem_cfg.h b/misc/vm_configs/scenarios/hybrid_rt/whl-ipc-i7/ivshmem_cfg.h index 3a91f92ff..3104f28d8 100644 --- a/misc/vm_configs/scenarios/hybrid_rt/whl-ipc-i7/ivshmem_cfg.h +++ b/misc/vm_configs/scenarios/hybrid_rt/whl-ipc-i7/ivshmem_cfg.h @@ -8,7 +8,8 @@ #include #include -#include + +#define IVSHMEM_SHM_REGION_0 "hv:/shm_region_0" /* * The IVSHMEM_SHM_SIZE is the sum of all memory regions. @@ -18,12 +19,10 @@ #define IVSHMEM_DEV_NUM 2UL /* All user defined memory regions */ - -struct ivshmem_shm_region mem_regions[] = { - { - .name = IVSHMEM_SHM_REGION_0, - .size = 0x200000UL, /* 2M */ +#define IVSHMEM_SHM_REGIONS \ + { \ + .name = IVSHMEM_SHM_REGION_0, \ + .size = 0x200000UL, /* 2M */ \ }, -}; #endif /* IVSHMEM_CFG_H */ diff --git a/misc/vm_configs/scenarios/hybrid_rt/whl-ipc-i7/pci_dev.c b/misc/vm_configs/scenarios/hybrid_rt/whl-ipc-i7/pci_dev.c index a9cde5724..3cba194db 100644 --- a/misc/vm_configs/scenarios/hybrid_rt/whl-ipc-i7/pci_dev.c +++ b/misc/vm_configs/scenarios/hybrid_rt/whl-ipc-i7/pci_dev.c @@ -10,7 +10,7 @@ #include #include #include -#include +#include /* * TODO: remove PTDEV macro and add DEV_PRIVINFO macro to initialize pbdf for diff --git a/misc/vm_configs/scenarios/industry/vm_configurations.c b/misc/vm_configs/scenarios/industry/vm_configurations.c index 9418f9f1b..5105d5051 100644 --- a/misc/vm_configs/scenarios/industry/vm_configurations.c +++ b/misc/vm_configs/scenarios/industry/vm_configurations.c @@ -78,4 +78,83 @@ struct acrn_vm_config vm_configs[CONFIG_MAX_VM_NUM] = { .t_vuart.vuart_id = 1U, }, }, + { /* VM3 */ + CONFIG_POST_STD_VM(2), +#ifdef CONFIG_RDT_ENABLED + .clos = VM3_VCPU_CLOS, +#endif + .cpu_affinity = VM3_CONFIG_CPU_AFFINITY, + .vuart[0] = { + .type = VUART_LEGACY_PIO, + .addr.port_base = COM1_BASE, + .irq = COM1_IRQ, + }, + .vuart[1] = { + .type = VUART_LEGACY_PIO, + .addr.port_base = INVALID_COM_BASE, + }, + }, + { /* VM4 */ + CONFIG_POST_STD_VM(3), +#ifdef CONFIG_RDT_ENABLED + .clos = VM4_VCPU_CLOS, +#endif + .cpu_affinity = VM4_CONFIG_CPU_AFFINITY, + .vuart[0] = { + .type = VUART_LEGACY_PIO, + .addr.port_base = COM1_BASE, + .irq = COM1_IRQ, + }, + .vuart[1] = { + .type = VUART_LEGACY_PIO, + .addr.port_base = INVALID_COM_BASE, + }, + }, + { /* VM5 */ + CONFIG_POST_STD_VM(4), +#ifdef CONFIG_RDT_ENABLED + .clos = VM5_VCPU_CLOS, +#endif + .cpu_affinity = VM5_CONFIG_CPU_AFFINITY, + .vuart[0] = { + .type = VUART_LEGACY_PIO, + .addr.port_base = COM1_BASE, + .irq = COM1_IRQ, + }, + .vuart[1] = { + .type = VUART_LEGACY_PIO, + .addr.port_base = INVALID_COM_BASE, + }, + }, + { /* VM6 */ + CONFIG_POST_STD_VM(5), +#ifdef CONFIG_RDT_ENABLED + .clos = VM6_VCPU_CLOS, +#endif + .cpu_affinity = VM6_CONFIG_CPU_AFFINITY, + .vuart[0] = { + .type = VUART_LEGACY_PIO, + .addr.port_base = COM1_BASE, + .irq = COM1_IRQ, + }, + .vuart[1] = { + .type = VUART_LEGACY_PIO, + .addr.port_base = INVALID_COM_BASE, + }, + }, + { /* VM7 */ + CONFIG_KATA_VM(1), +#ifdef CONFIG_RDT_ENABLED + .clos = VM7_VCPU_CLOS, +#endif + .cpu_affinity = VM7_CONFIG_CPU_AFFINITY, + .vuart[0] = { + .type = VUART_LEGACY_PIO, + .addr.port_base = INVALID_COM_BASE, + }, + .vuart[1] = { + .type = VUART_LEGACY_PIO, + .addr.port_base = INVALID_COM_BASE, + }, + }, }; diff --git a/misc/vm_configs/scenarios/industry/vm_configurations.h b/misc/vm_configs/scenarios/industry/vm_configurations.h index 49e71f829..088f63373 100644 --- a/misc/vm_configs/scenarios/industry/vm_configurations.h +++ b/misc/vm_configs/scenarios/industry/vm_configurations.h @@ -15,8 +15,8 @@ */ #define PRE_VM_NUM 0U #define SOS_VM_NUM 1U -#define MAX_POST_VM_NUM 2U -#define CONFIG_MAX_KATA_VM_NUM 0U +#define MAX_POST_VM_NUM 7U +#define CONFIG_MAX_KATA_VM_NUM 1U /* Bits mask of guest flags that can be programmed by device model. Other bits are set by hypervisor only */ #define DM_OWNED_GUEST_FLAG_MASK (GUEST_FLAG_SECURE_WORLD_ENABLED | GUEST_FLAG_LAPIC_PASSTHROUGH | \