From owner-dev-commits-src-main@freebsd.org Wed Sep 22 23:27:48 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 29842674B9B; Wed, 22 Sep 2021 23:27:48 +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 4HFDx00Vc5z3pmc; Wed, 22 Sep 2021 23:27:48 +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 E53762042C; Wed, 22 Sep 2021 23:27:47 +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 18MNRlGr040306; Wed, 22 Sep 2021 23:27:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18MNRlAi040305; Wed, 22 Sep 2021 23:27:47 GMT (envelope-from git) Date: Wed, 22 Sep 2021 23:27:47 GMT Message-Id: <202109222327.18MNRlAi040305@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Houchard Subject: git: f4b7018af11a - main - truss: Decode correctly 64bits arguments on 32bits arm. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cognet X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f4b7018af11a1ab3edfcce8bc0bfa521364cdeb0 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: Wed, 22 Sep 2021 23:27:48 -0000 The branch main has been updated by cognet: URL: https://cgit.FreeBSD.org/src/commit/?id=f4b7018af11a1ab3edfcce8bc0bfa521364cdeb0 commit f4b7018af11a1ab3edfcce8bc0bfa521364cdeb0 Author: Olivier Houchard AuthorDate: 2021-09-22 23:23:07 +0000 Commit: Olivier Houchard CommitDate: 2021-09-22 23:26:42 +0000 truss: Decode correctly 64bits arguments on 32bits arm. Mostly revert ebbc3140ca0d7eee154f7a67ccdae7d3d88d13fd. We don't need to special-case anything for arm64, the check for the pointer size is already done for us, just keep the bits about having arm and arm64 having to add padding for 32bits binaries. MFC after: 1 week --- usr.bin/truss/syscalls.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/usr.bin/truss/syscalls.c b/usr.bin/truss/syscalls.c index 9cd53e71cc9b..128ae624cf5f 100644 --- a/usr.bin/truss/syscalls.c +++ b/usr.bin/truss/syscalls.c @@ -792,14 +792,11 @@ print_mask_arg32(bool (*decoder)(FILE *, uint32_t, uint32_t *), FILE *fp, * decoding arguments. */ static void -quad_fixup(struct procabi *abi, struct syscall_decode *sc) +quad_fixup(struct syscall_decode *sc) { int offset, prev; u_int i; -#ifndef __aarch64__ - (void)abi; -#endif offset = 0; prev = -1; for (i = 0; i < sc->nargs; i++) { @@ -820,13 +817,10 @@ quad_fixup(struct procabi *abi, struct syscall_decode *sc) * not aligned, the calling convention inserts * a 32-bit pad argument that should be skipped. */ -#ifdef __aarch64__ - if (abi->pointer_size == sizeof(uint32_t)) -#endif - if (sc->args[i].offset % 2 == 1) { - sc->args[i].offset++; - offset++; - } + if (sc->args[i].offset % 2 == 1) { + sc->args[i].offset++; + offset++; + } #endif offset++; default: @@ -860,7 +854,7 @@ add_syscall(struct procabi *abi, u_int number, struct syscall *sc) * procabi instead. */ if (abi->pointer_size == 4) - quad_fixup(abi, &sc->decode); + quad_fixup(&sc->decode); if (number < nitems(abi->syscalls)) { assert(abi->syscalls[number] == NULL);