hv: pirq: remove support of physical irq sharing

Because multiple physical devices sharing a single physical pin would be
assigned to a same VM, so UOS could handle the irq sharing. So that we could
remove the physical irq sharing support in HV.

This commit removes the irq sharing support, changes including:
 - removed the dev_list field in irq_desc, and clean up codes for the list
   operation;
 - replace IRQ_ASSIGNED_SHARED and IRQ_ASSIGNED_NOSHARE with IRQ_ASSIGNED;
 - remove argument indicating irq is shared;
 - revise irq request flow for pt devices to remove dependency on irq sharing:
   register irq on adding remapping entery and unregister irq on removal an
   entry, and do not register/unregister at remapping an entry.

Signed-off-by: Yan, Like <like.yan@intel.com>
Reviewed-by: Eddie Dong <eddie.dong@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
Yan, Like
2018-08-09 16:44:04 +08:00
committed by lijinxia
parent 6744a179fc
commit d773df9135
5 changed files with 62 additions and 132 deletions

View File

@@ -320,6 +320,9 @@ add_msix_remapping(struct vm *vm, uint16_t virt_bdf, uint16_t phys_bdf,
entry->virt_bdf = virt_bdf;
entry->phys_bdf = phys_bdf;
entry->ptdev_intr_info.msi.msix_entry_index = msix_entry_index;
/* update msi source and active entry */
ptdev_activate_entry(entry, IRQ_INVALID);
} else if (entry->vm != vm) {
if (is_vm0(entry->vm)) {
entry->vm = vm;
@@ -404,6 +407,9 @@ add_intx_remapping(struct vm *vm, uint8_t virt_pin,
entry->ptdev_intr_info.intx.phys_pin = phys_pin;
entry->ptdev_intr_info.intx.virt_pin = virt_pin;
entry->ptdev_intr_info.intx.vpin_src = vpin_src;
/* activate entry */
ptdev_activate_entry(entry, pin_to_irq(phys_pin));
} else if (entry->vm != vm) {
if (is_vm0(entry->vm)) {
entry->vm = vm;
@@ -661,15 +667,9 @@ int ptdev_msix_remap(struct vm *vm, uint16_t virt_bdf,
/* handle destroy case */
if (is_entry_active(entry) && (info->vmsi_data == 0U)) {
info->pmsi_data = 0U;
ptdev_deactivate_entry(entry);
goto END;
}
if (!is_entry_active(entry)) {
/* update msi source and active entry */
ptdev_activate_entry(entry, IRQ_INVALID);
}
/* build physical config MSI, update to info->pmsi_xxx */
ptdev_build_physical_msi(vm, info, dev_to_vector(entry->node));
entry->ptdev_intr_info.msi = *info;
@@ -829,7 +829,6 @@ int ptdev_intx_pin_remap(struct vm *vm, struct ptdev_intx_info *info)
if (need_switch_vpin_src) {
if (is_entry_active(entry)) {
GSI_MASK_IRQ(phys_irq);
ptdev_deactivate_entry(entry);
}
dev_dbg(ACRN_DBG_IRQ,
"IOAPIC pin=%hhu pirq=%u vpin=%d switch from %s to %s "
@@ -852,7 +851,6 @@ int ptdev_intx_pin_remap(struct vm *vm, struct ptdev_intx_info *info)
if (rte.u.lo_32 == 0x10000U) {
/* disable interrupt */
GSI_MASK_IRQ(phys_irq);
ptdev_deactivate_entry(entry);
dev_dbg(ACRN_DBG_IRQ,
"IOAPIC pin=%hhu pirq=%u deassigned ",
phys_pin, phys_irq);
@@ -871,9 +869,6 @@ int ptdev_intx_pin_remap(struct vm *vm, struct ptdev_intx_info *info)
*/
activate_physical_ioapic(vm, entry);
} else {
/* active entry */
ptdev_activate_entry(entry, phys_irq);
activate_physical_ioapic(vm, entry);
dev_dbg(ACRN_DBG_IRQ,