Attach xen IPI event counters.

This commit is contained in:
ad 2020-04-03 22:20:36 +00:00
parent 155c79f1c5
commit 084208a910
2 changed files with 21 additions and 4 deletions

View File

@ -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_ */

View File

@ -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 1.18 2019/12/23 13:35:37 thorpej Exp $"
#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;
}