Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/xen/x86 In the MP case,



details:   https://anonhg.NetBSD.org/src/rev/7035b5c318c3
branches:  trunk
changeset: 819991:7035b5c318c3
user:      cherry <cherry%NetBSD.org@localhost>
date:      Mon Dec 26 08:53:11 2016 +0000

description:
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.

diffstat:

 sys/arch/xen/x86/xen_pmap.c |  14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diffs (35 lines):

diff -r c39214dae8e3 -r 7035b5c318c3 sys/arch/xen/x86/xen_pmap.c
--- a/sys/arch/xen/x86/xen_pmap.c       Mon Dec 26 08:43:55 2016 +0000
+++ b/sys/arch/xen/x86/xen_pmap.c       Mon Dec 26 08:53:11 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: xen_pmap.c,v 1.24 2016/12/13 10:54:27 kamil Exp $      */
+/*     $NetBSD: xen_pmap.c,v 1.25 2016/12/26 08:53:11 cherry Exp $     */
 
 /*
  * Copyright (c) 2007 Manuel Bouyer.
@@ -102,7 +102,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xen_pmap.c,v 1.24 2016/12/13 10:54:27 kamil Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xen_pmap.c,v 1.25 2016/12/26 08:53:11 cherry Exp $");
 
 #include "opt_user_ldt.h"
 #include "opt_lockdebug.h"
@@ -188,9 +188,13 @@
 
        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);



Home | Main Index | Thread Index | Old Index