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

Re: NetBSD dom0 PVH: hardware interrupts stalls


  • To: Manuel Bouyer <bouyer@xxxxxxxxxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Thu, 26 Nov 2020 14:34:44 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • 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-SenderADCheck; bh=nAwaaVD6Fj0sDFpd+4YXDhOxDd9+amcuKNAhabbuvj4=; b=jR7BMrsnuS+yCkO52I00tQOHvRwRfmoIZgxcOry2v/eEyxe04rXCDIXqEmsqUMggJ1Y+vSM07J9BoIyzSCUcyCPKfeEFqUBpHsy2GXnEzaGoxg/CJyffFemN6B/burW3SyEtYpLhPKh8xQQ1xjur6UBVBiUnqAbIUIvLOom1wLWw8benlGluMvBky63MH18Xs/OCWzVsJ6uIt/syS+KXkeIYkNgrM+7COC60CMI/kHnkVDMb6cEP5JfYxojbVfRvZMdAreHZIp+OLCfRK1sXLZd/Nx0saAlDqe3FYkECDF5wFzDle6OarJMCrT/q/ydCVFvPO7X6YElI9mwwkxKoCw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DYekgSrGhRqcwREA0feEwIxc5OENttseouJepIQYxkDumdzvHJc+Lr/pdYMfhUr01xQDpjtV6Uw7w3jKuponRZZVJ2StZxbeFiKJyc48qj0K/Eb5D+C5BX132l2mghU0NZYcJ0duRA9b3KYeuMKQi5GGm5ZJ1VfUeKEDbEQEJB47HJFzdS4qAv+aD8pxgiKPdDWLTWsG2zQ2cnc6DN9+9+/AvnfMVeTm6VOlEkmstx1Wp+Cns1h5ObkiPrsW6AeZprQKYVVHpFQyRvWqNJdj7bA8b9Szdru8/qVfrmp2Fv1VyRc1WpE029CrmzkkXmazG7yqVCav4uq7UYz2cuniqg==
  • Authentication-results: esa1.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Jan Beulich <jbeulich@xxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 26 Nov 2020 13:36:29 +0000
  • Ironport-sdr: NUQTTQPUa3K5XQdvBUWK05g/qFcyeKnnAMU6FnviuGHby2blIk0cCUTmw3RXHllYA/bTlkVnDp XOpNsHTIV/77lWJzygpzWaFjZlGqc6Ai1EGjravZEbaQQ4LBrWmcKybbB9T12p1sjlpHTc8eXL 4jm3GBUgK7ZlnJ/HNhu5XIZjiAaiFsW2DzEyHsjzLa7pDHR7L1h0j4cBEQf2Td4o6j0OIcAjnp /qkTdXI3kJ1EMIN8M7zDTCnrVPDi5J31tWKUFEh4juII9D9c7r8JJyatBPmDQcsfvq1t5V+tud 4vc=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Tue, Nov 24, 2020 at 05:09:14PM +0100, Manuel Bouyer wrote:
> On Tue, Nov 24, 2020 at 04:49:17PM +0100, Roger Pau Monné wrote:
> > Could you also give a try with ioapic_ack=new on the Xen command line?
> 
> With this I still have the interrupt issue, but Xen doesn't panic on 'i'.
> http://www-soc.lip6.fr/~bouyer/xen-log8.txt

Sorry for the delay, I have yet another debug patch for you to try.
Can you remove the ioapic_ack=new from the command line and rebuild
the hypervisor with the provided patch applied and debug trace
enabled? (`gmake -C xen menuconfig` and go into Debugging Options to
find it).

Then once the system stalls use the 'T' debug key to dump the buffer.

Thanks, Roger.
---8<---
diff --git a/xen/arch/x86/hvm/vioapic.c b/xen/arch/x86/hvm/vioapic.c
index 67d4a6237f..adbfccdd0f 100644
--- a/xen/arch/x86/hvm/vioapic.c
+++ b/xen/arch/x86/hvm/vioapic.c
@@ -278,6 +278,10 @@ static void vioapic_write_redirent(
          */
         int ret = vioapic_hwdom_map_gsi(gsi, ent.fields.trig_mode,
                                         ent.fields.polarity);
+
+        if ( gsi == TRACK_IRQ )
+            debugtrace_printk("vIO-APIC UNMASK irq %u\n", gsi);
+
         if ( ret )
         {
             gprintk(XENLOG_ERR,
@@ -285,6 +289,9 @@ static void vioapic_write_redirent(
             unmasked = 0;
         }
     }
+    else if ( is_hardware_domain(d) && gsi == TRACK_IRQ )
+        debugtrace_printk("vIO-APIC MASK irq %u\n", gsi);
+
 
     if ( gsi == 0 || unmasked )
         pt_may_unmask_irq(d, NULL);
@@ -405,6 +412,10 @@ static void vioapic_deliver(struct hvm_vioapic *vioapic, 
unsigned int pin)
 
     ASSERT(spin_is_locked(&d->arch.hvm.irq_lock));
 
+    if ( irq == TRACK_IRQ )
+            debugtrace_printk("vIO-APIC deliver irq %u vector %u\n",
+                              irq, vector);
+
     HVM_DBG_LOG(DBG_LEVEL_IOAPIC,
                 "dest=%x dest_mode=%x delivery_mode=%x "
                 "vector=%x trig_mode=%x",
diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
index 49bd778484..db7167eb4b 100644
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -1641,6 +1641,9 @@ static void mask_and_ack_level_ioapic_irq(struct irq_desc 
*desc)
     unsigned long v;
     int i;
 
+    if ( desc->irq == TRACK_IRQ )
+        debugtrace_printk("ACK irq %u\n", desc->irq);
+
     irq_complete_move(desc);
 
     if ( !directed_eoi_enabled )
@@ -1688,6 +1691,9 @@ static void mask_and_ack_level_ioapic_irq(struct irq_desc 
*desc)
 
 static void end_level_ioapic_irq_old(struct irq_desc *desc, u8 vector)
 {
+    if ( desc->irq == TRACK_IRQ )
+        debugtrace_printk("END irq %u\n", desc->irq);
+
     if ( directed_eoi_enabled )
     {
         if ( !(desc->status & (IRQ_DISABLED|IRQ_MOVE_PENDING)) )
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 8d1f9a9fc6..baef41cd37 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -1109,6 +1109,10 @@ static void irq_guest_eoi_timer_fn(void *data)
     unsigned int i, irq = desc - irq_desc;
     irq_guest_action_t *action;
 
+    if ( desc->irq == TRACK_IRQ )
+        debugtrace_printk("irq_guest_eoi_timer_fn irq %u status %x\n",
+                          desc->irq, desc->status);
+
     spin_lock_irq(&desc->lock);
     
     if ( !(desc->status & IRQ_GUEST) )
@@ -1118,6 +1122,10 @@ static void irq_guest_eoi_timer_fn(void *data)
 
     ASSERT(action->ack_type != ACKTYPE_NONE);
 
+    if ( desc->irq == TRACK_IRQ )
+        debugtrace_printk("ack_type %u in_flight %u\n",
+                          action->ack_type, action->in_flight);
+
     /*
      * Is no IRQ in flight at all, or another instance of this timer already
      * running? Skip everything to avoid forcing an EOI early.
@@ -1837,6 +1845,10 @@ static void do_IRQ_guest(struct irq_desc *desc, unsigned 
int vector)
     unsigned int        i;
     struct pending_eoi *peoi = this_cpu(pending_eoi);
 
+    if ( desc->irq == TRACK_IRQ )
+        debugtrace_printk("do_IRQ_guest irq %u\n", desc->irq);
+
+
     if ( unlikely(!action->nr_guests) )
     {
         /* An interrupt may slip through while freeing an ACKTYPE_EOI irq. */
diff --git a/xen/drivers/passthrough/io.c b/xen/drivers/passthrough/io.c
index 6b1305a3e5..25ee1791f8 100644
--- a/xen/drivers/passthrough/io.c
+++ b/xen/drivers/passthrough/io.c
@@ -1010,6 +1010,9 @@ void hvm_dpci_eoi(struct domain *d, unsigned int 
guest_gsi,
     if ( !is_iommu_enabled(d) )
         return;
 
+    if ( guest_gsi == TRACK_IRQ )
+        debugtrace_printk("hvm_dpci_eoi irq %u\n", guest_gsi);
+
     if ( is_hardware_domain(d) )
     {
         spin_lock(&d->event_lock);
diff --git a/xen/include/xen/irq.h b/xen/include/xen/irq.h
index 43d567fe44..91579c33b9 100644
--- a/xen/include/xen/irq.h
+++ b/xen/include/xen/irq.h
@@ -174,4 +174,6 @@ unsigned int arch_hwdom_irqs(domid_t);
 void arch_evtchn_bind_pirq(struct domain *, int pirq);
 #endif
 
+#define TRACK_IRQ 34
+
 #endif /* __XEN_IRQ_H__ */




 


Rackspace

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