From 4a4dea622da80b65b34f5d9715c3ebc4040904c9 Mon Sep 17 00:00:00 2001 From: Pawel Wieczorkiewicz Date: Tue, 24 Nov 2020 18:22:36 +0100 Subject: [PATCH] apic: no delivery status flag in ICR for X2APIC In X2APIC mode there is no delivery status flag in ICR, hence there is no need to read ICR at all. Signed-off-by: Pawel Wieczorkiewicz --- include/arch/x86/apic.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/arch/x86/apic.h b/include/arch/x86/apic.h index 20119ea8..5bdc87f2 100644 --- a/include/arch/x86/apic.h +++ b/include/arch/x86/apic.h @@ -484,8 +484,12 @@ static inline void *apic_get_base(apic_base_t apic_base) { } static inline void apic_wait_ready(void) { + apic_mode_t mode = apic_get_mode(); apic_icr_t icr; + if (mode == APIC_MODE_X2APIC) + return; + do { icr = apic_icr_read(); if (icr.deliv_status == APIC_DELIV_STATUS_IDLE)