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 pmap_extract_ma(): don't need to take pm_lo...



details:   https://anonhg.NetBSD.org/src/rev/fc869dc83f5d
branches:  trunk
changeset: 968225:fc869dc83f5d
user:      ad <ad%NetBSD.org@localhost>
date:      Tue Jan 07 13:20:18 2020 +0000

description:
pmap_extract_ma(): don't need to take pm_lock for pmap_kernel().

diffstat:

 sys/arch/xen/x86/xen_pmap.c |  12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diffs (40 lines):

diff -r 1fa6114f63c6 -r fc869dc83f5d sys/arch/xen/x86/xen_pmap.c
--- a/sys/arch/xen/x86/xen_pmap.c       Tue Jan 07 10:20:07 2020 +0000
+++ b/sys/arch/xen/x86/xen_pmap.c       Tue Jan 07 13:20:18 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: xen_pmap.c,v 1.35 2020/01/04 22:49:20 ad Exp $ */
+/*     $NetBSD: xen_pmap.c,v 1.36 2020/01/07 13:20:18 ad Exp $ */
 
 /*
  * Copyright (c) 2007 Manuel Bouyer.
@@ -101,7 +101,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xen_pmap.c,v 1.35 2020/01/04 22:49:20 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xen_pmap.c,v 1.36 2020/01/07 13:20:18 ad Exp $");
 
 #include "opt_user_ldt.h"
 #include "opt_lockdebug.h"
@@ -214,7 +214,9 @@
        struct pmap *pmap2;
        int lvl;
 
-       mutex_enter(&pmap->pm_lock);
+       if (pmap != pmap_kernel()) {
+               mutex_enter(&pmap->pm_lock);
+       }
        pmap_map_ptes(pmap, &pmap2, &ptes, &pdes);
        if (!pmap_pdes_valid(va, pdes, &pde, &lvl)) {
                pmap_unmap_ptes(pmap, pmap2);
@@ -225,7 +227,9 @@
        KASSERT(lvl == 1);
        pte = ptes[pl1_i(va)];
        pmap_unmap_ptes(pmap, pmap2);
-       mutex_exit(&pmap->pm_lock);
+       if (pmap != pmap_kernel()) {
+               mutex_exit(&pmap->pm_lock);
+       }
 
        if (__predict_true((pte & PTE_P) != 0)) {
                if (pap != NULL)



Home | Main Index | Thread Index | Old Index