Signed-off-by: Andrea Bastoni <[email protected]>
---
hypervisor/arch/arm64/Kbuild | 6 +++++-
hypervisor/arch/arm64/include/asm/cache_layout.h | 2 ++
hypervisor/arch/arm64/include/asm/coloring.h | 14 ++++++++++++--
3 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/hypervisor/arch/arm64/Kbuild b/hypervisor/arch/arm64/Kbuild
index 3f5aebcd..c0705f12 100644
--- a/hypervisor/arch/arm64/Kbuild
+++ b/hypervisor/arch/arm64/Kbuild
@@ -23,4 +23,8 @@ lib-y := $(common-objs-y)
lib-y += entry.o setup.o control.o mmio.o paging.o caches.o traps.o
lib-y += iommu.o smmu-v3.o ti-pvu.o
lib-y += smmu.o
-lib-y += coloring.o cache_layout.o
+lib-y += coloring.o
+
+ifdef CONFIG_DEBUG
+lib-y += cache_layout.o
+endif
diff --git a/hypervisor/arch/arm64/include/asm/cache_layout.h
b/hypervisor/arch/arm64/include/asm/cache_layout.h
index 959388f5..aad4339d 100644
--- a/hypervisor/arch/arm64/include/asm/cache_layout.h
+++ b/hypervisor/arch/arm64/include/asm/cache_layout.h
@@ -13,7 +13,9 @@
* This work is licensed under the terms of the GNU GPL, version 2. See the
* COPYING file in the top-level directory.
*/
+#ifdef CONFIG_DEBUG
/** Autodetect cache(s) geometry.
* Return the size of a way or 0 if no cache was detected.
*/
extern u64 arm_cache_layout_detect(void);
+#endif
diff --git a/hypervisor/arch/arm64/include/asm/coloring.h
b/hypervisor/arch/arm64/include/asm/coloring.h
index b01f605e..f8bc1107 100644
--- a/hypervisor/arch/arm64/include/asm/coloring.h
+++ b/hypervisor/arch/arm64/include/asm/coloring.h
@@ -23,8 +23,12 @@
#include <jailhouse/assert.h>
#include <asm/cache_layout.h>
+#ifdef CONFIG_DEBUG
#define col_print(fmt, ...) \
printk("[COL] " fmt, ##__VA_ARGS__)
+#else
+#define col_print(fmt, ...) do { } while (0)
+#endif
/** Color operations */
#define COL_OP_CREATE 0x1
@@ -68,14 +72,20 @@ static inline void arm_color_dcache_flush_memory_region(
static inline void arm_color_init(void)
{
coloring_way_size = system_config->platform_info.color.way_size;
+#ifdef CONFIG_DEBUG
if (coloring_way_size == 0) {
coloring_way_size = arm_cache_layout_detect();
}
+
+ if (coloring_way_size == 0) {
+ col_print("Warning: no way size configured.\n");
+ }
+#endif
coloring_root_map_offset =
system_config->platform_info.color.root_map_offset;
- col_print("Way size: 0x%llx, TMP load addr: 0x%llx\n",
- coloring_way_size, coloring_root_map_offset);
+ printk("Init Coloring: Way size: 0x%llx, TMP load addr: 0x%llx\n",
+ coloring_way_size, coloring_root_map_offset);
}
/* ------------------------- COLORING API ---------------------------------- */
--
2.29.2
--
You received this message because you are subscribed to the Google Groups
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jailhouse-dev/20210125120044.56794-14-andrea.bastoni%40tum.de.