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

[QEMU][PATCH v1] Xen: Fix xen_set_irq() and xendevicemodel_set_irq_level()


  • To: <qemu-devel@xxxxxxxxxx>
  • From: Vikram Garhwal <vikram.garhwal@xxxxxxx>
  • Date: Wed, 1 Nov 2023 14:07:23 -0700
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=nongnu.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=arcselector9901; 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=Moa0axuF7omkDierUjBunbHH6SOVyOt/e+07ff+jXW8=; b=cYfJnGIffe1bg5gm0rMfDLu/SksgTkACSpjf/LCF7p0RBM/cBjLuztMTsCIvCw+lIvaGML3q5P3K3G3sf9pyjnJHQzt6FmB3Qbt4b1daKTpgEPkBwQo6YyVGouo4haVPGuPd2345wUQx1U2l82NbRtFBgt/Uy/Ji8rzFnFKcp9UYGQueCFZVo8d5Lbeg5KW2q4G+TJe8348563uCh0XoKUUOAAv9GLu1nZZ6qzdikkBr9SnPpB3ZsDYFPP+/8p+oTkOcu3U8mBAZN7M4c1Os2fRzhTatGwi6kQCpAC7fkV41Z172+LeQreMqpZneF7I8UIV38+Y2kuo86EI0tVfqzQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NnqNDVOJHo9nyT5TWxoEv3b3BqC7Cdc4DDbPKis+fWyBRSwlrNp+7avdhwy3K4RrGujfNStm2qT68mLQEFRU7eAZMXhhAhnEHCBeZFW1AqHmIRXVfhGCnFSa+l71PJhFwRNyO3/IbG6IBp7pYWa563QYMP0CD9ZpMOp080/faITGGPZbpbHDPpHyQsd/EaleHfP2Q6akWMY4cRVdBQIQpezaiZZeXZALNI5F59DTPT/ZP3AwcisTUcVGOfSKLG+/hYMkD2NlQieW9cVmn8NW6rg3VVstf5r9rdLKKZWA3I9LcUp1rXZ+7hJR9/DM60qWV3FTcXBV4vdizdMzAVErlg==
  • Cc: <sstabellini@xxxxxxxxxx>, <vikram.garhwal@xxxxxxx>, Peter Maydell <peter.maydell@xxxxxxxxxx>, Anthony Perard <anthony.perard@xxxxxxxxxx>, "Paul Durrant" <paul@xxxxxxx>, "open list:ARM TCG CPUs" <qemu-arm@xxxxxxxxxx>, "open list:X86 Xen CPUs" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 01 Nov 2023 21:08:06 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Remove '=' from 'if CONFIG_XEN_CTRL_INTERFACE_VERSION <= 41500'.
Because xendevicemodel_set_irq_level() was introduced in 4.15 version.

Also, update xendevicemodel_set_irq_level() to return -1 for older versions.

Signed-off-by: Vikram Garhwal <vikram.garhwal@xxxxxxx>
---
 hw/arm/xen_arm.c            | 4 +++-
 include/hw/xen/xen_native.h | 4 ++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/hw/arm/xen_arm.c b/hw/arm/xen_arm.c
index f83b983ec5..a5631529d0 100644
--- a/hw/arm/xen_arm.c
+++ b/hw/arm/xen_arm.c
@@ -75,7 +75,9 @@ static MemoryRegion ram_lo, ram_hi;
 
 static void xen_set_irq(void *opaque, int irq, int level)
 {
-    xendevicemodel_set_irq_level(xen_dmod, xen_domid, irq, level);
+    if (xendevicemodel_set_irq_level(xen_dmod, xen_domid, irq, level)) {
+        error_report("xendevicemodel_set_irq_level failed");
+    }
 }
 
 static void xen_create_virtio_mmio_devices(XenArmState *xam)
diff --git a/include/hw/xen/xen_native.h b/include/hw/xen/xen_native.h
index 5d2718261f..6f09c48823 100644
--- a/include/hw/xen/xen_native.h
+++ b/include/hw/xen/xen_native.h
@@ -523,12 +523,12 @@ static inline int xen_set_ioreq_server_state(domid_t dom,
                                                  enable);
 }
 
-#if CONFIG_XEN_CTRL_INTERFACE_VERSION <= 41500
+#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 41500
 static inline int xendevicemodel_set_irq_level(xendevicemodel_handle *dmod,
                                                domid_t domid, uint32_t irq,
                                                unsigned int level)
 {
-    return 0;
+    return -1;
 }
 #endif
 
-- 
2.17.1




 


Rackspace

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