mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-19 12:12:16 +00:00
hv: ptirq: Shouldn't change sid if intx irq mapping was added
Now, we use hash table to maintain intx irq mapping by using the key generated from sid. So once the entry is added,we can not update source ide any more. Otherwise, we can't locate the entry with the key generated from new source ide. For source id change, remove_remapping/add_remapping is used instead of update source id directly if entry was added already. Tracked-On: #5640 Signed-off-by: Yin Fengwei <fengwei.yin@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
parent
8aebf5526f
commit
ef411d4ac3
@ -715,9 +715,17 @@ int32_t ptirq_intx_pin_remap(struct acrn_vm *vm, uint32_t virt_gsi, enum intx_ct
|
||||
|
||||
entry = find_ptirq_entry(PTDEV_INTR_INTX, &alt_virt_sid, vm);
|
||||
if (entry != NULL) {
|
||||
entry->virt_sid.value = virt_sid.value;
|
||||
uint32_t phys_gsi = virt_gsi;
|
||||
|
||||
remove_intx_remapping(vm, alt_virt_sid.intx_id.gsi,
|
||||
alt_virt_sid.intx_id.ctlr);
|
||||
entry = add_intx_remapping(vm, virt_gsi, phys_gsi, vgsi_ctlr);
|
||||
if (entry == NULL) {
|
||||
pr_err("%s, add intx remapping failed", __func__);
|
||||
status = -ENODEV;
|
||||
} else {
|
||||
dev_dbg(DBG_LEVEL_IRQ,
|
||||
"IOAPIC gsi=%hhu pirq=%u vgsi=%d switch from %s to %s for vm%d",
|
||||
"IOAPIC gsi=%hhu pirq=%u vgsi=%d from %s to %s for vm%d",
|
||||
entry->phys_sid.intx_id.gsi,
|
||||
entry->allocated_pirq, entry->virt_sid.intx_id.gsi,
|
||||
(vgsi_ctlr == INTX_CTLR_IOAPIC) ? "vPIC" : "vIOAPIC",
|
||||
@ -725,6 +733,7 @@ int32_t ptirq_intx_pin_remap(struct acrn_vm *vm, uint32_t virt_gsi, enum intx_ct
|
||||
entry->vm->vm_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* entry could be updated by above switch check */
|
||||
if (entry == NULL) {
|
||||
|
Loading…
Reference in New Issue
Block a user