Source-Changes-HG archive

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

[src/trunk]: src/sys/arch Revert previous after thinking about it. It was wr...



details:   https://anonhg.NetBSD.org/src/rev/8b9054ff2901
branches:  trunk
changeset: 932781:8b9054ff2901
user:      ad <ad%NetBSD.org@localhost>
date:      Fri May 15 22:17:45 2020 +0000

description:
Revert previous after thinking about it.  It was wrong, don't need to use
an atomic to clear a PTE or set initial version unless the circumstances
call for it.

diffstat:

 sys/arch/amd64/include/pmap.h |  5 ++---
 sys/arch/i386/include/pmap.h  |  7 ++-----
 2 files changed, 4 insertions(+), 8 deletions(-)

diffs (50 lines):

diff -r c9dc40cfb0fa -r 8b9054ff2901 sys/arch/amd64/include/pmap.h
--- a/sys/arch/amd64/include/pmap.h     Fri May 15 22:15:43 2020 +0000
+++ b/sys/arch/amd64/include/pmap.h     Fri May 15 22:17:45 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.h,v 1.65 2020/03/17 18:17:07 ad Exp $     */
+/*     $NetBSD: pmap.h,v 1.66 2020/05/15 22:17:45 ad Exp $     */
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -202,8 +202,7 @@
 #ifndef XENPV
 #define pmap_pa2pte(a)                 (a)
 #define pmap_pte2pa(a)                 ((a) & PTE_FRAME)
-#define pmap_pte_set(p, n)             \
-    (void)atomic_swap_ulong((volatile unsigned long *)p, n)
+#define pmap_pte_set(p, n)             do { *(p) = (n); } while (0)
 #define pmap_pte_cas(p, o, n)          atomic_cas_64((p), (o), (n))
 #define pmap_pte_testset(p, n)         \
     atomic_swap_ulong((volatile unsigned long *)p, n)
diff -r c9dc40cfb0fa -r 8b9054ff2901 sys/arch/i386/include/pmap.h
--- a/sys/arch/i386/include/pmap.h      Fri May 15 22:15:43 2020 +0000
+++ b/sys/arch/i386/include/pmap.h      Fri May 15 22:17:45 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.h,v 1.124 2020/03/17 18:17:07 ad Exp $    */
+/*     $NetBSD: pmap.h,v 1.125 2020/05/15 22:17:45 ad Exp $    */
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -294,11 +294,10 @@
 #ifndef XENPV
 #define pmap_pa2pte(a)                 (a)
 #define pmap_pte2pa(a)                 ((a) & PTE_FRAME)
+#define pmap_pte_set(p, n)             do { *(p) = (n); } while (0)
 #define pmap_pte_flush()               /* nothing */
 
 #ifdef PAE
-#define pmap_pte_set(p, n)             \
-    (void)atomic_swap_64((volatile uint64_t *)p, n)
 #define pmap_pte_cas(p, o, n)          atomic_cas_64((p), (o), (n))
 #define pmap_pte_testset(p, n)         \
     atomic_swap_64((volatile uint64_t *)p, n)
@@ -307,8 +306,6 @@
 #define pmap_pte_clearbits(p, b)       \
     atomic_and_64((volatile uint64_t *)p, ~(b))
 #else /* PAE */
-#define pmap_pte_set(p, n)             \
-    (void)atomic_swap_ulong((volatile unsigned long *)p, n)
 #define pmap_pte_cas(p, o, n)          atomic_cas_32((p), (o), (n))
 #define pmap_pte_testset(p, n)         \
     atomic_swap_ulong((volatile unsigned long *)p, n)



Home | Main Index | Thread Index | Old Index