summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorroyger <royger@FreeBSD.org>2015-12-03 11:05:35 +0000
committerroyger <royger@FreeBSD.org>2015-12-03 11:05:35 +0000
commite9bddfef0b2bc796a7d9eb9f65126b20510a0e36 (patch)
tree9b9ed3b89736709efe35fcb67f193743c0ac90b9
parent68e44b1d7045a500ada4760ebd096f99e1544d2e (diff)
downloadFreeBSD-src-e9bddfef0b2bc796a7d9eb9f65126b20510a0e36.zip
FreeBSD-src-e9bddfef0b2bc796a7d9eb9f65126b20510a0e36.tar.gz
MFC r291024:
xen: fix dropping bitmap IPIs during resume Sponsored by: Citrix Systems R&D
-rw-r--r--sys/dev/xen/control/control.c3
-rw-r--r--sys/x86/xen/hvm.c21
2 files changed, 4 insertions, 20 deletions
diff --git a/sys/dev/xen/control/control.c b/sys/dev/xen/control/control.c
index bc0609d..60e448a 100644
--- a/sys/dev/xen/control/control.c
+++ b/sys/dev/xen/control/control.c
@@ -127,6 +127,7 @@ __FBSDID("$FreeBSD$");
#include <machine/_inttypes.h>
#include <machine/intr_machdep.h>
+#include <machine/apicvar.h>
#include <vm/vm.h>
#include <vm/vm_extern.h>
@@ -403,6 +404,8 @@ xctrl_suspend()
gnttab_resume();
#ifdef SMP
+ /* Send an IPI_BITMAP in case there are pending bitmap IPIs. */
+ lapic_ipi_vectored(IPI_BITMAP_VECTOR, APIC_IPI_DEST_ALL);
if (smp_started && !CPU_EMPTY(&cpu_suspend_map)) {
/*
* Now that event channels have been initialized,
diff --git a/sys/x86/xen/hvm.c b/sys/x86/xen/hvm.c
index 1986f6f..6c6f153 100644
--- a/sys/x86/xen/hvm.c
+++ b/sys/x86/xen/hvm.c
@@ -72,7 +72,6 @@ static driver_filter_t xen_cpustop_handler;
static driver_filter_t xen_cpususpend_handler;
static driver_filter_t xen_cpustophard_handler;
static void xen_ipi_vectored(u_int vector, int dest);
-static void xen_hvm_cpu_resume(void);
#endif
static void xen_hvm_cpu_init(void);
@@ -84,9 +83,6 @@ extern void pmap_lazyfix_action(void);
extern int pmap_pcid_enabled;
#endif
-/* Variables used by mp_machdep to perform the bitmap IPI */
-extern volatile u_int cpu_ipi_pending[MAXCPU];
-
/*---------------------------------- Macros ----------------------------------*/
#define IPI_TO_IDX(ipi) ((ipi) - APIC_IPI_INTS)
@@ -110,7 +106,7 @@ enum xen_domain_type xen_domain_type = XEN_NATIVE;
struct cpu_ops xen_hvm_cpu_ops = {
.ipi_vectored = lapic_ipi_vectored,
.cpu_init = xen_hvm_cpu_init,
- .cpu_resume = xen_hvm_cpu_resume
+ .cpu_resume = xen_hvm_cpu_init
};
#endif
@@ -312,21 +308,6 @@ xen_ipi_vectored(u_int vector, int dest)
/*---------------------- XEN diverged cpu operations -------------------------*/
static void
-xen_hvm_cpu_resume(void)
-{
- u_int cpuid = PCPU_GET(cpuid);
-
- /*
- * Reset pending bitmap IPIs, because Xen doesn't preserve pending
- * event channels on migration.
- */
- cpu_ipi_pending[cpuid] = 0;
-
- /* register vcpu_info area */
- xen_hvm_cpu_init();
-}
-
-static void
xen_cpu_ipi_init(int cpu)
{
xen_intr_handle_t *ipi_handle;
OpenPOWER on IntegriCloud