mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-06-06 09:06:30 +00:00
Use acrn_vm_pci_ptdev_config struct for PCI PT devices configuration in acrn_vm_config, the only needed configure item is PT devices's vBDF and pBDF info. When init PT devices, the BDF info will be stored in pci_vdevs[] of acrn_vm. With this patch, the previous vpci_vdev_array struct is not needed. Tracked-On: #2291 Signed-off-by: Victor Sun <victor.sun@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
46 lines
987 B
C
46 lines
987 B
C
/*
|
|
* Copyright (C) 2019 Intel Corporation. All rights reserved.
|
|
*
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
#include <hypervisor.h>
|
|
#include <partition_config.h>
|
|
|
|
#define INIT_VM_CONFIG(idx) \
|
|
{ \
|
|
.type = VM##idx##_CONFIG_TYPE, \
|
|
.name = VM##idx##_CONFIG_NAME, \
|
|
.pcpu_bitmap = VM##idx##_CONFIG_PCPU_BITMAP, \
|
|
.guest_flags = VM##idx##_CONFIG_FLAGS, \
|
|
.memory = { \
|
|
.start_hpa = VM##idx##_CONFIG_MEM_START_HPA, \
|
|
.size = VM##idx##_CONFIG_MEM_SIZE, \
|
|
}, \
|
|
.os_config = { \
|
|
.name = VM##idx##_CONFIG_OS_NAME, \
|
|
.bootargs = VM##idx##_CONFIG_OS_BOOTARGS, \
|
|
}, \
|
|
.vm_vuart = true, \
|
|
.pci_ptdev_num = VM##idx##_CONFIG_PCI_PTDEV_NUM, \
|
|
.pci_ptdevs = vm##idx##_pci_ptdevs, \
|
|
},
|
|
|
|
struct acrn_vm_config vm_configs[CONFIG_MAX_VM_NUM] __aligned(PAGE_SIZE) = {
|
|
#ifdef VM0_CONFIGURED
|
|
INIT_VM_CONFIG(0)
|
|
#endif
|
|
|
|
#ifdef VM1_CONFIGURED
|
|
INIT_VM_CONFIG(1)
|
|
#endif
|
|
|
|
#ifdef VM2_CONFIGURED
|
|
INIT_VM_CONFIG(2)
|
|
#endif
|
|
|
|
#ifdef VM3_CONFIGURED
|
|
INIT_VM_CONFIG(3)
|
|
#endif
|
|
};
|