mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
To: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com>,
	Bjorn Andersson <andersson@kernel.org>,
	Mathieu Poirier <mathieu.poirier@linaro.org>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Manivannan Sadhasivam <mani@kernel.org>,
	Konrad Dybcio <konradybcio@kernel.org>
Cc: linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 11/12] remoteproc: qcom: pas: Enable Secure PAS support with IOMMU managed by Linux
Date: Wed, 8 Oct 2025 11:19:32 +0200	[thread overview]
Message-ID: <65e6d61a-7648-4125-8550-8a8c6d476b0a@oss.qualcomm.com> (raw)
In-Reply-To: <20251007-kvm_rprocv4_next-20251007-v4-11-de841623af3c@oss.qualcomm.com>

On 10/7/25 6:48 PM, Mukesh Ojha wrote:
> Most Qualcomm platforms feature Gunyah hypervisor, which typically
> handles IOMMU configuration. This includes mapping memory regions and
> device memory resources for remote processors by intercepting
> qcom_scm_pas_auth_and_reset() calls. These mappings are later removed
> during teardown. Additionally, SHM bridge setup is required to enable
> memory protection for both remoteproc metadata and its memory regions.
> When the aforementioned hypervisor is absent, the operating system must
> perform these configurations instead.
> 
> When Linux runs as the hypervisor (@ EL2) on a SoC, it will have its
> own device tree overlay file that specifies the firmware stream ID now
> managed by Linux for a particular remote processor. If the iommus
> property is specified in the remoteproc device tree node, it indicates
> that IOMMU configuration must be handled by Linux. In this case, the
> has_iommu flag is set for the remote processor, which ensures that the
> resource table, carveouts, and SHM bridge are properly configured before
> memory is passed to TrustZone for authentication. Otherwise, the
> has_iommu flag remains unset, which indicates default behavior.
> 
> Enables Secure PAS support for remote processors when IOMMU configuration
> is managed by Linux.
> 
> Signed-off-by: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com>
> ---

[...]

> +	if (of_property_present(pdev->dev.of_node, "iommus")) {
> +		struct of_phandle_args args;
> +
> +		ret = of_parse_phandle_with_args(pdev->dev.of_node, "iommus",
> +						 "#iommu-cells", 0, &args);
> +		if (ret < 0)
> +			return ret;
> +
> +		rproc->has_iommu = true;
> +		of_node_put(args.np);
> +	} else {
> +		rproc->has_iommu = false;
> +	}

I think the above is a little heavy-handed..

rproc->has_iommu = of_property_present(...)

should suffice.. if the developer puts something that isn't a #xxx-cells
-marked provider in xxx = <>, that's on them

Konrad

  parent reply	other threads:[~2025-10-08  9:19 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-07 16:48 [PATCH v4 00/12] Peripheral Image Loader support for Qualcomm SoCs running Linux host at EL2 Mukesh Ojha
2025-10-07 16:48 ` [PATCH v4 01/12] dt-bindings: remoteproc: qcom,pas: Add iommus property Mukesh Ojha
2025-10-08  8:09   ` Krzysztof Kozlowski
2025-10-08 11:57     ` Mukesh Ojha
2025-10-07 16:48 ` [PATCH v4 02/12] firmware: qcom_scm: Rename peripheral as pas_id Mukesh Ojha
2025-10-07 16:48 ` [PATCH v4 03/12] firmware: qcom_scm: Introduce PAS context initialization and destroy helper Mukesh Ojha
2025-10-07 21:23   ` Manivannan Sadhasivam
2025-10-07 22:16     ` Bryan O'Donoghue
2025-10-08  7:51       ` Mukesh Ojha
2025-10-07 16:48 ` [PATCH v4 04/12] soc: qcom: mdtloader: Add PAS context aware qcom_mdt_pas_load() function Mukesh Ojha
2025-10-07 21:29   ` Manivannan Sadhasivam
2025-10-08  7:35     ` Mukesh Ojha
2025-10-10  6:21   ` Mukesh Ojha
2025-10-07 16:48 ` [PATCH v4 05/12] remoteproc: pas: Replace metadata context with PAS context structure Mukesh Ojha
2025-10-07 21:34   ` Manivannan Sadhasivam
2025-10-08  7:37     ` Mukesh Ojha
2025-10-10  6:24   ` Mukesh Ojha
2025-10-07 16:48 ` [PATCH v4 06/12] firmware: qcom_scm: Add a prep version of auth_and_reset function Mukesh Ojha
2025-10-07 21:37   ` Manivannan Sadhasivam
2025-10-08  7:35     ` Mukesh Ojha
2025-10-07 16:48 ` [PATCH v4 07/12] firmware: qcom_scm: Simplify qcom_scm_pas_init_image() Mukesh Ojha
2025-10-07 16:48 ` [PATCH v4 08/12] firmware: qcom_scm: Add SHM bridge handling for PAS when running without QHEE Mukesh Ojha
2025-10-07 16:48 ` [PATCH v4 09/12] firmware: qcom_scm: Add qcom_scm_pas_get_rsc_table() to get resource table Mukesh Ojha
2025-10-07 16:48 ` [PATCH v4 10/12] remoteproc: pas: Extend parse_fw callback to fetch resources via SMC call Mukesh Ojha
2025-10-07 21:48   ` Manivannan Sadhasivam
2025-10-08  7:33     ` Mukesh Ojha
2025-10-07 16:48 ` [PATCH v4 11/12] remoteproc: qcom: pas: Enable Secure PAS support with IOMMU managed by Linux Mukesh Ojha
2025-10-07 21:52   ` Manivannan Sadhasivam
2025-10-08  4:58     ` Mukesh Ojha
2025-10-08  9:19   ` Konrad Dybcio [this message]
2025-10-08 12:00     ` Mukesh Ojha
2025-10-07 16:48 ` [PATCH v4 12/12] arm64: dts: qcom: Add EL2 overlay for Lemans Mukesh Ojha
2025-10-07 21:55   ` Manivannan Sadhasivam
2025-10-08  7:32     ` Mukesh Ojha
2025-10-08 10:13       ` Konrad Dybcio
2025-10-08 11:56         ` Mukesh Ojha
2025-10-10  6:27   ` Mukesh Ojha
2025-10-07 21:56 ` [PATCH v4 00/12] Peripheral Image Loader support for Qualcomm SoCs running Linux host at EL2 Manivannan Sadhasivam
2025-10-10 10:08   ` Mukesh Ojha

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=65e6d61a-7648-4125-8550-8a8c6d476b0a@oss.qualcomm.com \
    --to=konrad.dybcio@oss.qualcomm.com \
    --cc=andersson@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=konradybcio@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=mani@kernel.org \
    --cc=mathieu.poirier@linaro.org \
    --cc=mukesh.ojha@oss.qualcomm.com \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®