If IOAPIC has PCI binding, match the PCI device against MADT enumerated IOAPIC. Match is done first by registers window phys address, then by IOAPIC ID.
When calculating rid for remapping interrupts sourced from the IOAPIC, first try to get the PCI rid, otherwise use rid as specified in the DMAR scope entry (i.e. the only current way to get rid for IOAPIC).