Module Name:    src
Committed By:   ad
Date:           Fri Apr  3 22:20:37 UTC 2020

Modified Files:
        src/sys/arch/xen/include: intrdefs.h
        src/sys/arch/xen/x86: xen_intr.c

Log Message:
Attach xen IPI event counters.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/xen/include/intrdefs.h
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/xen/x86/xen_intr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/xen/include/intrdefs.h
diff -u src/sys/arch/xen/include/intrdefs.h:1.14 src/sys/arch/xen/include/intrdefs.h:1.15
--- src/sys/arch/xen/include/intrdefs.h:1.14	Sat Nov 23 19:40:38 2019
+++ src/sys/arch/xen/include/intrdefs.h	Fri Apr  3 22:20:36 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: intrdefs.h,v 1.14 2019/11/23 19:40:38 ad Exp $ */
+/* $NetBSD: intrdefs.h,v 1.15 2020/04/03 22:20:36 ad Exp $ */
 
 /* This file co-exists, and is included via machine/intrdefs.h */
 
@@ -21,4 +21,9 @@
 /* The number of 'irqs' that XEN understands */
 #define NUM_XEN_IRQS 		256
 
+#define XEN_IPI_NAMES {  "halt IPI", "FPU synch IPI", \
+			 "DDB IPI", "xcall IPI", \
+			 "HVCB IPI", "generic IPI", \
+			 "AST IPI" }
+
 #endif /* _XEN_INTRDEFS_H_ */

Index: src/sys/arch/xen/x86/xen_intr.c
diff -u src/sys/arch/xen/x86/xen_intr.c:1.18 src/sys/arch/xen/x86/xen_intr.c:1.19
--- src/sys/arch/xen/x86/xen_intr.c:1.18	Mon Dec 23 13:35:37 2019
+++ src/sys/arch/xen/x86/xen_intr.c	Fri Apr  3 22:20:36 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: xen_intr.c,v 1.18 2019/12/23 13:35:37 thorpej Exp $	*/
+/*	$NetBSD: xen_intr.c,v 1.19 2020/04/03 22:20:36 ad Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -30,13 +30,15 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xen_intr.c,v 1.18 2019/12/23 13:35:37 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xen_intr.c,v 1.19 2020/04/03 22:20:36 ad Exp $");
+
+#include "opt_multiprocessor.h"
 
 #include <sys/param.h>
 #include <sys/kernel.h>
 #include <sys/kmem.h>
-
 #include <sys/cpu.h>
+#include <sys/device.h>
 
 #include <xen/evtchn.h>
 #include <xen/xenfunc.h>
@@ -67,6 +69,10 @@ __KERNEL_RCSID(0, "$NetBSD: xen_intr.c,v
 #include <dev/pci/ppbreg.h>
 #endif
 
+#if defined(MULTIPROCESSOR)
+static const char *xen_ipi_names[XEN_NIPIS] = XEN_IPI_NAMES;
+#endif
+
 /*
  * Restore a value to cpl (unmasking interrupts).  If any unmasked
  * interrupts are pending, call Xspllower() to process them.
@@ -369,6 +375,12 @@ xen_cpu_intr_init(struct cpu_info *ci)
 	    INTRSTACKSIZE - 33 * sizeof(register_t);
 #endif
 
+#ifdef MULTIPROCESSOR
+	for (i = 0; i < XEN_NIPIS; i++)
+		evcnt_attach_dynamic(&ci->ci_ipi_events[i], EVCNT_TYPE_MISC,
+		    NULL, device_xname(ci->ci_dev), xen_ipi_names[i]);
+#endif
+
 	ci->ci_idepth = -1;
 }
 

Reply via email to