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

[PATCH v3 20/28] i8259.c: properly cascade secondary i8259 from primary i8259


  • To: pbonzini@xxxxxxxxxx, richard.henderson@xxxxxxxxxx, mst@xxxxxxxxxx, sstabellini@xxxxxxxxxx, anthony@xxxxxxxxxxxxxx, edgar.iglesias@xxxxxxxxx, qemu-devel@xxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Mark Cave-Ayland <mark.caveayland@xxxxxxxxxxx>
  • Date: Mon, 19 Oct 2026 13:04:52 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nutanix.com; dmarc=pass action=none header.from=nutanix.com; dkim=pass header.d=nutanix.com; arc=none
  • 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=uIP/FNzxgTNq6IxC5pZ5ECWrlTbe9ctn/rT0opm86Ng=; b=WXqxq7Pa/TnQugITwhFcSlYnzr10SaT2pLhTtJel3bjRV7zX4M17czWIJqcJ7rjdpjv8NpSbxmC3KnYGgFhWfIhMiQBFSzH4/GF6UL/ENTnbB2vVZjrtX5OxtJaUXOd2/7FkVEBGBQmSxn/hmJVofDmK+VooCDL0iKHX02+XkK7sop8P6PhAUH2zXepWv3r0Av6qryZePEX56vGeeXZ+IzWopH7T1f5KaGMqk49GALQ8tKgN6h5oc2KmU6cRatgiSUTVoyeZkV8I76nxl0cRcWMBBBotwPUUTHxg7Ou6oxX1iYpJPcTSbLrMscDhvgB9+azjJbdwcGC+Y8/J6qrlyw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=tl1Cbbeh14uyKMREhbaZrlHjD1ZeRtKG38T/D63+6y5jI+eGDxrYsnQOGKu6CtYnWREPU48y2k3PYto5btxUx2CjU5Gkn7A7LMfIjUX38zZTK0r/YywUl1e4Q0dW7Cl9aPYd7clIyRnuHNxLP31SU8FDv0QY0kWJIyqm+cFBV5d6jLSQq4sUPnm5XEos+5NC80u3WZ6j/biEx8Yo50jFuFPXpR0ZphQGgLZduZUbtt7QepNcGvLR5SLX1s9H2HWEqKLJpWizBJ+bvIjoa+3ppsvydqr49Bp3f82korSfax1HJAPQ25qq+YaAtRwJvQQjf+4rQfyT3Xb9yohSWZwvzA==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=proofpoint20171006 header.d=nutanix.com header.i="@nutanix.com" header.h="Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=selector1 header.d=nutanix.com header.i="@nutanix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
  • Authentication-results: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nutanix.com;
  • Delivery-date: Mon, 19 Oct 2026 12:06:39 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Currently the cascaded output from the secondary i8259 is returned directly in
the pass_irqs[] array, instead of being connected to the relevant input of the
primary i8259.

This is a bug fix since in a cascaded configuration on real hardware it is
possible (although unlikely) that the cascaded input from the secondary i8259
can be masked on the primary i8259.

Signed-off-by: Mark Cave-Ayland <mark.caveayland@xxxxxxxxxxx>
---
 hw/intc/i8259.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/hw/intc/i8259.c b/hw/intc/i8259.c
index fe524efbce..d713795ae0 100644
--- a/hw/intc/i8259.c
+++ b/hw/intc/i8259.c
@@ -504,6 +504,11 @@ static void i8259_pic_realize(DeviceState *dev, Error 
**errp)
     }
 
     for (i = 0; i < 8; i++) {
+        /* Cascaded input is not usable */
+        if (i == 2) {
+            continue;
+        }
+
         s->pass_irqs[i] = qdev_get_gpio_in(pri_dev, i);
     }
 
@@ -519,7 +524,8 @@ static void i8259_pic_realize(DeviceState *dev, Error 
**errp)
     }
 
     /* Wire up secondary cascade */
-    qdev_connect_gpio_out(sec_dev, 0, s->pass_irqs[2]);
+    qdev_connect_gpio_out(sec_dev, 0,
+                          qdev_get_gpio_in(pri_dev, 2));
 
     for (i = 8; i < ISA_NUM_IRQS; i++) {
         s->pass_irqs[i] = qdev_get_gpio_in(sec_dev, i - 8);
-- 
2.43.0




 


Rackspace

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