From nobody Thu Aug 25 11:17:41 2022 X-Original-To: dev-commits-src-main@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 4MD0n162BHz4ZHyb; Thu, 25 Aug 2022 11:17:41 +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 4MD0n15RWDz3xB9; Thu, 25 Aug 2022 11:17:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1661426261; 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=apKGdcUvZv48++smBtku/6LY2+bQpb/y22TSoGSDszI=; b=Jy+IT8ep6a7zl93hhtGJGhkGwK+kbw7MchPCkApCP1AG+J5C14u4+Clc2gsHfJ6VHRmtNH I1bas3i7islxP5Ui2RK0XUvOKUj8ZSnLs0ttRnutEINYwZ4UNt+lJVl5xiUwDdE5qnM5Hh DM+oNCaQdvvqnQw1PyuK0hTawrxhkdd3p0h8aPiWEVjXpozUncgT94IToZKIOmHXbSdx+/ 3xAv+BhjyBAB+wiwR9wJ1/3Mx1TJ1ccEAbxa2d3PoRyElVydPO4LzctnziG2Tx1KtA4ftC fUBj+Uu1JQfggRLqcKXaYokA3V+o+O9O+fTNVUnedLk00yWA45yDVAlJZVHYvQ== 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 4MD0n13thvzlsV; Thu, 25 Aug 2022 11:17:41 +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 27PBHf0Q010624; Thu, 25 Aug 2022 11:17:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 27PBHf6b010623; Thu, 25 Aug 2022 11:17:41 GMT (envelope-from git) Date: Thu, 25 Aug 2022 11:17:41 GMT Message-Id: <202208251117.27PBHf6b010623@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 48a7e53db782 - main - Merge the common parts of the SMCCC handlers List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 48a7e53db78293ba2723cecfb3a3d5d23ea8e44d Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1661426261; 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=apKGdcUvZv48++smBtku/6LY2+bQpb/y22TSoGSDszI=; b=ljW0rvda4mxqBvI/LBlPbe83vtJllo2xwdW/dMET60YxADuBOCJ+wbYw3w2qUTwVMM4ymR 3LgpjuGquRr/kIWRGP3u+nmMilaXc2aQsCI/fuAtJQfDeBVtsd8qrJ1ty+UengU6R/jYrC P7o+S/b9kdy2tYXITVFq3+qq1TVGAjOHP4FODIL2Rrs7YB7Yh5NNt/PuihZNWunrL9Xk1U YSA80UbaUM4bHZRjRYmBU9tYNbbyga8oKTfvu/fZ8D6DLBxX/Zoh/+8Wzv1hAZdVerdYAs 5O63d2lNqn4gjIh5Exerp4B3jT3TJvjUP1GZleqO8tPpmkuU5A5y4boq3Kc1bA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1661426261; a=rsa-sha256; cv=none; b=emGE49y0KdJfYeMErNfEu+vpJuuvQhJ2VtAY/fSB+9CUN362bVIiKbkeyDa1XCC4gNkK8U Y4qkGuCxN0468C8gmQKW9SYMQo4ChqM12bXvsWxNCzA/qUgAXee6rVvBqIGJREOzZAS93X +QGlE0SOcCBY0Uhyvv5vAdXKTrtUCf+PIm9Y7oHj6Pq4I9qbwOSsLiU2YnOkiM39lOA7zi 09N4ZlOosIwi9acoCUFMTgqI5D7co5iE0WmKT8D6rjA203BmFNVccFYxdkiZn9/bZT15XN ebCU3Q3bXtDyfMnRq+poKSJEBC65xSxSYrAuVx76xQ+2EGWp+9u1hGPAK7KD9g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=48a7e53db78293ba2723cecfb3a3d5d23ea8e44d commit 48a7e53db78293ba2723cecfb3a3d5d23ea8e44d Author: Andrew Turner AuthorDate: 2022-08-22 17:09:28 +0000 Commit: Andrew Turner CommitDate: 2022-08-25 11:17:28 +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 --- 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