From nobody Fri Dec 06 14:51:36 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Y4Z2x2vyxz5gNYF; Fri, 06 Dec 2024 14:51:37 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Y4Z2x0tPtz4FR2; Fri, 6 Dec 2024 14:51:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733496697; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DHiHsdbkUB3hLixpCyg/ZNvEF7is1RquwHbhf/yFQFU=; b=q6cj08zkin5Jh1NDJ8kgziVfMZDJ5VcA0Fh0S/F6xrdanmlwrOJFLQWcjxxXuMR2QqcnkA XQD5vO8CPzfdv4DoQ1CLgBxqXYsrjm88KuoOg/wemGiS3lrwgdHp4Zq0m5tvCUYzTvpfqh bFy3stklAahw9acWkr7sFgIHxDijcbJYzvRnKnhQgh03vgoQ8BLMpScKWLey55x/qci6yt 7PKG/U1c2sB3FoQnOSLOVAQnkJF9mXbgDBXMsUPt/1JDcrKxRzx2tMg5lwoZQfLfecJIgi ufPOsRoz71ohxcrV2MnxKR7uiI6vBnxzpELpqkeH1KWbReRKA2JDos28WwnX2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733496697; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DHiHsdbkUB3hLixpCyg/ZNvEF7is1RquwHbhf/yFQFU=; b=IROjKb2uKdTrUV60DUzCd6U7pxVu98o21if4Rssx0s5WFxBuV4TLNKnGZ1Ij34WXQCz7/i Yd8ELi4Sda0A/jqo3qm5dA3E+p6Ud2mF6eso7YsreH0/W4Wziclbb+4nydmwIcDigFuxtX RUl56YlUssJuQ1L3Vju15dpC27IH5kebSPJ3Ss77/WGMMFH/8YPMhniSeuGy3qZ2sWeDfD aa+onzG3cHkjBd7pIhoWPw4BrEcZ+IkkRRNltIT5J1Mn3Qsp0HnziSzpfEOaslgGZfFKiS 6b+KLQx6qYHjhI3UqY3mG3Ce3/PFHVE/ya+9O1ZwHuhofu4kqTYPe6qCl9YyHw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1733496697; a=rsa-sha256; cv=none; b=JSl6KTPhcQ1sgHo8N1yh7lZ083wfpVyAC94TYrgajmV+Jo1hVkcTOipSlNZtpd7Sm4dz8E qLXEqT1+0cDJNZ9hcY4Dld0akXSNXl8AMoFtYVrZfEM2EDTlaBKlxUhjrNo0+loExmXyLp 6JitLvVLAv+2zeFOhyiJzLr6lBTL2YgrW/2hwIT9gOCQo2rtyIiykHCijoIvS6D64JD509 ao5l6b45NZSGhprGKkP4C3kD8nuXndvm3vopgM1J+hZPQhOllK415wqv0Q+nbsUYD0wFL4 aHKklbz0ouMIYFJWrkiBvluO6DKkDfpG2XR70f5Iq9C533xOGHqQYkQHtAc8zw== 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 4Y4Z2x0Tc6zj8X; Fri, 6 Dec 2024 14:51:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4B6Epa2B028288; Fri, 6 Dec 2024 14:51:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4B6EpaSQ028285; Fri, 6 Dec 2024 14:51:36 GMT (envelope-from git) Date: Fri, 6 Dec 2024 14:51:36 GMT Message-Id: <202412061451.4B6EpaSQ028285@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 6f07c8273582 - stable/14 - dtrace/amd64: Make invop providers usable with KMSAN enabled List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6f07c82735826b6bfc744318aa86040439920016 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=6f07c82735826b6bfc744318aa86040439920016 commit 6f07c82735826b6bfc744318aa86040439920016 Author: Mark Johnston AuthorDate: 2024-11-22 13:51:37 +0000 Commit: Mark Johnston CommitDate: 2024-12-06 14:51:09 +0000 dtrace/amd64: Make invop providers usable with KMSAN enabled - Use a fresh context when entering dtrace_invop() via a breakpoint exception. - Mark the #BP trapframe as initialized. MFC after: 2 weeks (cherry picked from commit cc3da1955c16df5eb0019e0fef810696b035b7cf) --- sys/cddl/dev/dtrace/amd64/dtrace_asm.S | 8 ++++++++ sys/cddl/dev/dtrace/amd64/dtrace_subr.c | 3 +++ 2 files changed, 11 insertions(+) diff --git a/sys/cddl/dev/dtrace/amd64/dtrace_asm.S b/sys/cddl/dev/dtrace/amd64/dtrace_asm.S index 4c18fbf08220..217d8c2936eb 100644 --- a/sys/cddl/dev/dtrace/amd64/dtrace_asm.S +++ b/sys/cddl/dev/dtrace/amd64/dtrace_asm.S @@ -58,6 +58,8 @@ ENTRY(dtrace_invop_start) + KMSAN_ENTER + /* * #BP traps with %rip set to the next address. We need to decrement * the value to indicate the address of the int3 (0xcc) instruction @@ -77,6 +79,12 @@ call dtrace_invop addq $16, %rsp +#ifdef KMSAN + movq %rax, %r12 + KMSAN_LEAVE + movq %r12, %rax +#endif + cmpl $DTRACE_INVOP_PUSHL_EBP, %eax je bp_push cmpl $DTRACE_INVOP_CALL, %eax diff --git a/sys/cddl/dev/dtrace/amd64/dtrace_subr.c b/sys/cddl/dev/dtrace/amd64/dtrace_subr.c index 09b820241e50..81aa53d00bd8 100644 --- a/sys/cddl/dev/dtrace/amd64/dtrace_subr.c +++ b/sys/cddl/dev/dtrace/amd64/dtrace_subr.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -68,6 +69,8 @@ dtrace_invop(uintptr_t addr, struct trapframe *frame, void **scratch) dtrace_invop_hdlr_t *hdlr; int rval; + kmsan_mark(frame, sizeof(*frame), KMSAN_STATE_INITED); + td = curthread; td->t_dtrace_trapframe = frame; rval = 0;