From owner-svn-src-all@freebsd.org Thu Dec 3 11:05:37 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 135DAA3F51E; Thu, 3 Dec 2015 11:05:37 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C909F1A87; Thu, 3 Dec 2015 11:05:36 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB3B5ZAp064166; Thu, 3 Dec 2015 11:05:35 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB3B5ZUO064164; Thu, 3 Dec 2015 11:05:35 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201512031105.tB3B5ZUO064164@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Thu, 3 Dec 2015 11:05:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r291687 - in stable/10/sys: dev/xen/control x86/xen X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Dec 2015 11:05:37 -0000 Author: royger Date: Thu Dec 3 11:05:35 2015 New Revision: 291687 URL: https://svnweb.freebsd.org/changeset/base/291687 Log: MFC r291024: xen: fix dropping bitmap IPIs during resume Sponsored by: Citrix Systems R&D Modified: stable/10/sys/dev/xen/control/control.c stable/10/sys/x86/xen/hvm.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/xen/control/control.c ============================================================================== --- stable/10/sys/dev/xen/control/control.c Thu Dec 3 10:59:10 2015 (r291686) +++ stable/10/sys/dev/xen/control/control.c Thu Dec 3 11:05:35 2015 (r291687) @@ -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, Modified: stable/10/sys/x86/xen/hvm.c ============================================================================== --- stable/10/sys/x86/xen/hvm.c Thu Dec 3 10:59:10 2015 (r291686) +++ stable/10/sys/x86/xen/hvm.c Thu Dec 3 11:05:35 2015 (r291687) @@ -72,7 +72,6 @@ static driver_filter_t xen_cpustop_handl 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 = X 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;