arch/x86: PCIE MSI address and data may be out of remapping

In fact, in case of VT-D being enabled, it will require to get an
address and data for its own MSI based interrupts which cannot be
remapped (i.e.: will directly go to the relevant APIC).

This is necessary to get the Fault event supported in VT-D.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This commit is contained in:
Tomasz Bursztyka 2021-01-06 21:16:24 +01:00 committed by Anas Nashif
commit 1012e254cc

View file

@ -187,15 +187,17 @@ uint32_t pcie_msi_map(unsigned int irq,
ARG_UNUSED(irq); ARG_UNUSED(irq);
#if defined(CONFIG_INTEL_VTD_ICTL) #if defined(CONFIG_INTEL_VTD_ICTL)
if (vector != NULL && n_vector > 0) {
return vtd_remap_msi(vtd, vector, n_vector); return vtd_remap_msi(vtd, vector, n_vector);
#else }
return 0xFEE00000U; /* standard delivery to BSP local APIC */
#endif #endif
return 0xFEE00000U; /* standard delivery to BSP local APIC */
} }
uint16_t pcie_msi_mdr(unsigned int irq, uint16_t pcie_msi_mdr(unsigned int irq,
msi_vector_t *vector) msi_vector_t *vector)
{ {
if (vector != NULL) {
if (IS_ENABLED(CONFIG_INTEL_VTD_ICTL)) { if (IS_ENABLED(CONFIG_INTEL_VTD_ICTL)) {
return 0; return 0;
} }
@ -205,6 +207,8 @@ uint16_t pcie_msi_mdr(unsigned int irq,
return 0x4000U | vector->arch.vector; return 0x4000U | vector->arch.vector;
} }
#endif #endif
}
return 0x4000U | Z_IRQ_TO_INTERRUPT_VECTOR(irq); return 0x4000U | Z_IRQ_TO_INTERRUPT_VECTOR(irq);
} }