From c545baaf476016c1c136c3c88214c3c4252d4059 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Sun, 6 Jun 2021 06:19:15 +0300 Subject: arch/x86/ioapic: Clear vector table first MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Always clear vector 0 entry before optionally overwriting it with the i8259 timer redirection. Change-Id: Ia2e96f43e6494711f9fc4fd74229f5817b04b48d Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/c/coreboot/+/55286 Reviewed-by: Angel Pons Reviewed-by: Furquan Shaikh Tested-by: build bot (Jenkins) --- src/arch/x86/ioapic.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/arch/x86/ioapic.c b/src/arch/x86/ioapic.c index d2f65fdaf3..a11e5dd9b3 100644 --- a/src/arch/x86/ioapic.c +++ b/src/arch/x86/ioapic.c @@ -138,17 +138,11 @@ void ioapic_set_boot_config(void *ioapic_base, bool irq_on_fsb) void setup_ioapic_helper(void *ioapic_base, u8 ioapic_id, bool enable_virtual_wire) { - int first = 0, last; - set_ioapic_id(ioapic_base, ioapic_id); + clear_ioapic(ioapic_base); - if (enable_virtual_wire) { + if (enable_virtual_wire) route_i8259_irq0(ioapic_base); - first = 1; - } - - last = ioapic_interrupt_count(ioapic_base) - 1; - clear_vectors(ioapic_base, first, last); } -- cgit v1.2.3