Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/cpuctl/arch Add Load Only TLB and Store Only TLB.



details:   https://anonhg.NetBSD.org/src/rev/231db89545f6
branches:  trunk
changeset: 987471:231db89545f6
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Mon Sep 27 16:52:15 2021 +0000

description:
Add Load Only TLB and Store Only TLB.

diffstat:

 sys/arch/x86/include/cacheinfo.h |   6 ++++--
 usr.sbin/cpuctl/arch/i386.c      |  18 +++++++++++++++---
 2 files changed, 19 insertions(+), 5 deletions(-)

diffs (67 lines):

diff -r df21fc1b2e0e -r 231db89545f6 sys/arch/x86/include/cacheinfo.h
--- a/sys/arch/x86/include/cacheinfo.h  Mon Sep 27 16:47:15 2021 +0000
+++ b/sys/arch/x86/include/cacheinfo.h  Mon Sep 27 16:52:15 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cacheinfo.h,v 1.28 2019/07/26 10:03:40 msaitoh Exp $   */
+/*     $NetBSD: cacheinfo.h,v 1.29 2021/09/27 16:52:15 msaitoh Exp $   */
 
 #ifndef _X86_CACHEINFO_H_
 #define _X86_CACHEINFO_H_
@@ -37,8 +37,10 @@
 #define CAI_L2_STLB2   17              /* Shared L2 TLB (4K/2M pages) */
 #define CAI_L2_STLB3   18              /* Shared L2 TLB (2M/4M pages) */
 #define CAI_PREFETCH   19              /* Prefetch */
+#define CAI_L1_LD_TLB  20              /* L1 Load Only TLB */
+#define CAI_L1_ST_TLB  21              /* L1 Store Only TLB */
+#define        CAI_COUNT       22
 
-#define        CAI_COUNT       20
 
 /*
  * AMD Cache Info:
diff -r df21fc1b2e0e -r 231db89545f6 usr.sbin/cpuctl/arch/i386.c
--- a/usr.sbin/cpuctl/arch/i386.c       Mon Sep 27 16:47:15 2021 +0000
+++ b/usr.sbin/cpuctl/arch/i386.c       Mon Sep 27 16:52:15 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i386.c,v 1.119 2021/09/27 16:47:15 msaitoh Exp $       */
+/*     $NetBSD: i386.c,v 1.120 2021/09/27 16:52:15 msaitoh Exp $       */
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: i386.c,v 1.119 2021/09/27 16:47:15 msaitoh Exp $");
+__RCSID("$NetBSD: i386.c,v 1.120 2021/09/27 16:52:15 msaitoh Exp $");
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -1132,7 +1132,11 @@
                                        caitype = CAI_DTLB;
                                        break;
                                }
-                       } else
+                       } else if (type == CPUID_DATP_TCTYPE_L)
+                               caitype = CAI_L1_LD_TLB;
+                       else if (type == CPUID_DATP_TCTYPE_S)
+                               caitype = CAI_L1_ST_TLB;
+                       else
                                caitype = -1;
                        break;
                case 2:
@@ -2488,6 +2492,14 @@
        if (sep != NULL)
                aprint_verbose("\n");
 
+       sep = print_tlb_config(ci, CAI_L1_LD_TLB, "Load only TLB:", NULL);
+       if (sep != NULL)
+               aprint_verbose("\n");
+
+       sep = print_tlb_config(ci, CAI_L1_ST_TLB, "Store only TLB:", NULL);
+       if (sep != NULL)
+               aprint_verbose("\n");
+
        sep = print_tlb_config(ci, CAI_L2_ITLB, "L2 ITLB:", NULL);
        sep = print_tlb_config(ci, CAI_L2_ITLB2, "L2 ITLB:", sep);
        if (sep != NULL)



Home | Main Index | Thread Index | Old Index