git: f74397658390 - main - dtrace: Blacklist riscv exception handlers for fbt

Kristof Provost kp at FreeBSD.org
Tue Jan 12 10:33:35 UTC 2021


The branch main has been updated by kp:

URL: https://cgit.FreeBSD.org/src/commit/?id=f74397658390237200cc19cae133ea1073e7bf6d

commit f74397658390237200cc19cae133ea1073e7bf6d
Author:     Kristof Provost <kp at FreeBSD.org>
AuthorDate: 2021-01-11 20:23:22 +0000
Commit:     Kristof Provost <kp at FreeBSD.org>
CommitDate: 2021-01-12 09:33:16 +0000

    dtrace: Blacklist riscv exception handlers for fbt
    
    We can't safely instrument those exception handlers, so blacklist them.
    
    Test case: dtrace -n :::
    
    Reviewed by:            markj (previous version)
    Differential Revision:  https://reviews.freebsd.org/D27754
---
 sys/cddl/dev/fbt/riscv/fbt_isa.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/sys/cddl/dev/fbt/riscv/fbt_isa.c b/sys/cddl/dev/fbt/riscv/fbt_isa.c
index 406fcd3f9bea..659a9d44c81c 100644
--- a/sys/cddl/dev/fbt/riscv/fbt_isa.c
+++ b/sys/cddl/dev/fbt/riscv/fbt_isa.c
@@ -156,6 +156,19 @@ fbt_provide_module_function(linker_file_t lf, int symindx,
 	if (fbt_excluded(name))
 		return (0);
 
+	/*
+	 * Some assembly-language exception handlers are not suitable for
+	 * instrumentation.
+	 */
+	if (strcmp(name, "cpu_exception_handler") == 0)
+		return (0);
+	if (strcmp(name, "cpu_exception_handler_user") == 0)
+		return (0);
+	if (strcmp(name, "cpu_exception_handler_supervisor") == 0)
+		return (0);
+	if (strcmp(name, "do_trap_supervisor") == 0)
+		return (0);
+
 	instr = (uint32_t *)(symval->value);
 	limit = (uint32_t *)(symval->value + symval->size);
 


More information about the dev-commits-src-all mailing list