[PATCH v2 2/2] hv: move the MAX_VUART_NUM_PER_VM to offline tool


chenli.wei
 

Current code limit the MAX vUART number to 8 which is not enough for
Service VM which should config S5 UART for each user VM.

We could count how many vUARTs we need by offline tool, so remove the
define of MAX_VUART_NUM_PER_VM to offline tool is a simple and accurate
way to allocate vUARTs.

v1-->v2:
1.move the define of MAX_VUART_NUM_PER_VM to offline tool

Tracked-On: #8782
Signed-off-by: Chenli Wei <chenli.wei@...>
---
hypervisor/include/arch/x86/asm/vm_config.h | 1 -
1 file changed, 1 deletion(-)

diff --git a/hypervisor/include/arch/x86/asm/vm_config.h b/hypervisor/include/arch/x86/asm/vm_config.h
index d985d7081..7e58a88b5 100644
--- a/hypervisor/include/arch/x86/asm/vm_config.h
+++ b/hypervisor/include/arch/x86/asm/vm_config.h
@@ -18,7 +18,6 @@

#define AFFINITY_CPU(n) (1UL << (n))
#define MAX_VCPUS_PER_VM MAX_PCPU_NUM
-#define MAX_VUART_NUM_PER_VM 8U
#define MAX_VM_OS_NAME_LEN 32U
#define MAX_MOD_TAG_LEN 32U

--
2.17.1


Eddie Dong
 

SOS VM may need more vUARTs, but other VMs doesn't.

Do we want to stay with a fixed number?

-----Original Message-----
From: acrn-dev@... <acrn-dev@...> On
Behalf Of chenli.wei
Sent: Saturday, April 30, 2022 1:13 AM
To: Mao, Junjie <junjie.mao@...>; acrn-dev@...
Cc: Wei, Chenli <chenli.wei@...>
Subject: [acrn-dev] [PATCH v2 2/2] hv: move the
MAX_VUART_NUM_PER_VM to offline tool

Current code limit the MAX vUART number to 8 which is not enough for
Service VM which should config S5 UART for each user VM.

We could count how many vUARTs we need by offline tool, so remove the
define of MAX_VUART_NUM_PER_VM to offline tool is a simple and
accurate way to allocate vUARTs.

v1-->v2:
1.move the define of MAX_VUART_NUM_PER_VM to offline tool

Tracked-On: #8782
Signed-off-by: Chenli Wei <chenli.wei@...>
---
hypervisor/include/arch/x86/asm/vm_config.h | 1 -
1 file changed, 1 deletion(-)

diff --git a/hypervisor/include/arch/x86/asm/vm_config.h
b/hypervisor/include/arch/x86/asm/vm_config.h
index d985d7081..7e58a88b5 100644
--- a/hypervisor/include/arch/x86/asm/vm_config.h
+++ b/hypervisor/include/arch/x86/asm/vm_config.h
@@ -18,7 +18,6 @@

#define AFFINITY_CPU(n) (1UL << (n))
#define MAX_VCPUS_PER_VM MAX_PCPU_NUM
-#define MAX_VUART_NUM_PER_VM 8U
#define MAX_VM_OS_NAME_LEN 32U
#define MAX_MOD_TAG_LEN 32U

--
2.17.1





chenli.wei
 

On 5/3/2022 2:25 AM, Eddie Dong wrote:
SOS VM may need more vUARTs, but other VMs doesn't.

Do we want to stay with a fixed number?
Yes, this patch have not split the VUART NUM for each VM.

The vuart config is a very little struct and I try to use different proposals to split VUART NUM for each VM, but they all make the current code being too complex:

1.The "struct vuart_config vuart[MAX_VUART_NUM_PER_VM]" was define in the VM_Config which is a unified struct for all VMs.

2.There are more then one # depend on the MAX_VUART_NUM_PER_VM,

If we change MAX_VUART_NUM_PER_VM for each VM or dynamic parameter like "get_vuart_num()", all these values have to dynamically:

#define PM1A_ EVT_ PIO_ IDX (UART_PIO_IDX0 + MAX_VUART_NUM_PER_VM)
#define PM1A_ CNT_ PIO_ IDX (PM1A_EVT_PIO_IDX + 1U)
#define PM1B_ EVT_ PIO_ IDX (PM1A_CNT_PIO_IDX + 1U)
#define PM1B_ CNT_ PIO_ IDX (PM1B_EVT_PIO_IDX + 1U)
#define RTC_ PIO_ IDX (PM1B_CNT_PIO_IDX + 1U)
#define VIRTUAL_ PM1A_ CNT_ PIO_ IDX (RTC_PIO_IDX + 1U)
#define KB_ PIO_ IDX (VIRTUAL_PM1A_CNT_PIO_IDX + 1U)
#define CF9_ PIO_ IDX (KB_PIO_IDX + 1U)
#define PIO_ RESET_ REG_ IDX (CF9_PIO_IDX + 1U)
#define SLEEP_ CTL_ PIO_ IDX (PIO_RESET_REG_IDX + 1U)
#define EMUL_ PIO_ IDX_ MAX (SLEEP_CTL_PIO_IDX + 1U)

-----Original Message-----
From: acrn-dev@... <acrn-dev@...> On
Behalf Of chenli.wei
Sent: Saturday, April 30, 2022 1:13 AM
To: Mao, Junjie <junjie.mao@...>; acrn-dev@...
Cc: Wei, Chenli <chenli.wei@...>
Subject: [acrn-dev] [PATCH v2 2/2] hv: move the
MAX_VUART_NUM_PER_VM to offline tool

Current code limit the MAX vUART number to 8 which is not enough for
Service VM which should config S5 UART for each user VM.

We could count how many vUARTs we need by offline tool, so remove the
define of MAX_VUART_NUM_PER_VM to offline tool is a simple and
accurate way to allocate vUARTs.

v1-->v2:
1.move the define of MAX_VUART_NUM_PER_VM to offline tool

Tracked-On: #8782
Signed-off-by: Chenli Wei <chenli.wei@...>
---
hypervisor/include/arch/x86/asm/vm_config.h | 1 -
1 file changed, 1 deletion(-)

diff --git a/hypervisor/include/arch/x86/asm/vm_config.h
b/hypervisor/include/arch/x86/asm/vm_config.h
index d985d7081..7e58a88b5 100644
--- a/hypervisor/include/arch/x86/asm/vm_config.h
+++ b/hypervisor/include/arch/x86/asm/vm_config.h
@@ -18,7 +18,6 @@

#define AFFINITY_CPU(n) (1UL << (n))
#define MAX_VCPUS_PER_VM MAX_PCPU_NUM
-#define MAX_VUART_NUM_PER_VM 8U
#define MAX_VM_OS_NAME_LEN 32U
#define MAX_MOD_TAG_LEN 32U

--
2.17.1