From 2736b6c4cde180aaf49766bd83f9a15cec4fc09b Mon Sep 17 00:00:00 2001 From: Victor Sun Date: Thu, 15 Aug 2019 22:18:22 +0800 Subject: [PATCH] HV: add vCOM2 setting for hybrid and industry scenario The vCOM2 of each VM is designed for VM communication, one VM could send command or request to another VM through this channel. The feature will be used for system S3/S5 implementation. On Hybird scenario, vCOM2 of pre-launched VM will connect to vCOM2 of SOS_VM; On Industry scenario, vCOM2 of post-launched RTVM will connect to vCOM2 of SOS_VM. Tracked-On: #3602 Signed-off-by: Victor Sun Reviewed-by: Eddie Dong --- hypervisor/arch/x86/configs/apl-mrb/misc_cfg.h | 2 ++ hypervisor/arch/x86/configs/apl-up2/misc_cfg.h | 2 ++ hypervisor/arch/x86/configs/dnv-cb2/misc_cfg.h | 2 ++ hypervisor/arch/x86/configs/generic/misc_cfg.h | 2 ++ hypervisor/arch/x86/configs/nuc6cayh/misc_cfg.h | 2 ++ hypervisor/arch/x86/configs/nuc7i7dnb/misc_cfg.h | 2 ++ hypervisor/scenarios/hybrid/vm_configurations.c | 5 ++++- hypervisor/scenarios/industry/vm_configurations.c | 13 +++++++++---- 8 files changed, 25 insertions(+), 5 deletions(-) diff --git a/hypervisor/arch/x86/configs/apl-mrb/misc_cfg.h b/hypervisor/arch/x86/configs/apl-mrb/misc_cfg.h index 573e56224..008252422 100644 --- a/hypervisor/arch/x86/configs/apl-mrb/misc_cfg.h +++ b/hypervisor/arch/x86/configs/apl-mrb/misc_cfg.h @@ -14,6 +14,8 @@ #define SOS_CONSOLE "console=ttyS2 " #define SOS_COM1_BASE 0x3E8U #define SOS_COM1_IRQ 6U +#define SOS_COM2_BASE 0x3F8U +#define SOS_COM2_IRQ 10U #ifndef CONFIG_RELEASE #define BOOTARG_DEBUG "hvlog=2M@0x6de00000 " \ diff --git a/hypervisor/arch/x86/configs/apl-up2/misc_cfg.h b/hypervisor/arch/x86/configs/apl-up2/misc_cfg.h index e3caf81e1..dee3505e4 100644 --- a/hypervisor/arch/x86/configs/apl-up2/misc_cfg.h +++ b/hypervisor/arch/x86/configs/apl-up2/misc_cfg.h @@ -14,6 +14,8 @@ #define SOS_CONSOLE "console=ttyS0 " #define SOS_COM1_BASE 0x3F8U #define SOS_COM1_IRQ 4U +#define SOS_COM2_BASE 0x2F8U +#define SOS_COM2_IRQ 3U #ifndef CONFIG_RELEASE #define BOOTARG_DEBUG "hvlog=2M@0x6de00000 " \ diff --git a/hypervisor/arch/x86/configs/dnv-cb2/misc_cfg.h b/hypervisor/arch/x86/configs/dnv-cb2/misc_cfg.h index e191d476f..09fa89b6d 100644 --- a/hypervisor/arch/x86/configs/dnv-cb2/misc_cfg.h +++ b/hypervisor/arch/x86/configs/dnv-cb2/misc_cfg.h @@ -13,6 +13,8 @@ #define SOS_CONSOLE "console=ttyS0 " #define SOS_COM1_BASE 0x3F8U #define SOS_COM1_IRQ 4U +#define SOS_COM2_BASE 0x2F8U +#define SOS_COM2_IRQ 3U #ifndef CONFIG_RELEASE #define SOS_BOOTARGS_DIFF "hvlog=2M@0x1FE00000" diff --git a/hypervisor/arch/x86/configs/generic/misc_cfg.h b/hypervisor/arch/x86/configs/generic/misc_cfg.h index 36ccda658..437ec0b81 100644 --- a/hypervisor/arch/x86/configs/generic/misc_cfg.h +++ b/hypervisor/arch/x86/configs/generic/misc_cfg.h @@ -14,6 +14,8 @@ #define SOS_CONSOLE "console=ttyS0 " #define SOS_COM1_BASE 0x3F8U #define SOS_COM1_IRQ 4U +#define SOS_COM2_BASE 0x2F8U +#define SOS_COM2_IRQ 3U #ifndef CONFIG_RELEASE #define SOS_BOOTARGS_DIFF "hvlog=2M@0x1FE00000" diff --git a/hypervisor/arch/x86/configs/nuc6cayh/misc_cfg.h b/hypervisor/arch/x86/configs/nuc6cayh/misc_cfg.h index e191d476f..09fa89b6d 100644 --- a/hypervisor/arch/x86/configs/nuc6cayh/misc_cfg.h +++ b/hypervisor/arch/x86/configs/nuc6cayh/misc_cfg.h @@ -13,6 +13,8 @@ #define SOS_CONSOLE "console=ttyS0 " #define SOS_COM1_BASE 0x3F8U #define SOS_COM1_IRQ 4U +#define SOS_COM2_BASE 0x2F8U +#define SOS_COM2_IRQ 3U #ifndef CONFIG_RELEASE #define SOS_BOOTARGS_DIFF "hvlog=2M@0x1FE00000" diff --git a/hypervisor/arch/x86/configs/nuc7i7dnb/misc_cfg.h b/hypervisor/arch/x86/configs/nuc7i7dnb/misc_cfg.h index ba909de4a..63ffbf941 100644 --- a/hypervisor/arch/x86/configs/nuc7i7dnb/misc_cfg.h +++ b/hypervisor/arch/x86/configs/nuc7i7dnb/misc_cfg.h @@ -14,6 +14,8 @@ #define SOS_CONSOLE "console=ttyS0 " #define SOS_COM1_BASE 0x3F8U #define SOS_COM1_IRQ 4U +#define SOS_COM2_BASE 0x2F8U +#define SOS_COM2_IRQ 3U #ifndef CONFIG_RELEASE #define SOS_BOOTARGS_DIFF "hvlog=2M@0x1FE00000" diff --git a/hypervisor/scenarios/hybrid/vm_configurations.c b/hypervisor/scenarios/hybrid/vm_configurations.c index 9dbb55558..b040e1b93 100644 --- a/hypervisor/scenarios/hybrid/vm_configurations.c +++ b/hypervisor/scenarios/hybrid/vm_configurations.c @@ -69,7 +69,10 @@ struct acrn_vm_config vm_configs[CONFIG_MAX_VM_NUM] = { }, .vuart[1] = { .type = VUART_LEGACY_PIO, - .addr.port_base = INVALID_COM_BASE, + .addr.port_base = SOS_COM2_BASE, + .irq = SOS_COM2_IRQ, + .t_vuart.vm_id = 0U, + .t_vuart.vuart_id = 1U, }, .pci_dev_num = SOS_EMULATED_PCI_DEV_NUM, .pci_devs = sos_pci_devs, diff --git a/hypervisor/scenarios/industry/vm_configurations.c b/hypervisor/scenarios/industry/vm_configurations.c index 68f249d56..f50b5aa41 100644 --- a/hypervisor/scenarios/industry/vm_configurations.c +++ b/hypervisor/scenarios/industry/vm_configurations.c @@ -34,7 +34,10 @@ struct acrn_vm_config vm_configs[CONFIG_MAX_VM_NUM] = { }, .vuart[1] = { .type = VUART_LEGACY_PIO, - .addr.port_base = INVALID_COM_BASE, + .addr.port_base = SOS_COM2_BASE, + .irq = SOS_COM2_IRQ, + .t_vuart.vm_id = 2U, + .t_vuart.vuart_id = 1U, }, .pci_dev_num = SOS_EMULATED_PCI_DEV_NUM, .pci_devs = sos_pci_devs, @@ -70,9 +73,11 @@ struct acrn_vm_config vm_configs[CONFIG_MAX_VM_NUM] = { }, .vuart[1] = { .type = VUART_LEGACY_PIO, - .addr.port_base = INVALID_COM_BASE, - } - + .addr.port_base = COM2_BASE, + .irq = COM2_IRQ, + .t_vuart.vm_id = 0U, + .t_vuart.vuart_id = 1U, + }, }, { .load_order = POST_LAUNCHED_VM,