From nobody Tue Oct 15 17:25:10 2024 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 4XSgw70FMqz5Ykn7; Tue, 15 Oct 2024 17:25:11 +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 4XSgw66H0pz4V13; Tue, 15 Oct 2024 17:25:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729013110; 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=20TeoGnRuWmbRwje+YZ7BYPy0uR9hdK+/BlK8gnWLpQ=; b=N9dtuns8RDUFp9Vg9SRhTkcGobbokrdwj31J70JzZGf2uXq7sR66nbbsxoU3uxWoi6F2YI pzRbsh4q3sC/QCOBUQP7RycH/BTmkd9MvRPAt3Mjxwxnbd8XQ/2Ulpmz/LqbxUdWP0n0OB nsWiyJOhYgNIDbMoz6ZVIhSQa6D2liFdPrbff6wCYWHnwVO8N85CttWJP3I0XxdXMPSzSm ukUlJKCaiuvK4p7GhAZoeq/o6rFmeAboe1G7eyzDjXz7DRCH/6cMJrcbCXdmC3GOHdl1Qz 90sqZqcbrXTxVQL4lNLjRwI1f9hGuc7JV+ruH+aITz5sJdSwaic8qOE7kuphug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729013110; 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=20TeoGnRuWmbRwje+YZ7BYPy0uR9hdK+/BlK8gnWLpQ=; b=O2rUxzWpY1KM+c5+gZow78jhhUrJaRsu/qSBDOB2xMsIJaXErMOvFzEEvyv0iJdM996Yp6 X9uFQXIman9OPPVj9vtqppCu55mf2wsg3+aopiW2MZ/8f7eoG/+5kXeJMAs8F3jCXkxCWh KSyVhBld09YTqGK8Ne+1XAtDeN0fX/2sC4WwN1u6LfqibaqHgzHtYrFq2DbiufrDGaG6o4 1DAGVtnl40r/KKtwBB/qNusaqD5DWL1rRLctigXeoMvocy3j00A7NYy/UYcBt/lbvNydeo n8NHgGt6A3FSncwfqPKjHhnBu2N6sZswvSub2tdNrJtgWZ4QRBP0qJ/nh1mn1Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1729013110; a=rsa-sha256; cv=none; b=hG7cH5QwsE8ac/ZqfccN2GF64MuntBkbN2eD/X4pVHp+tSMi9hAS5vEeonJOc25YMG1EgN XCYEcb7QqG4MMVSgiF9EbvKTMcyxqOgku5hEgxrebb4gy/BJsneCwtgXKUPkg4FC+QlsLs HMdDjLc4U2O9RFrCAkZHSY2WBbMAnNXqUnt2UpSTwkshmo78nSEu6zYoa9nrbRqEPX3Sit UooQ88rXhp3tH1LLdHG1UcJSGVKWF1QjyTgJzT4FRIodzM3O+HXaLCKFoiJiVfHaGBxV6Y DI7zrvf0AnRuVHt0t4LOcTDDszVIkz4vwcyummFs185TTitBfWyDEgEL6NN+uQ== 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 4XSgw65tnKzWLN; Tue, 15 Oct 2024 17:25:10 +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 49FHPACL027858; Tue, 15 Oct 2024 17:25:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49FHPArt027855; Tue, 15 Oct 2024 17:25:10 GMT (envelope-from git) Date: Tue, 15 Oct 2024 17:25:10 GMT Message-Id: <202410151725.49FHPArt027855@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: b9cd72b06d79 - main - sys: Use the new arm_smccc_invoke macros 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-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: b9cd72b06d795a8c7b39df1f520e866ad7f11aa8 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=b9cd72b06d795a8c7b39df1f520e866ad7f11aa8 commit b9cd72b06d795a8c7b39df1f520e866ad7f11aa8 Author: Andrew Turner AuthorDate: 2024-10-14 14:33:51 +0000 Commit: Andrew Turner CommitDate: 2024-10-15 17:24:41 +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 --- sys/arm/qualcomm/qcom_scm_legacy.c | 4 ++-- sys/arm64/nvidia/tegra210/tegra210_pmc.c | 4 ++-- sys/dev/firmware/arm/scmi_smc.c | 2 +- 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 +++--- 7 files changed, 18 insertions(+), 21 deletions(-) diff --git a/sys/arm/qualcomm/qcom_scm_legacy.c b/sys/arm/qualcomm/qcom_scm_legacy.c index f1566264f00c..b614843b1ce8 100644 --- a/sys/arm/qualcomm/qcom_scm_legacy.c +++ b/sys/arm/qualcomm/qcom_scm_legacy.c @@ -73,8 +73,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 0f0343a317ce..b8b95ca32c40 100644 --- a/sys/arm64/nvidia/tegra210/tegra210_pmc.c +++ b/sys/arm64/nvidia/tegra210/tegra210_pmc.c @@ -190,7 +190,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); @@ -205,7 +205,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/arm/scmi_smc.c b/sys/dev/firmware/arm/scmi_smc.c index a1621ccffa86..9f0d899233fa 100644 --- a/sys/dev/firmware/arm/scmi_smc.c +++ b/sys/dev/firmware/arm/scmi_smc.c @@ -106,7 +106,7 @@ scmi_smc_xfer_msg(device_t dev, struct scmi_msg *msg) if (ret != 0) return (ret); - arm_smccc_smc(sc->smc_id, 0, 0, 0, 0, 0, 0, 0, NULL); + arm_smccc_invoke_smc(sc->smc_id, NULL); return (0); } 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 08ad6d84fc3c..21a6bd54e650 100644 --- a/sys/dev/psci/smccc.c +++ b/sys/dev/psci/smccc.c @@ -81,7 +81,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)); } /* @@ -95,7 +95,7 @@ smccc_arch_workaround_1(void) MPASS(smccc_version != 0); 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 @@ -105,5 +105,5 @@ smccc_arch_workaround_2(int enable) MPASS(smccc_version != 0); 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)); }