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 switch back to PHYSDEVOP_alloc_irq_vector f...



details:   https://anonhg.NetBSD.org/src/rev/3229ceaaea39
branches:  trunk
changeset: 933265:3229ceaaea39
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Sat May 23 14:51:19 2020 +0000

description:
switch back to PHYSDEVOP_alloc_irq_vector for non-MSI interrupts - on my
computer it works the same as PHYSDEVOP_map_pirq, but seems it doesn't
on other systems

fixes PR port-xen/55285 for Patrick Welche, but not yet for another system
by Frank Kardel

diffstat:

 sys/arch/xen/x86/pintr.c |  23 ++++++++++++-----------
 1 files changed, 12 insertions(+), 11 deletions(-)

diffs (53 lines):

diff -r 69f05babc4e8 -r 3229ceaaea39 sys/arch/xen/x86/pintr.c
--- a/sys/arch/xen/x86/pintr.c  Sat May 23 14:14:55 2020 +0000
+++ b/sys/arch/xen/x86/pintr.c  Sat May 23 14:51:19 2020 +0000
@@ -103,7 +103,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pintr.c,v 1.16 2020/05/15 07:42:58 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pintr.c,v 1.17 2020/05/23 14:51:19 jdolecek Exp $");
 
 #include "opt_multiprocessor.h"
 #include "opt_xen.h"
@@ -173,7 +173,6 @@
 int
 xen_pic_to_gsi(struct pic *pic, int pin)
 {
-       struct physdev_map_pirq map_irq;
        int ret;
        int gsi;
 
@@ -199,21 +198,23 @@
                        break;
                }
 
-               memset(&map_irq, 0, sizeof(map_irq));
-               map_irq.domid = DOMID_SELF;
-               map_irq.type = MAP_PIRQ_TYPE_GSI;
-               map_irq.index = pin;
-               map_irq.pirq = gsi;
-               ret = HYPERVISOR_physdev_op(PHYSDEVOP_map_pirq, &map_irq);
-               if (ret != 0)
-                       panic("physdev_op(PHYSDEVOP_map_pirq) GSI fail %d",
-                           ret);
+               struct physdev_irq irq_op;
+               memset(&irq_op, 0, sizeof(irq_op));
+               irq_op.irq = gsi;
+               ret = HYPERVISOR_physdev_op(PHYSDEVOP_alloc_irq_vector,
+                   &irq_op);
+               if (ret < 0) {
+                       panic("physdev_op(PHYSDEVOP_alloc_irq_vector) %d"
+                           " fail %d", gsi, ret);
+               }
+               KASSERT(irq_op.vector == gsi);
                break;
            }
        case PIC_MSI:
        case PIC_MSIX:
 #ifdef __HAVE_PCI_MSI_MSIX
            {
+               struct physdev_map_pirq map_irq;
                const struct msipic_pci_info *i = msipic_get_pci_info(pic);
 
                memset(&map_irq, 0, sizeof(map_irq));



Home | Main Index | Thread Index | Old Index