hv: vm_config: build pci device configure for SOS

Align SOS pci device configure with pre-launched VM and filter pre-launched VM's
PCI PT device from SOS pci device configure.

Tracked-On: #3475
Signed-off-by: Li, Fei1 <fei1.li@intel.com>
This commit is contained in:
Li, Fei1
2019-08-02 08:17:02 +08:00
committed by ACRN System Integration
parent adbaaaf6cb
commit eb21f205e4
11 changed files with 112 additions and 9 deletions

View File

@@ -0,0 +1,17 @@
/*
* Copyright (C) 2019 Intel Corporation. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef PCI_DEV_H_
#define PCI_DEV_H_
#include <vpci.h>
struct acrn_vm_config;
void fill_pci_dev_config(struct pci_pdev *pdev);
void initialize_sos_pci_dev_config(struct acrn_vm_config *vm_config);
#endif /* PCI_DEV_H_ */

View File

@@ -20,6 +20,10 @@
#define MAX_VM_OS_NAME_LEN 32U
#define MAX_MOD_TAG_LEN 32U
#define PCI_DEV_TYPE_PTDEV (1U << 0U)
#define PCI_DEV_TYPE_HVEMUL (1U << 1U)
#define PCI_DEV_TYPE_SOSEMUL (1U << 2U)
/*
* PRE_LAUNCHED_VM is launched by ACRN hypervisor, with LAPIC_PT;
* SOS_VM is launched by ACRN hypervisor, without LAPIC_PT;
@@ -79,9 +83,11 @@ struct acrn_vm_os_config {
} __aligned(8);
struct acrn_vm_pci_dev_config {
uint32_t emu_type; /* the type how the device is emulated. */
union pci_bdf vbdf; /* virtual BDF of PCI device */
union pci_bdf pbdf; /* physical BDF of PCI device */
uint64_t vbar_base[PCI_BAR_COUNT]; /* vbar base address of PCI device */
struct pci_pdev *pdev; /* the physical PCI device if it's a PT device */
} __aligned(8);
struct acrn_vm_config {