Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/xen Add an ipi callback to force hypervisor callbac...
details: https://anonhg.NetBSD.org/src/rev/f8103d735a6f
branches: trunk
changeset: 771067:f8103d735a6f
user: cherry <cherry%NetBSD.org@localhost>
date: Mon Nov 07 15:51:31 2011 +0000
description:
Add an ipi callback to force hypervisor callback. this is useful to "re-route" interrupts to a given vcpu
diffstat:
sys/arch/xen/include/intrdefs.h | 5 +++--
sys/arch/xen/x86/xen_ipi.c | 29 ++++++++++++++++++++++-------
2 files changed, 25 insertions(+), 9 deletions(-)
diffs (88 lines):
diff -r a8a09a413596 -r f8103d735a6f sys/arch/xen/include/intrdefs.h
--- a/sys/arch/xen/include/intrdefs.h Mon Nov 07 14:18:51 2011 +0000
+++ b/sys/arch/xen/include/intrdefs.h Mon Nov 07 15:51:31 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: intrdefs.h,v 1.10 2011/08/10 06:29:23 cherry Exp $ */
+/* $NetBSD: intrdefs.h,v 1.11 2011/11/07 15:51:31 cherry Exp $ */
/* This file co-exists, and is included via machine/intrdefs.h */
@@ -11,7 +11,8 @@
#define XEN_IPI_SYNCH_FPU 0x00000002
#define XEN_IPI_DDB 0x00000004
#define XEN_IPI_XCALL 0x00000008
+#define XEN_IPI_HVCB 0x00000010
-#define XEN_NIPIS 4 /* IPI_KICK doesn't have a handler */
+#define XEN_NIPIS 5 /* IPI_KICK doesn't have a handler */
#endif /* _XEN_INTRDEFS_H_ */
diff -r a8a09a413596 -r f8103d735a6f sys/arch/xen/x86/xen_ipi.c
--- a/sys/arch/xen/x86/xen_ipi.c Mon Nov 07 14:18:51 2011 +0000
+++ b/sys/arch/xen/x86/xen_ipi.c Mon Nov 07 15:51:31 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: xen_ipi.c,v 1.5 2011/09/27 01:02:37 jym Exp $ */
+/* $NetBSD: xen_ipi.c,v 1.6 2011/11/07 15:51:31 cherry Exp $ */
/*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -33,10 +33,10 @@
/*
* Based on: x86/ipi.c
- * __KERNEL_RCSID(0, "$NetBSD: xen_ipi.c,v 1.5 2011/09/27 01:02:37 jym Exp $");
+ * __KERNEL_RCSID(0, "$NetBSD: xen_ipi.c,v 1.6 2011/11/07 15:51:31 cherry Exp $");
*/
-__KERNEL_RCSID(0, "$NetBSD: xen_ipi.c,v 1.5 2011/09/27 01:02:37 jym Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xen_ipi.c,v 1.6 2011/11/07 15:51:31 cherry Exp $");
#include <sys/types.h>
@@ -72,13 +72,15 @@
static void xen_ipi_synch_fpu(struct cpu_info *, struct intrframe *);
static void xen_ipi_ddb(struct cpu_info *, struct intrframe *);
static void xen_ipi_xcall(struct cpu_info *, struct intrframe *);
+static void xen_ipi_hvcb(struct cpu_info *, struct intrframe *);
static void (*ipifunc[XEN_NIPIS])(struct cpu_info *, struct intrframe *) =
{ /* In order of priority (see: xen/include/intrdefs.h */
xen_ipi_halt,
xen_ipi_synch_fpu,
xen_ipi_ddb,
- xen_ipi_xcall
+ xen_ipi_xcall,
+ xen_ipi_hvcb
};
static void
@@ -139,9 +141,9 @@
static inline bool /* helper */
valid_ipimask(uint32_t ipimask)
{
- uint32_t masks = XEN_IPI_XCALL | XEN_IPI_DDB |
- XEN_IPI_SYNCH_FPU | XEN_IPI_HALT |
- XEN_IPI_KICK;
+ uint32_t masks = XEN_IPI_HVCB | XEN_IPI_XCALL |
+ XEN_IPI_DDB | XEN_IPI_SYNCH_FPU |
+ XEN_IPI_HALT | XEN_IPI_KICK;
if (ipimask & ~masks) {
return false;
@@ -296,3 +298,16 @@
xen_broadcast_ipi(XEN_IPI_XCALL);
}
}
+
+static void
+xen_ipi_hvcb(struct cpu_info *ci, struct intrframe *intrf)
+{
+ KASSERT(ci != NULL);
+ KASSERT(intrf != NULL);
+
+ volatile struct vcpu_info *vci = ci->ci_vcpu;
+
+ KASSERT(ci == curcpu());
+ KASSERT(!vci->evtchn_upcall_mask);
+ hypervisor_force_callback();
+}
Home |
Main Index |
Thread Index |
Old Index