]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
xtensa: report trax and perf counters in cpuinfo
authorMax Filippov <jcmvbkbc@gmail.com>
Sun, 21 May 2023 20:50:20 +0000 (13:50 -0700)
committerMax Filippov <jcmvbkbc@gmail.com>
Tue, 13 Jun 2023 02:48:57 +0000 (19:48 -0700)
Add 'trax' to the list of CPU features when xtensa core is configured
with TRAX.
Add 'perf' to the list of CPU features when xtensa core is configured
with perf counters and show the number of configured perf counters.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
arch/xtensa/include/asm/core.h
arch/xtensa/kernel/setup.c

index f856d2bcb9f3618d9b8025b438590f5bed687f76..0e1bb6f019d6b09293f6e16e7abb6297436bb0c9 100644 (file)
 #define XCHAL_SPANNING_WAY 0
 #endif
 
+#ifndef XCHAL_HAVE_TRAX
+#define XCHAL_HAVE_TRAX 0
+#endif
+
+#ifndef XCHAL_NUM_PERF_COUNTERS
+#define XCHAL_NUM_PERF_COUNTERS 0
+#endif
+
 #if XCHAL_HAVE_WINDOWED
 #if defined(CONFIG_USER_ABI_DEFAULT) || defined(CONFIG_USER_ABI_CALL0_PROBE)
 /* Whether windowed ABI is supported in userspace. */
index 5680391d7e35f4e8796c95b916005725ca2b78d9..34212a240b9999bac231cf533f7cb13691bd9fc7 100644 (file)
@@ -586,6 +586,12 @@ c_show(struct seq_file *f, void *slot)
 # if XCHAL_HAVE_OCD
                     "ocd "
 # endif
+#if XCHAL_HAVE_TRAX
+                    "trax "
+#endif
+#if XCHAL_NUM_PERF_COUNTERS
+                    "perf "
+#endif
 #endif
 #if XCHAL_HAVE_DENSITY
                     "density "
@@ -635,11 +641,13 @@ c_show(struct seq_file *f, void *slot)
        seq_printf(f,"physical aregs\t: %d\n"
                     "misc regs\t: %d\n"
                     "ibreak\t\t: %d\n"
-                    "dbreak\t\t: %d\n",
+                    "dbreak\t\t: %d\n"
+                    "perf counters\t: %d\n",
                     XCHAL_NUM_AREGS,
                     XCHAL_NUM_MISC_REGS,
                     XCHAL_NUM_IBREAK,
-                    XCHAL_NUM_DBREAK);
+                    XCHAL_NUM_DBREAK,
+                    XCHAL_NUM_PERF_COUNTERS);
 
 
        /* Interrupt. */