@@ -365,16 +365,18 @@ static void ptdev_build_physical_msi(struct vm *vm, struct ptdev_msi_info *info,
365
365
}
366
366
367
367
static uint64_t ptdev_build_physical_rte (struct vm * vm ,
368
- struct ptdev_intx_info * info , int vector )
368
+ struct ptdev_remapping_info * entry )
369
369
{
370
370
uint64_t rte ;
371
+ int phys_irq = dev_to_irq (entry -> node );
372
+ int vector = dev_to_vector (entry -> node );
371
373
372
- if (info -> vpin_src == PTDEV_VPIN_IOAPIC ) {
374
+ if (entry -> intx . vpin_src == PTDEV_VPIN_IOAPIC ) {
373
375
uint64_t vdmask , pdmask ;
374
376
uint32_t dest , low , high , delmode ;
375
377
bool phys ;
376
378
377
- vioapic_get_rte (vm , info -> virt_pin , & rte );
379
+ vioapic_get_rte (vm , entry -> intx . virt_pin , & rte );
378
380
low = rte ;
379
381
high = rte >> 32 ;
380
382
@@ -406,14 +408,13 @@ static uint64_t ptdev_build_physical_rte(struct vm *vm,
406
408
rte = rte << 32 | low ;
407
409
} else {
408
410
enum vpic_trigger trigger ;
409
- int phys_irq = pin_to_irq (info -> phys_pin );
410
411
uint64_t physical_rte ;
411
412
412
413
/* just update trigger mode */
413
414
ioapic_get_rte (phys_irq , & physical_rte );
414
415
rte = physical_rte ;
415
416
rte &= ~IOAPIC_RTE_TRGRMOD ;
416
- vpic_get_irq_trigger (vm , info -> virt_pin , & trigger );
417
+ vpic_get_irq_trigger (vm , entry -> intx . virt_pin , & trigger );
417
418
if (trigger == LEVEL_TRIGGER )
418
419
rte |= IOAPIC_RTE_TRGRLVL ;
419
420
@@ -729,17 +730,16 @@ static bool vpin_masked(struct vm *vm, uint8_t virt_pin,
729
730
}
730
731
731
732
static void activate_physical_ioapic (struct vm * vm ,
732
- struct ptdev_intx_info * info ,
733
- struct ptdev_remapping_info * entry , int phys_irq )
733
+ struct ptdev_remapping_info * entry )
734
734
{
735
735
uint64_t rte ;
736
+ int phys_irq = dev_to_irq (entry -> node );
736
737
737
738
/* disable interrupt */
738
739
GSI_MASK_IRQ (phys_irq );
739
740
740
741
/* build physical IOAPIC RTE, update to info->rte */
741
- rte = ptdev_build_physical_rte (vm , info ,
742
- dev_to_vector (entry -> node ));
742
+ rte = ptdev_build_physical_rte (vm , entry );
743
743
744
744
/* set rte entry */
745
745
GSI_SET_RTE (phys_irq , rte | IOAPIC_RTE_INTMSET );
@@ -824,14 +824,14 @@ int ptdev_intx_pin_remap(struct vm *vm, struct ptdev_intx_info *info)
824
824
goto END ;
825
825
} else {
826
826
/*update rte*/
827
- activate_physical_ioapic (vm , info , entry , phys_irq );
827
+ activate_physical_ioapic (vm , entry );
828
828
}
829
829
} else if (entry_is_active (entry )
830
830
&& info -> vpin_src == PTDEV_VPIN_PIC ) {
831
831
/* only update here
832
832
* deactive vPIC entry when IOAPIC take it over
833
833
*/
834
- activate_physical_ioapic (vm , info , entry , phys_irq );
834
+ activate_physical_ioapic (vm , entry );
835
835
} else {
836
836
/*
837
837
* both vIOAPIC & vPIC take physical IOAPIC path
@@ -844,7 +844,7 @@ int ptdev_intx_pin_remap(struct vm *vm, struct ptdev_intx_info *info)
844
844
/* active entry */
845
845
ptdev_activate_entry (entry , phys_irq , lowpri );
846
846
847
- activate_physical_ioapic (vm , info , entry , phys_irq );
847
+ activate_physical_ioapic (vm , entry );
848
848
849
849
dev_dbg (ACRN_DBG_IRQ ,
850
850
"IOAPIC pin=%d pirq=%d assigned to vm%d %s vpin=%d" ,
0 commit comments