hv: Use Interrupt Remapping format for programming interrupt sources

When a corresponding IOMMU is found for the device, this patch adds
support to program Interrupt Remapping hardware RTEs and the original
interrupt sources (MSI or IOAPIC) with IR format.

Tracked-On: #2426
Signed-off-by: Sainath Grandhi <sainath.grandhi@intel.com>
Reviewed-by: Binbin Wu <binbin.wu@intel.com>
This commit is contained in:
Sainath Grandhi
2019-01-15 12:51:25 -08:00
committed by Eddie Dong
parent 7104f0a512
commit 970821462b
9 changed files with 350 additions and 25 deletions

View File

@@ -9,6 +9,7 @@
#include <acpi.h>
#define IOAPIC_MAX_PIN 240U
#define IOAPIC_INVALID_ID 0xFFU
/*
* IOAPIC_MAX_LINES is architecturally defined.
@@ -370,6 +371,19 @@ ioapic_nr_pins(void *ioapic_base)
return nr_pins;
}
uint8_t ioapic_irq_to_ioapic_id(uint32_t irq)
{
uint8_t ret;
if (ioapic_irq_is_gsi(irq)) {
ret = gsi_table_data[irq].ioapic_id;
} else {
ret = IOAPIC_INVALID_ID;
}
return ret;
}
int32_t init_ioapic_id_info(void)
{
int32_t ret = 0;