Module Name: src Committed By: snj Date: Mon Apr 17 06:02:05 UTC 2017
Modified Files: src/sys/arch/amd64/conf [netbsd-7]: XEN3_DOM0 src/sys/arch/i386/conf [netbsd-7]: XEN3_DOM0 src/sys/arch/xen/x86 [netbsd-7]: xen_pmap.c Log Message: Pull up following revision(s) (requested by khorben in ticket #1367): sys/arch/amd64/conf/XEN3_DOM0: revision 1.126 sys/arch/i386/conf/XEN3_DOM0: revision 1.104 sys/arch/xen/x86/xen_pmap.c: revision 1.25 In the MP case, do not attempt to pmap_tlb_shootdown() after a pmap_kenter_ma() during boot. pmap_tlb_shootdown() assumes post boot. Instead invalidate the entry on the local CPU only. XXX: to DTRT, probably this assumption needs re-examination. XXX: The tradeoff is a (predicted) single word size comparison penalty, so perhaps a decision needs performance stats. xen dom0 SMP is now bootable again. -- add the 'options MULTIPROCESSOR' in respective configs, but mark them experimental - and thus disabled by default. To generate a diff of this commit: cvs rdiff -u -r1.103.2.5 -r1.103.2.6 src/sys/arch/amd64/conf/XEN3_DOM0 cvs rdiff -u -r1.85.2.6 -r1.85.2.7 src/sys/arch/i386/conf/XEN3_DOM0 cvs rdiff -u -r1.22 -r1.22.14.1 src/sys/arch/xen/x86/xen_pmap.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/amd64/conf/XEN3_DOM0 diff -u src/sys/arch/amd64/conf/XEN3_DOM0:1.103.2.5 src/sys/arch/amd64/conf/XEN3_DOM0:1.103.2.6 --- src/sys/arch/amd64/conf/XEN3_DOM0:1.103.2.5 Fri Dec 9 05:10:45 2016 +++ src/sys/arch/amd64/conf/XEN3_DOM0 Mon Apr 17 06:02:05 2017 @@ -1,7 +1,9 @@ -# $NetBSD: XEN3_DOM0,v 1.103.2.5 2016/12/09 05:10:45 snj Exp $ +# $NetBSD: XEN3_DOM0,v 1.103.2.6 2017/04/17 06:02:05 snj Exp $ include "arch/amd64/conf/std.xen" +#options MULTIPROCESSOR # (experimental) + options INCLUDE_CONFIG_FILE # embed config file in kernel binary #options UVMHIST Index: src/sys/arch/i386/conf/XEN3_DOM0 diff -u src/sys/arch/i386/conf/XEN3_DOM0:1.85.2.6 src/sys/arch/i386/conf/XEN3_DOM0:1.85.2.7 --- src/sys/arch/i386/conf/XEN3_DOM0:1.85.2.6 Fri Dec 9 05:10:45 2016 +++ src/sys/arch/i386/conf/XEN3_DOM0 Mon Apr 17 06:02:05 2017 @@ -1,9 +1,11 @@ -# $NetBSD: XEN3_DOM0,v 1.85.2.6 2016/12/09 05:10:45 snj Exp $ +# $NetBSD: XEN3_DOM0,v 1.85.2.7 2017/04/17 06:02:05 snj Exp $ # # XEN3_0: Xen 3.0 domain0 kernel include "arch/xen/conf/std.xen" +#options MULTIPROCESSOR # (experimental) + options INCLUDE_CONFIG_FILE # embed config file in kernel binary #options UVMHIST Index: src/sys/arch/xen/x86/xen_pmap.c diff -u src/sys/arch/xen/x86/xen_pmap.c:1.22 src/sys/arch/xen/x86/xen_pmap.c:1.22.14.1 --- src/sys/arch/xen/x86/xen_pmap.c:1.22 Sun Jun 24 18:31:53 2012 +++ src/sys/arch/xen/x86/xen_pmap.c Mon Apr 17 06:02:05 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: xen_pmap.c,v 1.22 2012/06/24 18:31:53 jym Exp $ */ +/* $NetBSD: xen_pmap.c,v 1.22.14.1 2017/04/17 06:02:05 snj Exp $ */ /* * Copyright (c) 2007 Manuel Bouyer. @@ -102,7 +102,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: xen_pmap.c,v 1.22 2012/06/24 18:31:53 jym Exp $"); +__KERNEL_RCSID(0, "$NetBSD: xen_pmap.c,v 1.22.14.1 2017/04/17 06:02:05 snj Exp $"); #include "opt_user_ldt.h" #include "opt_lockdebug.h" @@ -192,9 +192,13 @@ pmap_kenter_ma(vaddr_t va, paddr_t ma, v if (pmap_valid_entry(opte)) { #if defined(MULTIPROCESSOR) - kpreempt_disable(); - pmap_tlb_shootdown(pmap_kernel(), va, opte, TLBSHOOT_KENTER); - kpreempt_enable(); + if (__predict_false(x86_mp_online == false)) { + pmap_update_pg(va); + } else { + kpreempt_disable(); + pmap_tlb_shootdown(pmap_kernel(), va, opte, TLBSHOOT_KENTER); + kpreempt_enable(); + } #else /* Don't bother deferring in the single CPU case. */ pmap_update_pg(va);