From nobody Mon Oct 21 15:05:19 2024 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 4XXJWz6vXcz5ZNyt; Mon, 21 Oct 2024 15: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XXJWz1l3Dz4fYC; Mon, 21 Oct 2024 15: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=1729523119; 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=ncKcSXQhqaFpLAei4KplDIKbfCb0rNgq7t+fNwINdYk=; b=gi6T8YNFffrtt8fkrTiirmuNXGwTmddm1iSxgsc5etbbKBQBhDmcyN16K3g3jfmqmkeD9y foPdMYAfE6bm8ixHjl3PtOuQEHNHsUZCZuKJzxCVBDSGem8KMepPGax1IGKX5jIoDLLzql b58eL3A5lZZTkn8vD/h1PYy1lVlhwNoQW7NTQmSlCYOStC485SOy2KluCh11U9UcXjYTEy +mIrfATevCvnkRl/4WbiWQxsQnEPdm6impeuEgKGvZtnhZHb/tJibEIr9w7BznTfgzGClP VMd8VawfhYPFc/1yzzMoFlZdTmcHg+rJ/Rx4BHOdWfcgByULWc6wFPd3AXIkQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729523119; 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=ncKcSXQhqaFpLAei4KplDIKbfCb0rNgq7t+fNwINdYk=; b=IwnLWeZ/mhLjcSv6yXUoJq5KDJI9fanARFuYNlMV6ZFAMEWZD3VmC9q3GPj9tX1v1GX/R7 1+FALvLKZniYgcJtijbYUEuZjQ6znf7LWVAT2IujnkZz1CBVyr6aSnue1iGBL/bx6bgrKN GwXK99MfssXTkUTmk7BIwYrb7PAxh9tEDbUUpwy7s26xW2ohSMHt3nFvQjKqaFKdDHJiCD rF9PpuiN0p/rbbAy26pmiogyexiW0Ob1KtpqOSLNdyalgUxiorKVBsollbaQNtIY2UErc+ lya/HPP0610CNqXMnMbh2MrxpampUCIdE6NEwMB0vWPFOcgHFliYAcTPnOFC5A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1729523119; a=rsa-sha256; cv=none; b=eIYEIUUWV6kqaPhPNZtOFx7SaNu9YaHEqYJp94PBS+NQRKSNpwpWdnf7/v6yJeg39N2skt gNAG1Jvfa/GBquI4W8mJuvXW0Dn9d2RYmOirrOwuanrXVaN78yWyWcAUOIv4fpqq97Dugd gehea+TOnHUdenfnNvSCWifJWel08HTMb9nrNqBg3dwBtLGDJVCn6uO/POW3Qoew8Ed9ql +FXEeJ1Btan0NXp1mf7su/6Eg/gbBlokdIcyB+LuhxQ3BX/9AC086jI12k74eIkzolkiTK X6R8ynH53OCqbLESWYYKbLIMIvlNxNd56NBYWmPWWuaDE8SIGz5x7Gqsb8LRgA== 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 4XXJWz1Mb5zbQn; Mon, 21 Oct 2024 15:05:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49LF5J7A047342; Mon, 21 Oct 2024 15:05:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49LF5Jkd047339; Mon, 21 Oct 2024 15:05:19 GMT (envelope-from git) Date: Mon, 21 Oct 2024 15:05:19 GMT Message-Id: <202410211505.49LF5Jkd047339@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: 78b308e5a4a1 - stable/14 - sys: Use the new arm_smccc_invoke macros 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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/14 X-Git-Reftype: branch X-Git-Commit: 78b308e5a4a15f1dbf52c289b1f1ad4f4b980184 Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=78b308e5a4a15f1dbf52c289b1f1ad4f4b980184 commit 78b308e5a4a15f1dbf52c289b1f1ad4f4b980184 Author: Andrew Turner AuthorDate: 2024-10-14 14:33:51 +0000 Commit: Andrew Turner CommitDate: 2024-10-21 15:03:27 +0000 sys: Use the new arm_smccc_invoke macros Simplify the calls into the SMCCC firmware with the new arm_smccc_invoke* macros. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D46987 (cherry picked from commit b9cd72b06d795a8c7b39df1f520e866ad7f11aa8) --- sys/arm/qualcomm/qcom_scm_legacy.c | 4 ++-- sys/arm64/nvidia/tegra210/tegra210_pmc.c | 4 ++-- sys/dev/firmware/xilinx/zynqmp_firmware.c | 2 +- sys/dev/hyperv/vmbus/aarch64/hyperv_machdep.c | 7 +++---- sys/dev/pci/pci_host_generic_den0115.c | 14 ++++++-------- sys/dev/psci/smccc.c | 6 +++--- 6 files changed, 17 insertions(+), 20 deletions(-) diff --git a/sys/arm/qualcomm/qcom_scm_legacy.c b/sys/arm/qualcomm/qcom_scm_legacy.c index 24c62c8181c3..e1c375c922af 100644 --- a/sys/arm/qualcomm/qcom_scm_legacy.c +++ b/sys/arm/qualcomm/qcom_scm_legacy.c @@ -74,8 +74,8 @@ qcom_scm_legacy_mp_set_cold_boot_address(vm_offset_t mp_entry_func) | QCOM_SCM_FLAG_COLDBOOT_CPU3; uint32_t scm_arg2 = pmap_kextract((vm_offset_t)mp_entry_func); - ret = arm_smccc_smc(scm_arg0, (uint32_t) &context_id, scm_arg1, - scm_arg2, 0, 0, 0, 0, &res); + ret = arm_smccc_invoke_smc(scm_arg0, (uint32_t) &context_id, scm_arg1, + scm_arg2, &res); if (ret == 0 && res.a0 == 0) return (0); diff --git a/sys/arm64/nvidia/tegra210/tegra210_pmc.c b/sys/arm64/nvidia/tegra210/tegra210_pmc.c index 5ae5c0e8092c..85c01d7ce7d6 100644 --- a/sys/arm64/nvidia/tegra210/tegra210_pmc.c +++ b/sys/arm64/nvidia/tegra210/tegra210_pmc.c @@ -191,7 +191,7 @@ WR4(struct tegra210_pmc_softc *sc, bus_size_t r, uint32_t v) struct arm_smccc_res res; if (sc->secure_access) { - arm_smccc_smc(PMC_SMC, PMC_SMC_WRITE, r, v, 0, 0, 0, 0, &res); + arm_smccc_invoke_smc(PMC_SMC, PMC_SMC_WRITE, r, v, &res); if (res.a0 != 0) device_printf(sc->dev," PMC SMC write failed: %lu\n", res.a0); @@ -206,7 +206,7 @@ RD4(struct tegra210_pmc_softc *sc, bus_size_t r) struct arm_smccc_res res; if (sc->secure_access) { - arm_smccc_smc(PMC_SMC, PMC_SMC_READ, r, 0, 0, 0, 0, 0, &res); + arm_smccc_invoke_smc(PMC_SMC, PMC_SMC_READ, r, &res); if (res.a0 != 0) device_printf(sc->dev," PMC SMC write failed: %lu\n", res.a0); diff --git a/sys/dev/firmware/xilinx/zynqmp_firmware.c b/sys/dev/firmware/xilinx/zynqmp_firmware.c index 8ee6c9a21377..a6b55a3528a1 100644 --- a/sys/dev/firmware/xilinx/zynqmp_firmware.c +++ b/sys/dev/firmware/xilinx/zynqmp_firmware.c @@ -105,7 +105,7 @@ zynqmp_call_smc(uint32_t id, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3, args[0] = id | PM_SIP_SVC; args[1] = ((uint64_t)a1 << 32) | a0; args[2] = ((uint64_t)a3 << 32) | a2; - arm_smccc_smc(args[0], args[1], args[2], 0, 0, 0, 0, 0, &res); + arm_smccc_invoke_smc(args[0], args[1], args[2], &res); if (payload != NULL) { payload[0] = res.a0 & 0xFFFFFFFF; payload[1] = res.a0 >> 32; diff --git a/sys/dev/hyperv/vmbus/aarch64/hyperv_machdep.c b/sys/dev/hyperv/vmbus/aarch64/hyperv_machdep.c index dbb6aac2de31..e808cc081535 100644 --- a/sys/dev/hyperv/vmbus/aarch64/hyperv_machdep.c +++ b/sys/dev/hyperv/vmbus/aarch64/hyperv_machdep.c @@ -50,10 +50,10 @@ void arm_hv_set_vreg(u32 msr, u64 value) { - arm_smccc_hvc(HV_FUNC_ID, + arm_smccc_invoke_hvc(HV_FUNC_ID, HVCALL_SET_VP_REGISTERS | HV_HYPERCALL_FAST_BIT | HV_HYPERCALL_REP_COMP_1, - HV_PARTITION_ID_SELF, HV_VP_INDEX_SELF, msr, 0, value, 0, NULL); + HV_PARTITION_ID_SELF, HV_VP_INDEX_SELF, msr, 0, value, NULL); } void @@ -95,8 +95,7 @@ hypercall_md(volatile void *hc_addr, uint64_t in_val, uint64_t in_paddr, { struct arm_smccc_res res; - arm_smccc_hvc(HV_FUNC_ID, in_val, in_paddr, out_paddr, 0, 0, 0, 0, - &res); + arm_smccc_invoke_hvc(HV_FUNC_ID, in_val, in_paddr, out_paddr, &res); return (res.a0); } diff --git a/sys/dev/pci/pci_host_generic_den0115.c b/sys/dev/pci/pci_host_generic_den0115.c index cfef34824965..a14fe84039fe 100644 --- a/sys/dev/pci/pci_host_generic_den0115.c +++ b/sys/dev/pci/pci_host_generic_den0115.c @@ -124,8 +124,7 @@ pci_host_acpi_smccc_has_feature(uint32_t pci_func_id) { struct arm_smccc_res result; - if (psci_callfn(SMCCC_PCI_FEATURES, pci_func_id, 0, 0, 0, 0, 0, 0, - &result) < 0) { + if (arm_smccc_invoke(SMCCC_PCI_FEATURES, pci_func_id, &result) < 0) { return (false); } @@ -137,7 +136,7 @@ pci_host_acpi_smccc_pci_version(uint32_t *versionp) { struct arm_smccc_res result; - if (psci_callfn(SMCCC_PCI_VERSION, 0, 0, 0, 0, 0, 0, 0, &result) < 0) { + if (arm_smccc_invoke(SMCCC_PCI_VERSION, &result) < 0) { return (false); } @@ -185,8 +184,8 @@ pci_host_acpi_smccc_attach(device_t dev) return (error); if (pci_host_acpi_smccc_has_feature(SMCCC_PCI_GET_SEG_INFO) && - psci_callfn(SMCCC_PCI_GET_SEG_INFO, sc->base.ecam, 0, 0, 0, 0, 0, - 0, &result) == SMCCC_RET_SUCCESS) { + arm_smccc_invoke(SMCCC_PCI_GET_SEG_INFO, sc->base.ecam, + &result) == SMCCC_RET_SUCCESS) { start = SMCCC_PCI_SEG_START(result.a1); end = SMCCC_PCI_SEG_END(result.a1); @@ -215,8 +214,7 @@ pci_host_acpi_smccc_read_config(device_t dev, u_int bus, u_int slot, return (~0U); addr = (sc->base.ecam << 16) | (bus << 8) | (slot << 3) | (func << 0); - if (psci_callfn(SMCCC_PCI_READ, addr, reg, bytes, 0, 0, 0, 0, - &result) < 0) { + if (arm_smccc_invoke(SMCCC_PCI_READ, addr, reg, bytes, &result) < 0) { return (~0U); } @@ -240,7 +238,7 @@ pci_host_acpi_smccc_write_config(device_t dev, u_int bus, u_int slot, return; addr = (sc->base.ecam << 16) | (bus << 8) | (slot << 3) | (func << 0); - psci_callfn(SMCCC_PCI_WRITE, addr, reg, bytes, val, 0, 0, 0, &result); + arm_smccc_invoke(SMCCC_PCI_WRITE, addr, reg, bytes, val, &result); } static device_method_t generic_pcie_acpi_smccc_methods[] = { diff --git a/sys/dev/psci/smccc.c b/sys/dev/psci/smccc.c index 5c5e140abab1..e8a367bed7d6 100644 --- a/sys/dev/psci/smccc.c +++ b/sys/dev/psci/smccc.c @@ -79,7 +79,7 @@ smccc_arch_features(uint32_t smccc_func_id) if (smccc_version == SMCCC_VERSION_1_0) return (PSCI_RETVAL_NOT_SUPPORTED); - return (psci_call(SMCCC_ARCH_FEATURES, smccc_func_id, 0, 0)); + return (arm_smccc_invoke(SMCCC_ARCH_FEATURES, smccc_func_id, NULL)); } /* @@ -92,7 +92,7 @@ smccc_arch_workaround_1(void) KASSERT(smccc_version != SMCCC_VERSION_1_0, ("SMCCC arch workaround 1 called with an invalid SMCCC interface")); - return (psci_call(SMCCC_ARCH_WORKAROUND_1, 0, 0, 0)); + return (arm_smccc_invoke(SMCCC_ARCH_WORKAROUND_1, NULL)); } int @@ -101,5 +101,5 @@ smccc_arch_workaround_2(int enable) KASSERT(smccc_version != SMCCC_VERSION_1_0, ("SMCCC arch workaround 2 called with an invalid SMCCC interface")); - return (psci_call(SMCCC_ARCH_WORKAROUND_2, enable, 0, 0)); + return (arm_smccc_invoke(SMCCC_ARCH_WORKAROUND_2, enable, NULL)); }