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

[PATCH] x86/irq: do not insert IRQ_MSI_EMU in emuirq mappings


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Xenia Ragiadakou <xenia.ragiadakou@xxxxxxx>
  • Date: Tue, 31 Oct 2023 15:30:37 +0200
  • 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=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=9Ke8d4plNGJuIwSSfw+nKl5cBA307t6eSU88RthCIEY=; b=e8GL2dMJqKOFoJOI8nwOmxzm/06p1DfP+IKX5k15++30qG+fsLeG2ZUQUSu5znQJt9BNBP93MaYtb0MPxHP+yYkQovyG8a39age1zdFZLRi0mibTIAnCiE30RFflBE1mzwSYYPnMjNMcwYZ5mT5LdfDB24O+3h3Z02awHyJsFFAfnce3sdjn0SMvIRKvC8OYX0EJtRBso2jPCGB9vpGaFitI10xnrr1+oTXv/iThlVJxcR1+QVbUQQg2OY0bi8p2G9QH2XJvvdmLF9U5cIhnwXnRXX3SdIyGudn5eceEq2/e/c45mozm+tBVjpis1W8I9WmTx8iceR/WD/rJa9gJXQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XHbXwyVAS6hxjYDnCYh6drtCNELAG0hNJ9KPD9f5yNCJ7UanHlw+R7Od0uQyJdiAZn178CSv1vJZHXEM49rxN9q/4lcj4jS2b6XaoCHf1tQLqLtTEXw968zm5JnhJMbrY84ROY3bRJgTtRm2Co+zilVxEujuOj5W9qTKwRH9nMMbBIRq+DW0pkTpO5Xpa/scqwUT3uFW1Q3Tz25xIvCw4iHMtbUDZA6kTMHrG40ZFY89Ab8cR0HTJL6popDf7IseerUIhWsq/IFuJlkaglxJ4laZY+JEBRkXK1pvsiUqaBG2Mxbg8MaUUN80sWqhXz5b3lB5hBixJTeCCrug5/GTGQ==
  • Cc: Xenia Ragiadakou <xenia.ragiadakou@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Tue, 31 Oct 2023 13:31:16 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Do not use emuirq mappings for MSIs injected by emulated devices.
This kind of pirq shares the same emuirq value and is not remapped.

Fixes: 88fccdd11ca0 ('xen: event channel remapping for emulated MSIs')
Signed-off-by: Xenia Ragiadakou <xenia.ragiadakou@xxxxxxx>
---

Question: is there any strong reason why Linux HVM guests still use pirqs?

 xen/arch/x86/irq.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index f42ad539dc..cdc8dc5a55 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -2684,7 +2684,7 @@ int map_domain_emuirq_pirq(struct domain *d, int pirq, 
int emuirq)
     }
 
     old_emuirq = domain_pirq_to_emuirq(d, pirq);
-    if ( emuirq != IRQ_PT )
+    if ( (emuirq != IRQ_PT) && (emuirq != IRQ_MSI_EMU) )
         old_pirq = domain_emuirq_to_pirq(d, emuirq);
 
     if ( (old_emuirq != IRQ_UNBOUND && (old_emuirq != emuirq) ) ||
@@ -2699,8 +2699,8 @@ int map_domain_emuirq_pirq(struct domain *d, int pirq, 
int emuirq)
     if ( !info )
         return -ENOMEM;
 
-    /* do not store emuirq mappings for pt devices */
-    if ( emuirq != IRQ_PT )
+    /* do not store emuirq mappings for pt devices and emulated MSIs */
+    if ( (emuirq != IRQ_PT) && (emuirq != IRQ_MSI_EMU) )
     {
         int err = radix_tree_insert(&d->arch.hvm.emuirq_pirq, emuirq,
                                     radix_tree_int_to_ptr(pirq));
@@ -2753,7 +2753,7 @@ int unmap_domain_pirq_emuirq(struct domain *d, int pirq)
         info->arch.hvm.emuirq = IRQ_UNBOUND;
         pirq_cleanup_check(info, d);
     }
-    if ( emuirq != IRQ_PT )
+    if ( (emuirq != IRQ_PT) && (emuirq != IRQ_MSI_EMU) )
         radix_tree_delete(&d->arch.hvm.emuirq_pirq, emuirq);
 
  done:
-- 
2.34.1




 


Rackspace

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