From nobody Thu Jun 15 16:39:42 2023 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 4Qhp0t4PCHz4fRw0; Thu, 15 Jun 2023 16:39:42 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Qhp0t3Z6qz4G28; Thu, 15 Jun 2023 16:39:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686847182; 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=3Cqa/mW7SL8nmbYHruXnM3vC3rLAGQbPpwHvRt/okBY=; b=WvyBZnBWXIeeVHH1ZmtS+G1DYA1G9XL5VQ0k562qdU/q63IHl2qNbfMFb6bK/zEL5BuTqn 0KeMZItWj0cQ8Lv8StymC2i4YNyEr68uHaZJC5ps5nYYEhYBRpfRY+N+swYlcDBazc0HiY oO1DX91c+o96wH3h+Qfu7ORk3MyLkF2F2f4AP8vUqvaB3jaKE881mQ1RW7Lfnt46odzNLr BjWaJvulugUb1/8DJ8tJi7RMWIlBqlIP5btqhbr439GkfEaj4suAXmHGvIM6uroi6uii5W 4GZM5D3oYk1UmLuzYmK/3K5FwQ1P+SiSfDR2TjKRQNFul4clfXUMB44wI8RVMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686847182; 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=3Cqa/mW7SL8nmbYHruXnM3vC3rLAGQbPpwHvRt/okBY=; b=EhmFaIqoaVupcpdd1hhna8F0+slBA4oxW7XR8orM/a7z0F1YZCPAuD1HD6G3zSO3X3kGbc 1RBTt50pNV9eel2gk7zfu1d3KbANTv/MyxrkBfwu+AhJKys+TDR/IplMo0dFRv3StJIcUl /4M1St3btVaZySaixhxRmbq1wtVjiA7VhFQVhy8Jx6kNx8dZjZ9cl+qtxHTrCEWHvL5ofp xmhmco4LgXM8zkNKIyw5POW8eCRtvWgmnYKy3IwL4KN7W6+1PLK/gB2XbvraX6hBv835GK LXZGFBvkKTrBhdqSouTciDi74XcBzr1vrV1YQHeZ+ewQAZ75NVk2rniIZ+Bpiw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686847182; a=rsa-sha256; cv=none; b=HRGHGEcSHFdW+pvtxfMl0SeyquViqK6nmenf3McwFXsXUd1y6JXHjBrhTXijJaxt2c7zZG oZi1FcxAvQ1zcZV0r/8RVVBKHVDI4v//77hY/JPgQAuxdwkwVkyAxrZD/vPyqWHflsqpiW wKeuS0LoKwt6yjAQ8foJ7r2CQ0S5C5+iYvbW1+nghoZ1UqTKJToajVToUx++zSC0XKYJgu bmdBEgdmeXKg3gpAKAAccGJ+Jyts9GUYbahd4RjLzSpRrfez6a4b4R41JZyge6xUzity5X yo1CaWlX2qUokx4dug30DsN2zXX7PJAciWLdM9A9RWZWFOZ2U7PQVe4k7ealEA== 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 4Qhp0t2d60ztB6; Thu, 15 Jun 2023 16:39:42 +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 35FGdgV2085930; Thu, 15 Jun 2023 16:39:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 35FGdgcI085929; Thu, 15 Jun 2023 16:39:42 GMT (envelope-from git) Date: Thu, 15 Jun 2023 16:39:42 GMT Message-Id: <202306151639.35FGdgcI085929@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 6281147a963b - main - dtrace/arm64: Fix user memory access routines 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/main X-Git-Reftype: branch X-Git-Commit: 6281147a963b02bb5d7b4db15ee295d6d65d0fff Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=6281147a963b02bb5d7b4db15ee295d6d65d0fff commit 6281147a963b02bb5d7b4db15ee295d6d65d0fff Author: Mark Johnston AuthorDate: 2023-06-15 16:39:21 +0000 Commit: Mark Johnston CommitDate: 2023-06-15 16:39:21 +0000 dtrace/arm64: Fix user memory access routines Use unprivileged loads to access user memory. Without this, the accesses trap and various dtrace actions such as ustack() fail. Reviewed by: andrew MFC after: 1 week Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D40540 --- sys/cddl/dev/dtrace/aarch64/dtrace_asm.S | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/sys/cddl/dev/dtrace/aarch64/dtrace_asm.S b/sys/cddl/dev/dtrace/aarch64/dtrace_asm.S index 710232a0d428..913429865421 100644 --- a/sys/cddl/dev/dtrace/aarch64/dtrace_asm.S +++ b/sys/cddl/dev/dtrace/aarch64/dtrace_asm.S @@ -72,7 +72,7 @@ uint8_t dtrace_fuword8_nocheck(void *addr) */ ENTRY(dtrace_fuword8_nocheck) - ldrb w0, [x0] + ldtrb w0, [x0] RET END(dtrace_fuword8_nocheck) @@ -81,7 +81,7 @@ uint16_t dtrace_fuword16_nocheck(void *addr) */ ENTRY(dtrace_fuword16_nocheck) - ldrh w0, [x0] + ldtrh w0, [x0] RET END(dtrace_fuword16_nocheck) @@ -90,7 +90,7 @@ uint32_t dtrace_fuword32_nocheck(void *addr) */ ENTRY(dtrace_fuword32_nocheck) - ldr w0, [x0] + ldtr w0, [x0] RET END(dtrace_fuword32_nocheck) @@ -99,7 +99,7 @@ uint64_t dtrace_fuword64_nocheck(void *addr) */ ENTRY(dtrace_fuword64_nocheck) - ldr x0, [x0] + ldtr x0, [x0] RET END(dtrace_fuword64_nocheck) @@ -110,7 +110,8 @@ dtrace_copy(uintptr_t uaddr, uintptr_t kaddr, size_t size) ENTRY(dtrace_copy) cbz x2, 2f /* If len == 0 then skip loop */ 1: - ldrb w4, [x0], #1 /* Load from uaddr */ + ldtrb w4, [x0] /* Load from uaddr */ + add x0, x0, #1 strb w4, [x1], #1 /* Store in kaddr */ sub x2, x2, #1 /* len-- */ cbnz x2, 1b @@ -126,8 +127,9 @@ XXX: Check for flags? */ ENTRY(dtrace_copystr) cbz x2, 2f /* If len == 0 then skip loop */ - -1: ldrb w4, [x0], #1 /* Load from uaddr */ +1: + ldtrb w4, [x0] /* Load from uaddr */ + add x0, x0, #1 strb w4, [x1], #1 /* Store in kaddr */ cbz w4, 2f /* If == 0 then break */ sub x2, x2, #1 /* len-- */