From nobody Wed Sep 21 09:46:42 2022 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 4MXYTb1Yxkz4ctWD; Wed, 21 Sep 2022 09:46:43 +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 4MXYTb0ZTNz3drT; Wed, 21 Sep 2022 09:46:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1663753603; 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=22eZNTYbivLaiASlnqjNCAn5rbupS60zBZ8JDcfGyv0=; b=eNZf/Xnz0EE334RCCjNPKOMfg4Eya78E2fny9Mj2G4JnQeS1Z5aWccUgeW5C4OzD6su9wA LEBLvhqG/XtBNseV6exccbidCBAehpMqPTOQ9l/PwU4KWnzhp/Jo/8Mta3t+OXCoebf9Ad g9Y9Vp3P0Y3OY5q1bbqaSLzKh0YA2lPa4jY5PxEDUyWKxI6iyIV1r7fgS5nA/pq07bO6sf N8Q7X4JVfyJEQCjy8H1f1jrar4WIGQshW1G6JaWfRJzc48nBgJofyfQXLhLkDCkbsk51Tk JOsmDKGLQzvtkuSqXhtZqTMmAI0m71cIh/24EvzqN8a9dgECw381aw5Mm4s03A== 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 4MXYTZ6klhz11vp; Wed, 21 Sep 2022 09:46: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 28L9kgB6076073; Wed, 21 Sep 2022 09:46:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 28L9kgth076072; Wed, 21 Sep 2022 09:46:42 GMT (envelope-from git) Date: Wed, 21 Sep 2022 09:46:42 GMT Message-Id: <202209210946.28L9kgth076072@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 4a5202fdcf13 - stable/13 - Merge the common parts of the SMCCC handlers 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: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4a5202fdcf139d03bb2e9b4fb0c0c79e9597f12b Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1663753603; 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=22eZNTYbivLaiASlnqjNCAn5rbupS60zBZ8JDcfGyv0=; b=pwrHd0Q9c2S6wcHBGB5MZnJcCSMXWvKtv8QX1Pcu/R4nBXaSj8EZogB5nYFBubENo3gayK MfhmVJ4cH5b1XuHgpF+okcJFGY0bvvcbTrHKphOtLW2nUvJSlcGU9+HzR6f/rvKFb1sQfL alHs55ja4+9kKMYbMYRnhdrSvyLB/KOOB3COxA8BeuJsWyFki+5DzoVjl9Q8cghkbrDuUr x/3CBfNvkhpFJkc9W7kUCvjsaGSTtXPW9quW8pZ+P4i5mXhr1DUgwowJXnWmnqRGs7IXA0 gYxxjZWs8myhe6PTqYs38hN5GVq+c2YDmGJ3ssd6HNOI6Y2ZHfM38OkjNUsTUA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1663753603; a=rsa-sha256; cv=none; b=ZXh6gS2h3wBYv3rizq9qzG1E0hxFEUjSuXdzztPWKHPxD65giaGtccSqvrVUubWAwNASOM Bf9c495/E3npnwCDqANu+j1+BtKs5yOdrRP0/jT0zlmSjoH+C6qXKb2gWZJqf9655tdoBr mjzJlcX0VIe9rXshTeEZKmR97IYWRX2FCxTGod3Katw0FOMYNRQ+rnvOzbh1Z1aqrrCFqP QbWNUuh8MMJvN0f43khTrBqQZVsDuWQYiO8jEIHiS8KwjNdpE6KTLX70mpsW+gDN5JlWRd zcqCE579axD9HDNyqOKr8hXmtGUfDLs4AiK8Tfsvf829CJeZm8F/CE/mOmYPxg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=4a5202fdcf139d03bb2e9b4fb0c0c79e9597f12b commit 4a5202fdcf139d03bb2e9b4fb0c0c79e9597f12b Author: Andrew Turner AuthorDate: 2022-08-22 17:09:28 +0000 Commit: Andrew Turner CommitDate: 2022-09-21 09:45:52 +0000 Merge the common parts of the SMCCC handlers To simplify adding new handlers merge the common parts of the functions used to call into the arm SMCCC firmware. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D36297 (cherry picked from commit 48a7e53db78293ba2723cecfb3a3d5d23ea8e44d) --- sys/dev/psci/smccc_arm.S | 29 ++++++++--------------------- sys/dev/psci/smccc_arm64.S | 25 ++++++++----------------- 2 files changed, 16 insertions(+), 38 deletions(-) diff --git a/sys/dev/psci/smccc_arm.S b/sys/dev/psci/smccc_arm.S index ae5a94197718..dd7cd6a690bd 100644 --- a/sys/dev/psci/smccc_arm.S +++ b/sys/dev/psci/smccc_arm.S @@ -37,38 +37,25 @@ __FBSDID("$FreeBSD$"); .arch_extension sec /* For smc */ .arch_extension virt /* For hvc */ -/* - * int arm_smccc_hvc(register_t, register_t, register_t, register_t, - * register_t, register_t, register_t, register_t, - * struct arm_smccc_res *res) - */ -ENTRY(arm_smccc_hvc) +.macro arm_smccc_1_0 insn +ENTRY(arm_smccc_\insn) mov r12, sp push {r4-r7} ldm r12, {r4-r7} - hvc #0 + \insn #0 pop {r4-r7} ldr r12, [sp, #(4 * 4)] cmp r12, #0 beq 1f stm r12, {r0-r3} 1: bx lr -END(arm_smccc_hvc) +END(arm_smccc_\insn) +.endm /* - * int arm_smccc_smc(register_t, register_t, register_t, register_t, + * int arm_smccc_hvc(register_t, register_t, register_t, register_t, * register_t, register_t, register_t, register_t, * struct arm_smccc_res *res) */ -ENTRY(arm_smccc_smc) - mov r12, sp - push {r4-r7} - ldm r12, {r4-r7} - smc #0 - pop {r4-r7} - ldr r12, [sp, #(4 * 4)] - cmp r12, #0 - beq 1f - stm r12, {r0-r3} -1: bx lr -END(arm_smccc_smc) +arm_smccc_1_0 hvc +arm_smccc_1_0 smc diff --git a/sys/dev/psci/smccc_arm64.S b/sys/dev/psci/smccc_arm64.S index 0b94a11fdf04..ba10f7493e71 100644 --- a/sys/dev/psci/smccc_arm64.S +++ b/sys/dev/psci/smccc_arm64.S @@ -33,30 +33,21 @@ #include __FBSDID("$FreeBSD$"); -/* - * int arm_smccc_hvc(register_t, register_t, register_t, register_t, - * register_t, register_t, register_t, register_t, - * struct arm_smccc_res *res) - */ -ENTRY(arm_smccc_hvc) - hvc #0 +.macro arm_smccc_1_0 insn +ENTRY(arm_smccc_\insn) + \insn #0 ldr x4, [sp] cbz x4, 1f stp x0, x1, [x4, #16 * 0] stp x2, x3, [x4, #16 * 1] 1: ret -END(arm_smccc_hvc) +END(arm_smccc_\insn) +.endm /* - * int arm_smccc_smc(register_t, register_t, register_t, register_t, + * int arm_smccc_*(register_t, register_t, register_t, register_t, * register_t, register_t, register_t, register_t, * struct arm_smccc_res *res) */ -ENTRY(arm_smccc_smc) - smc #0 - ldr x4, [sp] - cbz x4, 1f - stp x0, x1, [x4, #16 * 0] - stp x2, x3, [x4, #16 * 1] -1: ret -END(arm_smccc_smc) +arm_smccc_1_0 hvc +arm_smccc_1_0 smc