[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] x86/apic: Avoid infinite loop in io_apic_level_ack_pending()


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jason Andryuk <jason.andryuk@xxxxxxx>
  • Date: Thu, 4 Sep 2025 17:51:37 -0400
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=02vFATc04fcvMY/aHiuyddySZsR9XJNjuJlXKYQkPow=; b=WDuozskEZwU/GAeZ9Z7KLMKURvTsqeR21Pb3lKYiVfbQho5QJ4SRO8LxHMvIjUDYp0NnPjLKiUnZuM3jSkvAzsomo2P/6fGXfEb1UnvrWKsbkRRpnkxEe8ukwwfqi546yGeOsALiIk3mvIhEikKjyCBflfgK612Ks8muVKUxMp2cgLxFoB/Ob6mZljOkMEYZMKMT9vr5Xga99I0Jw4AcCBZGViBVFpVqye7Aa3wUT5AoOXIQAsSxzK9eKzKhu6msqT08g43/jOhaAx2e6lJZ8a/JDl+ObbYdyfd+huGK5smYzjsM/AeeEOfcai7cKKi/TDxHsEjBtxi/CxX+U07wRw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=I4v23K34jSdDo+Z1EeNzPUuflJHL4PKh6/ZjgawiYBc31yS4nauZtETFBeuahCj3SqXsuWdr2Wu7WDnxLjDNwVzUoWsDQ4bI89XxPnFs6knjeek7dqKefzwn2PqdH7hbwfBeYNXJMJL5OWcNboSVAd8vTj0gPl0OPpk4wXPdM13j8867Ve8h/5Nuq4IVCgKT19QEbeTzV9nc2D/kUcGIaYpDEJsBe5ZVT89NF8as3Bu4YjoOwpDrrfDdLZKp0OOYl2ljndyI1Yeloh7jxucZpMWfWi8J095xdmsS1zZ8/zUTeR7B+rw2kLzPlGUEYimYmG2gHbkYw/7MVrddt7+lZQ==
  • Cc: Jason Andryuk <jason.andryuk@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Thu, 04 Sep 2025 21:52:02 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

io_apic_level_ack_pending() will end up in an infinite loop if
entry->pin == -1.  entry does not change, so it will keep reading -1.

Switched to breaking out of the loop.

Fixes: f821102450a1 ("x86: IRQ Migration logic enhancement.")
Signed-off-by: Jason Andryuk <jason.andryuk@xxxxxxx>
---
Noticed during code inspection.
---
 xen/arch/x86/io_apic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
index 17e6827f4b..b21f0515f5 100644
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -1715,7 +1715,7 @@ static bool io_apic_level_ack_pending(unsigned int irq)
 
         pin = entry->pin;
         if (pin == -1)
-            continue;
+            break;
         reg = io_apic_read(entry->apic, 0x10 + pin*2);
         /* Is the remote IRR bit set? */
         if (reg & IO_APIC_REDIR_REMOTE_IRR) {
-- 
2.51.0




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.