[PATCH] ARM: cpuinfo: print exception level

Ahmad Fatoum a.fatoum at pengutronix.de
Thu Jun 2 03:28:50 PDT 2022


barebox boot on ARMv8 usually involves switching exception level, but
nevertheless during bring up, it can be useful to query exception level
from the command line. Thus add it to cpuinfo output. There's no
straight equivalent for ARMv7, so we #ifdef it out for non-v8.

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 arch/arm/cpu/cpuinfo.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/cpu/cpuinfo.c b/arch/arm/cpu/cpuinfo.c
index 8a92432e904f..aea50e80d194 100644
--- a/arch/arm/cpu/cpuinfo.c
+++ b/arch/arm/cpu/cpuinfo.c
@@ -230,6 +230,10 @@ static int do_cpuinfo(int argc, char *argv[])
 			printf("core: %s r%up%u\n", part, major, minor);
 	}
 
+#ifdef CONFIG_CPU_64v8
+	printf("exception level: %u\n", current_el());
+#endif
+
 	if (cache & (1 << 24)) {
 		/* separate I/D cache */
 		printf("I-cache: ");
-- 
2.30.2




More information about the barebox mailing list