From ed369cd57e5bbe621e3c9f17a2531ca6ffacc874 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciro=20Santilli=20=E5=85=AD=E5=9B=9B=E4=BA=8B=E4=BB=B6=20?= =?UTF-8?q?=E6=B3=95=E8=BD=AE=E5=8A=9F?= Date: Wed, 3 Jun 2020 01:00:00 +0000 Subject: [PATCH] userland/arch/aarch64/dump_regs.c --- README.adoc | 4 +++- path_properties.py | 4 ++++ userland/arch/aarch64/dump_regs.c | 13 +++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 userland/arch/aarch64/dump_regs.c diff --git a/README.adoc b/README.adoc index edd841e..295995c 100644 --- a/README.adoc +++ b/README.adoc @@ -9300,8 +9300,10 @@ Converting `arch/*` images to `vmlinux` is possible in theory x86 with https://g The following kernel modules and <> executables dump and disassemble various registers which cannot be observed from userland (usually "system registers", "control registers"): * link:kernel_modules/dump_regs.c[] -* link:baremetal/arch/aarch64/dump_regs.c[] +* link:userland/arch/arm/dump_regs.c[] +* link:userland/arch/aarch64/dump_regs.c[] * link:baremetal/arch/arm/dump_regs.c[] +* link:baremetal/arch/aarch64/dump_regs.c[] Some of those programs are using: diff --git a/path_properties.py b/path_properties.py index 7316296..f51b13d 100644 --- a/path_properties.py +++ b/path_properties.py @@ -544,6 +544,10 @@ path_properties_tuples = ( }, }, ), + 'dump_regs.c': { + # https://gem5.atlassian.net/browse/GEM5-619 + 'allowed_emulators': {'qemu'}, + }, 'freestanding': ( freestanding_properties, { diff --git a/userland/arch/aarch64/dump_regs.c b/userland/arch/aarch64/dump_regs.c new file mode 100644 index 0000000..947dc76 --- /dev/null +++ b/userland/arch/aarch64/dump_regs.c @@ -0,0 +1,13 @@ +/* https://cirosantilli.com/linux-kernel-module-cheat#dump-regs */ + +#include +#include + +#include +#include + +int main(void) { + lkmc_sysreg_print_cntvct_el0(); + lkmc_sysreg_print_cntfrq_el0(); + return EXIT_SUCCESS; +}