mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-21 00:38:28 +00:00
hv: vpci: hv: vpci: refine pci device assignment logic
Now Host Bridge and PCI Bridge could only be added to SOS's acrn_vm_pci_dev_config. So For UOS, we always emualte Host Bridge and PCI Bridge for it and assign PCI device to it; for SOS, if it's the highest severity VM, we will assign Host Bridge and PCI Bridge to it directly, otherwise, we will emulate them same as UOS. Tracked-On: #4550 Signed-off-by: Li Fei1 <fei1.li@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -138,15 +138,12 @@ bool is_pi_capable(const struct acrn_vm *vm)
|
||||
return (platform_caps.pi && (!is_lapic_pt_configured(vm)));
|
||||
}
|
||||
|
||||
static struct acrn_vm *get_highest_severity_vm(void)
|
||||
struct acrn_vm *get_highest_severity_vm(bool runtime)
|
||||
{
|
||||
uint16_t vm_id, highest_vm_id = 0U;
|
||||
struct acrn_vm *vm = NULL;
|
||||
|
||||
for (vm_id = 1U; vm_id < CONFIG_MAX_VM_NUM; vm_id++) {
|
||||
vm = get_vm_from_vmid(vm_id);
|
||||
|
||||
if (is_poweroff_vm(vm)) {
|
||||
if (runtime && is_poweroff_vm(get_vm_from_vmid(vm_id))) {
|
||||
/* If vm is non-existed or shutdown, it's not highest severity VM */
|
||||
continue;
|
||||
}
|
||||
@@ -159,14 +156,6 @@ static struct acrn_vm *get_highest_severity_vm(void)
|
||||
return get_vm_from_vmid(highest_vm_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* @pre vm != NULL && vm_config != NULL && vm->vmid < CONFIG_MAX_VM_NUM
|
||||
*/
|
||||
bool is_highest_severity_vm(const struct acrn_vm *vm)
|
||||
{
|
||||
return (get_highest_severity_vm() == vm);
|
||||
}
|
||||
|
||||
/**
|
||||
* @pre vm != NULL && vm_config != NULL && vm->vmid < CONFIG_MAX_VM_NUM
|
||||
*/
|
||||
|
Reference in New Issue
Block a user