From nobody Sat Jun 03 17:05:18 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 4QYR7z0nspz4Z91j; Sat, 3 Jun 2023 17:05:19 +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 4QYR7z03fdz3HTs; Sat, 3 Jun 2023 17:05:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685811919; 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=aqSjiXgQZnCezwOZIgzVboOg0xO8fBFcuPk6okMU71s=; b=SjEvxw7482dPAuu4Te+Zzgw+dDf6cAU3fwFmGBHnKqjSEdhTxVL3l0JCJFhsKKRxXnwgQp AP70opSOSIjZII6rI9sXOuBNIAYxMrluEJMrtroAV2tIhEc2fxpi4bejPT+088UjBGu9fD 2FT3KDqaAOUHnz7VBH1pdKqJRaAmFe/J562sQcjMnNuuHQtgxhBdgmzbB2jJpmtZKAPgHN f8pLOwU4yHfle9mr+xglkMdhXdhkvOJqRp6a0E8G4Rb2XNzLINi0FQu2sOz0fG2xJCyhgg dwcPx16lqyXzU+lgUV/YgTco3cSBWI0mmm/TpKHHM1S5eGScmBW7KZN3nymvlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685811919; 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=aqSjiXgQZnCezwOZIgzVboOg0xO8fBFcuPk6okMU71s=; b=vnW0wfZAJw+chGlCkZH1y+hfOv+mxf99GEImzrLenMYZJ8CcFPZqlDKK0vgJnmN6PK0B5X WX+LXvnjCf2JqVtT0cZGeoCvYMCS5F4oTxbIyKPU6RvWwNPHsdXMKZBc2G2UaIVcbd4OzK /cv2vaHpovXySvxbDel124duOCCWRJ9hFWSXM8CR6mlZp5zwTqFyk986Ysluz72Uyrk2/9 A9LDuQ/mFnFqe9eaOlwsRTorugGb3gnoCZe57+zAmyIrf489rZCfOnOfJo6w7hA58d0blb 1nPKijhy70tZyc8ExVuDWDm1egdReE+qHC960XWjH5VasBoe8h+/I/vM0btaMg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685811919; a=rsa-sha256; cv=none; b=LGCIbMWqZRIKRon6c1LJ9hejUNwDLfjc98Hiep6L/0N7YgsEFofg0+o2bVvVyP9tviRGOE i5r+RF+Jh4XgdR6U2ne0PA+XxqWoEn1lE4cT/5oFv+rI1xy6OS7+q/y2J7agkEZmQe/YPp 1zbDagqxK2ejoLB6lHLrhiGiaEEL+C49CU0ZwWZKtsYc86duC33vFdXcyTv2qW0/FkEFQZ w/SwUHEx2urdO4JGIJb6LAASOkDlBCl4IJIxNnCgxc99R2KSqUy7Ns9vxW8c8gDHy2h/sZ FLc993JlZRnsLpoxKmBbrqhfpByXmG+wKXYBLf5g28MHev6ZI+hx7huHu6y5Ow== 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 4QYR7y6DM2zYKs; Sat, 3 Jun 2023 17:05:18 +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 353H5IUw019441; Sat, 3 Jun 2023 17:05:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 353H5Ith019440; Sat, 3 Jun 2023 17:05:18 GMT (envelope-from git) Date: Sat, 3 Jun 2023 17:05:18 GMT Message-Id: <202306031705.353H5Ith019440@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 980746e5cb26 - main - fbt: simplify arm64 function-prologue parsing 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: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 980746e5cb264a70ad3dcbbf38ba919ad3436aa1 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=980746e5cb264a70ad3dcbbf38ba919ad3436aa1 commit 980746e5cb264a70ad3dcbbf38ba919ad3436aa1 Author: Christos Margiolis AuthorDate: 2023-06-03 17:04:33 +0000 Commit: Christos Margiolis CommitDate: 2023-06-03 17:04:33 +0000 fbt: simplify arm64 function-prologue parsing Reviewed by: markj Approved by: markj (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40364 --- sys/cddl/dev/fbt/aarch64/fbt_isa.c | 42 +++++++++++++++----------------------- 1 file changed, 16 insertions(+), 26 deletions(-) diff --git a/sys/cddl/dev/fbt/aarch64/fbt_isa.c b/sys/cddl/dev/fbt/aarch64/fbt_isa.c index cc4ea42715c8..4b32d42ca0b4 100644 --- a/sys/cddl/dev/fbt/aarch64/fbt_isa.c +++ b/sys/cddl/dev/fbt/aarch64/fbt_isa.c @@ -130,35 +130,25 @@ fbt_provide_module_function(linker_file_t lf, int symindx, */ if (*instr == NOP_INSTR) found = true; - if (!found) { - for (; instr < limit; instr++) { + for (; !found && instr < limit; instr++) { + /* + * Functions start with "stp xt1, xt2, [xn, ]!" or + * "sub sp, sp, ". + * + * Sometimes the compiler will have a sub instruction that is + * not of the above type so don't stop if we see one. + */ + if ((*instr & LDP_STP_MASK) == STP_64) { /* - * Some functions start with - * "stp xt1, xt2, [xn, ]!" + * Assume any other store of this type means we are + * past the function prologue. */ - if ((*instr & LDP_STP_MASK) == STP_64) { - /* - * Assume any other store of this type means we - * are past the function prolog. - */ - if (((*instr >> ADDR_SHIFT) & ADDR_MASK) == 31) - found = true; - break; - } - - /* - * Some functions start with a "sub sp, sp, " - * Sometimes the compiler will have a sub instruction - * that is not of the above type so don't stop if we - * see one. - */ - if ((*instr & SUB_MASK) == SUB_INSTR && - ((*instr >> SUB_RD_SHIFT) & SUB_R_MASK) == 31 && - ((*instr >> SUB_RN_SHIFT) & SUB_R_MASK) == 31) { + if (((*instr >> ADDR_SHIFT) & ADDR_MASK) == 31) found = true; - break; - } - } + } else if ((*instr & SUB_MASK) == SUB_INSTR && + ((*instr >> SUB_RD_SHIFT) & SUB_R_MASK) == 31 && + ((*instr >> SUB_RN_SHIFT) & SUB_R_MASK) == 31) + found = true; } if (!found)