From owner-dev-commits-src-main@freebsd.org Tue Jan 12 10:33:35 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7910A4D200E; Tue, 12 Jan 2021 10:33:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DFRkR34RFz4kd6; Tue, 12 Jan 2021 10:33:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5AB382B81E; Tue, 12 Jan 2021 10:33:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10CAXZtD004741; Tue, 12 Jan 2021 10:33:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10CAXZFe004740; Tue, 12 Jan 2021 10:33:35 GMT (envelope-from git) Date: Tue, 12 Jan 2021 10:33:35 GMT Message-Id: <202101121033.10CAXZFe004740@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: f74397658390 - main - dtrace: Blacklist riscv exception handlers for fbt MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f74397658390237200cc19cae133ea1073e7bf6d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2021 10:33:35 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=f74397658390237200cc19cae133ea1073e7bf6d commit f74397658390237200cc19cae133ea1073e7bf6d Author: Kristof Provost AuthorDate: 2021-01-11 20:23:22 +0000 Commit: Kristof Provost 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);