Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/tprof Retire arm_[di]sb in favour of the isb() and d...



details:   https://anonhg.NetBSD.org/src/rev/418cd75cf0ee
branches:  trunk
changeset: 956437:418cd75cf0ee
user:      skrll <skrll%NetBSD.org@localhost>
date:      Fri Oct 30 18:54:35 2020 +0000

description:
Retire arm_[di]sb in favour of the isb() and dsb(sy) macro invocations.

diffstat:

 sys/arch/aarch64/include/locore.h         |  14 +-----------
 sys/arch/arm/arm/cpufunc.c                |   6 ++--
 sys/arch/arm/arm32/arm32_kvminit.c        |   6 ++--
 sys/arch/arm/arm32/arm32_machdep.c        |   6 ++--
 sys/arch/arm/arm32/arm32_tlb.c            |  34 +++++++++++++++---------------
 sys/arch/arm/arm32/armv7_generic_space.c  |   6 ++--
 sys/arch/arm/arm32/db_machdep.c           |  12 +++++++---
 sys/arch/arm/arm32/pmap.c                 |  16 +++++++-------
 sys/arch/arm/broadcom/bcm53xx_pax.c       |   6 ++--
 sys/arch/arm/broadcom/bcmgen_space.c      |   6 ++--
 sys/arch/arm/cortex/gicv3.c               |  26 +++++++++++-----------
 sys/arch/arm/cortex/gtmr.c                |  16 +++++++-------
 sys/arch/arm/include/arm32/pmap.h         |   4 +-
 sys/arch/arm/include/locore.h             |  31 +---------------------------
 sys/arch/arm/marvell/armadaxp.c           |  16 +++++++-------
 sys/arch/arm/samsung/exynos_platform.c    |   6 ++--
 sys/arch/arm/vexpress/vexpress_platform.c |   6 ++--
 sys/arch/arm/vfp/vfp_init.c               |   6 ++--
 sys/arch/arm/virt/virt_platform.c         |   6 ++--
 sys/arch/arm/zynq/zynq_space.c            |   6 ++--
 sys/arch/evbarm/bcm53xx/bcm53xx_machdep.c |   6 ++--
 sys/arch/evbarm/beagle/beagle_machdep.c   |   6 ++--
 sys/arch/evbarm/gumstix/gumstix_machdep.c |   4 +-
 sys/arch/evbarm/zynq/zynq_machdep.c       |   6 ++--
 sys/dev/tprof/tprof_armv7.c               |   8 +++---
 sys/dev/tprof/tprof_armv8.c               |  10 ++++----
 26 files changed, 119 insertions(+), 156 deletions(-)

diffs (truncated from 1084 to 300 lines):

diff -r bcbe31594999 -r 418cd75cf0ee sys/arch/aarch64/include/locore.h
--- a/sys/arch/aarch64/include/locore.h Fri Oct 30 18:47:38 2020 +0000
+++ b/sys/arch/aarch64/include/locore.h Fri Oct 30 18:54:35 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.h,v 1.5 2018/07/09 09:09:47 jmcneill Exp $ */
+/* $NetBSD: locore.h,v 1.6 2020/10/30 18:54:35 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -86,18 +86,6 @@
        return oldpsw;
 }
 
-static inline void
-arm_dsb(void)
-{
-       __asm __volatile("dsb sy" ::: "memory");
-}
-
-static inline void
-arm_isb(void)
-{
-       __asm __volatile("isb" ::: "memory");
-}
-
 #endif /* _LOCORE */
 
 #elif defined(__arm__)
diff -r bcbe31594999 -r 418cd75cf0ee sys/arch/arm/arm/cpufunc.c
--- a/sys/arch/arm/arm/cpufunc.c        Fri Oct 30 18:47:38 2020 +0000
+++ b/sys/arch/arm/arm/cpufunc.c        Fri Oct 30 18:54:35 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpufunc.c,v 1.177 2020/07/10 12:25:08 skrll Exp $      */
+/*     $NetBSD: cpufunc.c,v 1.178 2020/10/30 18:54:36 skrll Exp $      */
 
 /*
  * arm7tdmi support code Copyright (c) 2001 John Fremlin
@@ -49,7 +49,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpufunc.c,v 1.177 2020/07/10 12:25:08 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpufunc.c,v 1.178 2020/10/30 18:54:36 skrll Exp $");
 
 #include "opt_arm_start.h"
 #include "opt_compat_netbsd.h"
@@ -1330,7 +1330,7 @@
        __asm volatile(".arch\tarmv7a");
 
        armreg_csselr_write(cssr);
-       arm_isb();                       /* sync to the new cssr */
+       isb();                   /* sync to the new cssr */
 
 #else
        __asm volatile("mcr p15, 1, %0, c0, c0, 2" :: "r" (cssr) : "memory");
diff -r bcbe31594999 -r 418cd75cf0ee sys/arch/arm/arm32/arm32_kvminit.c
--- a/sys/arch/arm/arm32/arm32_kvminit.c        Fri Oct 30 18:47:38 2020 +0000
+++ b/sys/arch/arm/arm32/arm32_kvminit.c        Fri Oct 30 18:54:35 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: arm32_kvminit.c,v 1.65 2020/08/28 13:36:52 skrll Exp $ */
+/*     $NetBSD: arm32_kvminit.c,v 1.66 2020/10/30 18:54:36 skrll Exp $ */
 
 /*
  * Copyright (c) 2002, 2003, 2005  Genetec Corporation.  All rights reserved.
@@ -127,7 +127,7 @@
 #include "opt_multiprocessor.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: arm32_kvminit.c,v 1.65 2020/08/28 13:36:52 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: arm32_kvminit.c,v 1.66 2020/10/30 18:54:36 skrll Exp $");
 
 #include <sys/param.h>
 
@@ -1050,7 +1050,7 @@
         */
        armreg_ttbcr_write(armreg_ttbcr_read() | TTBCR_S_PD0);
        cpu_setttb(l1pt_pa, KERNEL_PID);
-       arm_isb();
+       isb();
 #else
        cpu_setttb(l1pt_pa, true);
 #endif
diff -r bcbe31594999 -r 418cd75cf0ee sys/arch/arm/arm32/arm32_machdep.c
--- a/sys/arch/arm/arm32/arm32_machdep.c        Fri Oct 30 18:47:38 2020 +0000
+++ b/sys/arch/arm/arm32/arm32_machdep.c        Fri Oct 30 18:54:35 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: arm32_machdep.c,v 1.137 2020/08/28 13:15:05 skrll Exp $        */
+/*     $NetBSD: arm32_machdep.c,v 1.138 2020/10/30 18:54:36 skrll Exp $        */
 
 /*
  * Copyright (c) 1994-1998 Mark Brinicombe.
@@ -42,7 +42,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: arm32_machdep.c,v 1.137 2020/08/28 13:15:05 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: arm32_machdep.c,v 1.138 2020/10/30 18:54:36 skrll Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_arm_start.h"
@@ -752,7 +752,7 @@
 
        armreg_ttbcr_write(armreg_ttbcr_read() | TTBCR_S_PD0);
        cpu_setttb(pmap_kernel()->pm_l1_pa , KERNEL_PID);
-       arm_isb();
+       isb();
 #else
        cpu_setttb(pmap_kernel()->pm_l1->l1_physaddr, true);
 #endif
diff -r bcbe31594999 -r 418cd75cf0ee sys/arch/arm/arm32/arm32_tlb.c
--- a/sys/arch/arm/arm32/arm32_tlb.c    Fri Oct 30 18:47:38 2020 +0000
+++ b/sys/arch/arm/arm32/arm32_tlb.c    Fri Oct 30 18:54:35 2020 +0000
@@ -31,7 +31,7 @@
 #include "opt_multiprocessor.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: arm32_tlb.c,v 1.13 2020/09/29 19:58:49 jmcneill Exp $");
+__KERNEL_RCSID(1, "$NetBSD: arm32_tlb.c,v 1.14 2020/10/30 18:54:36 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -52,26 +52,26 @@
 void
 tlb_set_asid(tlb_asid_t asid)
 {
-       arm_dsb();
+       dsb(sy);
        if (asid == KERNEL_PID) {
                armreg_ttbcr_write(armreg_ttbcr_read() | TTBCR_S_PD0);
-               arm_isb();
+               isb();
        }
        armreg_contextidr_write(asid);
-       arm_isb();
+       isb();
 }
 
 void
 tlb_invalidate_all(void)
 {
        const bool vivt_icache_p = arm_pcache.icache_type == CACHE_TYPE_VIVT;
-       arm_dsb();
+       dsb(sy);
        if (arm_has_mpext_p) {
                armreg_tlbiallis_write(0);
        } else {
                armreg_tlbiall_write(0);
        }
-       arm_isb();
+       isb();
        if (__predict_false(vivt_icache_p)) {
                if (arm_has_tlbiasid_p) {
                        armreg_icialluis_write(0);
@@ -79,8 +79,8 @@
                        armreg_iciallu_write(0);
                }
        }
-       arm_dsb();
-       arm_isb();
+       dsb(sy);
+       isb();
 }
 
 void
@@ -93,7 +93,7 @@
 tlb_invalidate_asids(tlb_asid_t lo, tlb_asid_t hi)
 {
        const bool vivt_icache_p = arm_pcache.icache_type == CACHE_TYPE_VIVT;
-       arm_dsb();
+       dsb(sy);
        if (arm_has_tlbiasid_p) {
                for (; lo <= hi; lo++) {
                        if (arm_has_mpext_p) {
@@ -102,8 +102,8 @@
                                armreg_tlbiasid_write(lo);
                        }
                }
-               arm_dsb();
-               arm_isb();
+               dsb(sy);
+               isb();
                if (__predict_false(vivt_icache_p)) {
                        if (arm_has_mpext_p) {
                                armreg_icialluis_write(0);
@@ -113,18 +113,18 @@
                }
        } else {
                armreg_tlbiall_write(0);
-               arm_isb();
+               isb();
                if (__predict_false(vivt_icache_p)) {
                        armreg_iciallu_write(0);
                }
        }
-       arm_isb();
+       isb();
 }
 
 void
 tlb_invalidate_addr(vaddr_t va, tlb_asid_t asid)
 {
-       arm_dsb();
+       dsb(sy);
        va = trunc_page(va) | asid;
        for (vaddr_t eva = va + PAGE_SIZE; va < eva; va += L2_S_SIZE) {
                if (arm_has_mpext_p) {
@@ -133,7 +133,7 @@
                        armreg_tlbimva_write(va);
                }
        }
-       arm_isb();
+       isb();
 }
 
 bool
@@ -153,7 +153,7 @@
                        armreg_tlbdataop_write(
                             __SHIFTIN(way, ARM_TLBDATAOP_WAY)
                             | __SHIFTIN(va_index, ARM_A5_TLBDATAOP_INDEX));
-                       arm_isb();
+                       isb();
                        const uint64_t d = ((uint64_t) armreg_tlbdata1_read())
                            | armreg_tlbdata0_read();
                        if (!(d & ARM_TLBDATA_VALID)
@@ -185,7 +185,7 @@
                        armreg_tlbdataop_write(
                             __SHIFTIN(way, ARM_TLBDATAOP_WAY)
                             | __SHIFTIN(va_index, ARM_A7_TLBDATAOP_INDEX));
-                       arm_isb();
+                       isb();
                        const uint32_t d0 = armreg_tlbdata0_read();
                        const uint32_t d1 = armreg_tlbdata1_read();
                        if (!(d0 & ARM_TLBDATA_VALID)
diff -r bcbe31594999 -r 418cd75cf0ee sys/arch/arm/arm32/armv7_generic_space.c
--- a/sys/arch/arm/arm32/armv7_generic_space.c  Fri Oct 30 18:47:38 2020 +0000
+++ b/sys/arch/arm/arm32/armv7_generic_space.c  Fri Oct 30 18:54:35 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: armv7_generic_space.c,v 1.12 2020/06/20 07:10:36 skrll Exp $   */
+/*     $NetBSD: armv7_generic_space.c,v 1.13 2020/10/30 18:54:36 skrll Exp $   */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: armv7_generic_space.c,v 1.12 2020/06/20 07:10:36 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: armv7_generic_space.c,v 1.13 2020/10/30 18:54:36 skrll Exp $");
 
 #include <sys/param.h>
 
@@ -374,7 +374,7 @@
        flags &= BUS_SPACE_BARRIER_READ|BUS_SPACE_BARRIER_WRITE;
 
        if (flags)
-               arm_dsb();
+               dsb(sy);
 }
 
 void *
diff -r bcbe31594999 -r 418cd75cf0ee sys/arch/arm/arm32/db_machdep.c
--- a/sys/arch/arm/arm32/db_machdep.c   Fri Oct 30 18:47:38 2020 +0000
+++ b/sys/arch/arm/arm32/db_machdep.c   Fri Oct 30 18:54:35 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: db_machdep.c,v 1.36 2020/09/29 19:58:49 jmcneill Exp $ */
+/*     $NetBSD: db_machdep.c,v 1.37 2020/10/30 18:54:36 skrll Exp $    */
 
 /*
  * Copyright (c) 1996 Mark Brinicombe
@@ -34,7 +34,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_machdep.c,v 1.36 2020/09/29 19:58:49 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_machdep.c,v 1.37 2020/10/30 18:54:36 skrll Exp $");
 
 #include <sys/param.h>
 
@@ -135,9 +135,11 @@
        { DDB_ADD_CMD("reset",  db_reset_cmd,           0,
                        "Reset the system",
                        NULL,NULL) },
+#ifdef _ARM_ARCH_7
        { DDB_ADD_CMD("tlb",    db_show_tlb_cmd,        0,
                        "Displays the TLB",
                        NULL,NULL) },
+#endif
 #endif /* _KERNEL */
 
        { DDB_ADD_CMD(NULL,     NULL,           0,NULL,NULL,NULL) }
@@ -403,6 +405,7 @@
        return NULL;
 }
 
+#ifdef _ARM_ARCH_7
 void
 db_show_tlb_cmd(db_expr_t addr, bool have_addr, db_expr_t count, const char *modif)
 {
@@ -420,7 +423,7 @@
                        armreg_tlbdataop_write(



Home | Main Index | Thread Index | Old Index