Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/ia64/ia64 In map_vhpt(), read pmap_vhpt_log2size be...



details:   https://anonhg.NetBSD.org/src/rev/b22268ac6629
branches:  trunk
changeset: 998437:b22268ac6629
user:      scole <scole%NetBSD.org@localhost>
date:      Fri Apr 19 16:28:32 2019 +0000

description:
In map_vhpt(), read pmap_vhpt_log2size before any memory translation
instructions to avoid "Data Nested TLB faults" with GCC 7.4.0

diffstat:

 sys/arch/ia64/ia64/machdep.c |  14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diffs (37 lines):

diff -r be1254322be1 -r b22268ac6629 sys/arch/ia64/ia64/machdep.c
--- a/sys/arch/ia64/ia64/machdep.c      Fri Apr 19 01:52:55 2019 +0000
+++ b/sys/arch/ia64/ia64/machdep.c      Fri Apr 19 16:28:32 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.42 2019/04/06 03:06:25 thorpej Exp $     */
+/*     $NetBSD: machdep.c,v 1.43 2019/04/19 16:28:32 scole Exp $       */
 
 /*-
  * Copyright (c) 2003,2004 Marcel Moolenaar
@@ -267,18 +267,24 @@
         pt_entry_t pte;
         uint64_t psr;
 
+       /*
+        * XXX read pmap_vhpt_log2size before any memory translation
+        * instructions to avoid "Data Nested TLB faults".  Not
+        * exactly sure why this is needed with GCC 7.4
+        */
+       register uint64_t log2size = pmap_vhpt_log2size << 2;
+       
         pte = PTE_PRESENT | PTE_MA_WB | PTE_ACCESSED | PTE_DIRTY |
                PTE_PL_KERN | PTE_AR_RW;
         pte |= vhpt & PTE_PPN_MASK;
 
-        __asm __volatile("ptr.d %0,%1" :: "r"(vhpt),
-                        "r"(pmap_vhpt_log2size << 2));
+        __asm __volatile("ptr.d %0,%1" :: "r"(vhpt), "r"(log2size));
 
         __asm __volatile("mov   %0=psr" : "=r"(psr));
         __asm __volatile("rsm   psr.ic|psr.i");
         ia64_srlz_i();
         ia64_set_ifa(vhpt);
-        ia64_set_itir(pmap_vhpt_log2size << 2);
+       ia64_set_itir(log2size);
         ia64_srlz_d();
         __asm __volatile("itr.d dtr[%0]=%1" :: "r"(3), "r"(pte));
         __asm __volatile("mov   psr.l=%0" :: "r" (psr));



Home | Main Index | Thread Index | Old Index