HV: Defining the per-vm static vpci table for partition hypervisor

V4:
- Renamed members for struct pcibar
- License header fix
- Added vpci_vdev_array to struct vm_description

V3:
 - Defined the static centralized vpci table to reduce code size,
   previously many of the settings are obtained/generated dynamically

Reviewed-by: Anthony Xu <anthony.xu@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
Signed-off-by: dongshen <dongsheng.x.zhang@intel.com>
This commit is contained in:
dongshen
2018-08-07 17:50:42 -07:00
committed by lijinxia
parent 2b22e88b51
commit f60fcb6b16
3 changed files with 235 additions and 0 deletions

View File

@@ -10,6 +10,7 @@
#ifdef CONFIG_PARTITION_MODE
#include <mptable.h>
#include <vpci.h>
#endif
enum vm_privilege_level {
VM_PRIVILEGE_LEVEL_HIGH = 0,
@@ -164,9 +165,17 @@ struct vm {
struct vcpuid_entry vcpuid_entries[MAX_VM_VCPUID_ENTRIES];
#ifdef CONFIG_PARTITION_MODE
struct vm_description *vm_desc;
struct vpci vpci;
#endif
};
#ifdef CONFIG_PARTITION_MODE
struct vpci_vdev_array {
int num_pci_vdev;
struct pci_vdev vpci_vdev_list[];
};
#endif
struct vm_description {
/* The physical CPU IDs associated with this VM - The first CPU listed
* will be the VM's BSP
@@ -180,6 +189,7 @@ struct vm_description {
uint8_t vm_id;
struct mptable_info *mptable;
const char *bootargs;
struct vpci_vdev_array *vpci_vdev_array;
#endif
};
@@ -195,6 +205,10 @@ int prepare_vm(uint16_t pcpu_id);
void vm_fixup(struct vm *vm);
#endif
#ifdef CONFIG_PARTITION_MODE
const struct vm_description_array *get_vm_desc_base(void);
#endif
struct vm *get_vm_from_vmid(uint16_t vm_id);
extern struct list_head vm_list;