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

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


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Jason Andryuk <jason.andryuk@xxxxxxx>
  • Date: Fri, 5 Sep 2025 16:34:32 -0400
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=suse.com 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=yXR19HnIZvKmkNP3t9Sh2qCcg+esTHU0+stLKmvAasM=; b=FZQ8wnGc5z3t4BxZWfHKX5x50XJvSlYejtAvsJVyw8GAMM+ffTs/PDrBoJq1rGXZAt0kOi2F24g4qeMqW2fOxRfuowTkas3xRSyy/xWWAWKeGRkCpv0kq4X9rs74zygY3QMQrafUfaoVLQkIQEQrd1IRXx3IaT3aWGSUjsAYxNFpXWhTauL4V/9pyV49eUMHFiBi+ZMG+llIIpwq5wghzNeVqENENSGYXQbdzIHHE3l3IB71/M44koyVWEYeGfk/lTS/K6w+xSDwp0pq6szKLIjDNVAsf9CySVF2QZL/JrhOEfD3tQmVIdS3lgoKyr5pOCgMypL2nYixvRwH3zyZOA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=chK6wPY/LmsWa33NJA5hoy5dryqTW5HjaIYVtmuFkJqWC3bg4fsA7dQBiOphIhgYqW/NrryuQiMFKsUPyaUwnO9qXimmUnk1RECHy+gkAKTeM5LmLC9EX2oifvAeAP9JafUDVAoaqfBzG4TFE3RqVOE5PAvOeA0Ca5Z8HliiAj9KAPH4hY7XQjCr7FdkAFTouaBcTy5ODS8JUUVvYn6IkVyqhVz6mkscoM3SXF7S/05KeNeO/vbUjdnFmtBwmZPpr7N3A0BwmINbDdLY4+VmDX2cN/H5PQa9Bm/pb+UT1LBkglJb39Yk4/uLX69qCy78l//VULw05sDcp8CxWIhJCQ==
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Fri, 05 Sep 2025 20:35:02 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 2025-09-05 03:39, Jan Beulich wrote:
On 04.09.2025 23:51, Jason Andryuk wrote:
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.

Well spotted, just that ...

--- 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;

... we shouldn't terminate the loop here, but rather continue with the next
entry in the list (if any). Hence presumably why "continue" was used, without
achieving the intended effect.

Ok, makes sense. Though after the sending the patch, I was wondering if it was an unreachable condition, and we should not end up here with pin == -1.

Thanks,
Jason



 


Rackspace

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