From c1d2499e5c8b62af9de1bd0c469048b7fcb0dd4e Mon Sep 17 00:00:00 2001 From: Zide Chen Date: Mon, 8 Oct 2018 17:38:14 -0700 Subject: [PATCH] hv: enable MSI remapping on vm0 When enabled, hypervisor will handle MSI/MSI-X remapping for SOS. Tracked-On: #1568 Signed-off-by: dongshen Signed-off-by: Zide Chen Reviewed-by: Li, Fei1 Acked-by: Anthony Xu --- hypervisor/Makefile | 8 ++++++-- hypervisor/arch/x86/guest/vm.c | 6 ++---- hypervisor/include/arch/x86/guest/vm.h | 4 ++-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/hypervisor/Makefile b/hypervisor/Makefile index adf4eccf1..b69863310 100644 --- a/hypervisor/Makefile +++ b/hypervisor/Makefile @@ -176,15 +176,19 @@ endif C_SRCS += dm/vpic.c C_SRCS += dm/vioapic.c -ifeq ($(CONFIG_PARTITION_MODE),y) -C_SRCS += $(wildcard partition/*.c) C_SRCS += dm/hw/pci.c C_SRCS += dm/vpci/core.c C_SRCS += dm/vpci/vpci.c +ifeq ($(CONFIG_PARTITION_MODE),y) +C_SRCS += $(wildcard partition/*.c) C_SRCS += dm/vpci/partition_mode.c C_SRCS += dm/vpci/hostbridge.c C_SRCS += dm/vpci/pci_pt.c C_SRCS += dm/vrtc.c +else +C_SRCS += dm/vpci/sharing_mode.c +C_SRCS += dm/vpci/msi.c +C_SRCS += dm/vpci/msix.c endif C_SRCS += bsp/$(CONFIG_PLATFORM)/$(CONFIG_PLATFORM).c diff --git a/hypervisor/arch/x86/guest/vm.c b/hypervisor/arch/x86/guest/vm.c index d902da6ad..fe37e26c2 100644 --- a/hypervisor/arch/x86/guest/vm.c +++ b/hypervisor/arch/x86/guest/vm.c @@ -152,9 +152,10 @@ int create_vm(struct vm_description *vm_desc, struct vm **rtn_vm) vuart_init(vm); } vrtc_init(vm); - vpci_init(vm); #endif + vpci_init(vm); + /* vpic wire_mode default is INTR */ vm->wire_mode = VPIC_WIRE_INTR; @@ -231,10 +232,7 @@ int shutdown_vm(struct vm *vm) free_vm_id(vm); #endif - -#ifdef CONFIG_PARTITION_MODE vpci_cleanup(vm); -#endif /* Return status to caller */ return status; diff --git a/hypervisor/include/arch/x86/guest/vm.h b/hypervisor/include/arch/x86/guest/vm.h index ff84101d7..0898931b2 100644 --- a/hypervisor/include/arch/x86/guest/vm.h +++ b/hypervisor/include/arch/x86/guest/vm.h @@ -7,10 +7,10 @@ #ifndef VM_H_ #define VM_H_ #include +#include #ifdef CONFIG_PARTITION_MODE #include -#include #endif enum vm_privilege_level { VM_PRIVILEGE_LEVEL_HIGH = 0, @@ -155,9 +155,9 @@ struct vm { uint32_t vcpuid_entry_nr, vcpuid_level, vcpuid_xlevel; struct vcpuid_entry vcpuid_entries[MAX_VM_VCPUID_ENTRIES]; + struct vpci vpci; #ifdef CONFIG_PARTITION_MODE struct vm_description *vm_desc; - struct vpci vpci; uint8_t vrtc_offset; #endif