From d1c61a8e70422d746c3096821bb479b2014248f0 Mon Sep 17 00:00:00 2001 From: Arthur Heymans Date: Thu, 8 Dec 2022 14:25:11 +0100 Subject: arch/x86/ioapic.c: Increase the number of bits for ioapic ID MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In practice hardware can use larger numbers. Change-Id: I6e9ddd1ebd396c37e25eb3019f981d45d9c5e062 Signed-off-by: Arthur Heymans Reviewed-on: https://review.coreboot.org/c/coreboot/+/70499 Tested-by: build bot (Jenkins) Reviewed-by: Naresh Solanki Reviewed-by: Kyösti Mälkki --- src/arch/x86/ioapic.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/arch/x86/ioapic.c b/src/arch/x86/ioapic.c index 84a4c7f7bc..04c852b4c2 100644 --- a/src/arch/x86/ioapic.c +++ b/src/arch/x86/ioapic.c @@ -147,7 +147,12 @@ static void set_ioapic_id(void *ioapic_base, u8 ioapic_id) u8 get_ioapic_id(void *ioapic_base) { - return (io_apic_read(ioapic_base, 0x00) >> 24) & 0x0f; + /* + * According to 82093AA I/O ADVANCED PROGRAMMABLE INTERRUPT CONTROLLER (IOAPIC) + * only 4 bits (24:27) are used for the ID. In practice the upper bits are either + * always 0 or used for larger IDs. + */ + return (io_apic_read(ioapic_base, 0x00) >> 24) & 0xff; } u8 get_ioapic_version(void *ioapic_base) -- cgit v1.2.1