Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Vinayak Katoch" <vinayak.katoch@oss.qualcomm.com>
Cc: conor+dt@kernel.org, robh@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH] arm64: dts: qcom: glymur: Add memory-region for audio PD
Date: Wed, 01 Jul 2026 10:23:38 +0000	[thread overview]
Message-ID: <20260701102339.19B4A1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260701-glymur-audio-v1-1-2c3862d95a09@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:

New issues:
- [High] The `adsp-rpc-remote-heap` memory region uses `reusable` without retaining HLOS access, leading to fatal hypervisor faults due to speculative execution.

Pre-existing issues:
- [High] The fastrpc driver does not restore memory ownership to HLOS before freeing the remote_heap, causing a fatal XPU violation on memory reuse.
--

commit 39381f5de37bbf0f0366047bc842de4cb219a1ec
Author: Vinayak Katoch <vinayak.katoch@oss.qualcomm.com>

arm64: dts: qcom: glymur: Add memory-region for audio PD

Reserve memory region for audio PD dynamic loading and remote heap
requirements. Add the required VMID list for memory ownership
transfers.

> diff --git a/arch/arm64/boot/dts/qcom/glymur.dtsi b/arch/arm64/boot/dts/qcom/glymur.dtsi
> index 20b49af7298e9..f403f542aa00c 100644
> --- a/arch/arm64/boot/dts/qcom/glymur.dtsi
> +++ b/arch/arm64/boot/dts/qcom/glymur.dtsi
[ ... ]
> @@ -663,6 +664,14 @@ smem_mem: smem@ffe00000 {
>  			hwlocks = <&tcsr_mutex 3>;
>  			no-map;
>  		};
> +
> +		adsp_rpc_remote_heap_mem: adsp-rpc-remote-heap {
> +			compatible = "shared-dma-pool";
> +			alloc-ranges = <0x0 0x80000000 0x0 0x80000000>;
> +			reusable;
> +			alignment = <0x0 0x400000>;
> +			size = <0x0 0x800000>;
> +		};
>  	};
>  
>  	smp2p-adsp {
[ ... ]
> @@ -3845,6 +3854,9 @@ fastrpc {
>  					compatible = "qcom,glymur-fastrpc", "qcom,kaanapali-fastrpc";
>  					qcom,glink-channels = "fastrpcglink-apps-dsp";
>  					label = "adsp";
> +					memory-region = <&adsp_rpc_remote_heap_mem>;
> +					qcom,vmids = <QCOM_SCM_VMID_LPASS
> +						      QCOM_SCM_VMID_ADSP_HEAP>;

[Severity: High]
Since this memory region is defined with the reusable property, it is placed
in the CMA pool and the kernel's linear mapping. When the fastrpc driver
allocates this memory and assigns it, it strips QCOM_SCM_VMID_HLOS because it
is missing from this qcom,vmids array.

Because the pages remain mapped in the kernel's linear mapping, will any
speculative CPU fetch to these addresses immediately trigger a hypervisor
protection fault?

Should this region use no-map instead, or should QCOM_SCM_VMID_HLOS be
included in the qcom,vmids array?

[Severity: High]
This is a pre-existing issue, but I noticed a related problem in the fastrpc
driver when handling this remote heap memory.

When the driver frees the remote heap during channel teardown or module
removal, it returns the buffer to the CMA pool:

drivers/misc/fastrpc.c:fastrpc_rpmsg_remove() {
        ...
        if (cctx->remote_heap)
                fastrpc_buf_free(cctx->remote_heap);
        ...
}

Does this free the memory without restoring ownership to QCOM_SCM_VMID_HLOS?

If so, could this cause an XPU/SMMU violation when the CMA allocator
subsequently reuses these freed pages for another kernel component?

>  					#address-cells = <1>;
>  					#size-cells = <0>;

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260701-glymur-audio-v1-1-2c3862d95a09@oss.qualcomm.com?part=1

  reply	other threads:[~2026-07-01 10:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-01 10:05 [PATCH] arm64: dts: qcom: glymur: Add memory-region for audio PD Vinayak Katoch
2026-07-01 10:23 ` sashiko-bot [this message]
2026-07-01 11:03 ` Ekansh Gupta

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=20260701102339.19B4A1F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=vinayak.katoch@oss.qualcomm.com \
    /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