diff mbox series

[29/36] xen/arm: add dump function for coloring info

Message ID 20220304174701.1453977-30-marco.solieri@minervasys.tech (mailing list archive)
State New, archived
Headers show
Series Arm cache coloring | expand

Commit Message

Marco Solieri March 4, 2022, 5:46 p.m. UTC
From: Luca Miccio <lucmiccio@gmail.com>

Display general information about coloring support both during boot and
when requested by the user.

Signed-off-by: Luca Miccio <lucmiccio@gmail.com>
Signed-off-by: Marco Solieri <marco.solieri@minervasys.tech>
Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
---
 xen/arch/arm/coloring.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
diff mbox series

Patch

diff --git a/xen/arch/arm/coloring.c b/xen/arch/arm/coloring.c
index aae3c77a7b..c590e1629a 100644
--- a/xen/arch/arm/coloring.c
+++ b/xen/arch/arm/coloring.c
@@ -24,6 +24,7 @@ 
 #include <xen/types.h>
 #include <xen/lib.h>
 #include <xen/errno.h>
+#include <xen/keyhandler.h>
 #include <xen/param.h>
 
 #include <asm/sysregs.h>
@@ -434,6 +435,29 @@  void coloring_dump_info(struct domain *d)
     printk("]\n");
 }
 
+static void dump_coloring_info(unsigned char key)
+{
+    int i;
+
+    printk("Coloring general information\n");
+    printk("Way size: %"PRIu64"kB\n", way_size >> 10);
+    printk("Max. number of colors available: %"PRIu32"\n", max_col_num);
+
+    printk("Xen color(s):\t[");
+    for ( i = 0; i < xen_col_num; i++ )
+        printk(" %"PRIu32" ", xen_col_list[i]);
+    printk("]\n");
+}
+
+static __init int register_heap_trigger(void)
+{
+    register_keyhandler('C', dump_coloring_info, "dump coloring general info", 1);
+
+    /* Also print general information once at boot */
+    dump_coloring_info('C');
+    return 0;
+}
+__initcall(register_heap_trigger);
 /*
  * Local variables:
  * mode: C