hv: Avoid run-time buffer overflows with IOAPIC data structures

Remove couple of run-time ASSERTs in ioapic module by checking for the
number of interrupt pins per IO-APICs against the configured MAX_IOAPIC_LINES
in the initialization flow.
Also remove the need for two MACROs specifying the max. number of
interrupt lines per IO-APIC and add a config item MAX_IOAPIC_LINES for the
same.

Tracked-On: #3299
Signed-off-by: Sainath Grandhi <sainath.grandhi@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Sainath Grandhi
2019-06-18 13:35:05 -07:00
committed by ACRN System Integration
parent c1e23f1a4a
commit 0a8bf6cee4
3 changed files with 61 additions and 28 deletions

View File

@@ -13,9 +13,10 @@
#define NR_LEGACY_PIN NR_LEGACY_IRQ
struct ioapic_info {
uint8_t id;
uint32_t addr;
uint32_t gsi_base;
uint8_t id; /* IOAPIC ID as indicated in ACPI MADT */
uint32_t addr; /* IOAPIC Register address */
uint32_t gsi_base; /* Global System Interrupt where this IO-APIC's interrupt input start */
uint32_t nr_pins; /* Number of Interrupt inputs as determined by Max. Redir Entry Register */
};
void ioapic_setup_irqs(void);