Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/xen/x86 only call PHYSDEVOP_map_pirq for a shared i...



details:   https://anonhg.NetBSD.org/src/rev/e37078cb55a3
branches:  trunk
changeset: 972074:e37078cb55a3
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Fri May 15 07:31:07 2020 +0000

description:
only call PHYSDEVOP_map_pirq for a shared interrupt once, same as previous code

fixes boot problem reported privately by Frank Kardel and Patrick Welche

diffstat:

 sys/arch/xen/x86/pintr.c |  13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diffs (44 lines):

diff -r f6b5451aa8e2 -r e37078cb55a3 sys/arch/xen/x86/pintr.c
--- a/sys/arch/xen/x86/pintr.c  Fri May 15 06:34:34 2020 +0000
+++ b/sys/arch/xen/x86/pintr.c  Fri May 15 07:31:07 2020 +0000
@@ -103,7 +103,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pintr.c,v 1.14 2020/05/04 15:55:56 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pintr.c,v 1.15 2020/05/15 07:31:07 jdolecek Exp $");
 
 #include "opt_multiprocessor.h"
 #include "opt_xen.h"
@@ -194,6 +194,11 @@
            {
                KASSERT(gsi < 255);
 
+               if (irq2port[gsi] != 0) {
+                       /* Already mapped the shared interrupt */
+                       break;
+               }
+
                memset(&map_irq, 0, sizeof(map_irq));
                map_irq.domid = DOMID_SELF;
                map_irq.type = MAP_PIRQ_TYPE_GSI;
@@ -201,7 +206,8 @@
                map_irq.pirq = gsi;
                ret = HYPERVISOR_physdev_op(PHYSDEVOP_map_pirq, &map_irq);
                if (ret != 0)
-                       panic("physdev_op(PHYSDEVOP_map_pirq) fail");
+                       panic("physdev_op(PHYSDEVOP_map_pirq) GSI fail %d",
+                           ret);
                break;
            }
        case PIC_MSI:
@@ -226,7 +232,8 @@
                }
                ret = HYPERVISOR_physdev_op(PHYSDEVOP_map_pirq, &map_irq);
                if (ret != 0)
-                       panic("physdev_op(PHYSDEVOP_map_pirq) fail");
+                       panic("physdev_op(PHYSDEVOP_map_pirq) MSI fail %d",
+                           ret);
                KASSERT(map_irq.entry_nr == i->mp_veccnt);
                gsi = map_irq.pirq;
                break;



Home | Main Index | Thread Index | Old Index