From 8be4f4a913fc565c8b3cf5eb447c70c830ca723c Mon Sep 17 00:00:00 2001 From: royger Date: Thu, 3 Dec 2015 11:05:35 +0000 Subject: [PATCH] MFC r291024: xen: fix dropping bitmap IPIs during resume Sponsored by: Citrix Systems R&D git-svn-id: svn://svn.freebsd.org/base/stable/10@291687 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- sys/dev/xen/control/control.c | 3 +++ sys/x86/xen/hvm.c | 21 +-------------------- 2 files changed, 4 insertions(+), 20 deletions(-) diff --git a/sys/dev/xen/control/control.c b/sys/dev/xen/control/control.c index bc0609d33..60e448a1a 100644 --- a/sys/dev/xen/control/control.c +++ b/sys/dev/xen/control/control.c @@ -127,6 +127,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -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 1986f6f6e..6c6f15305 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 @@ -311,21 +307,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) { -- 2.45.0