Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Ekansh Gupta" <ekansh.gupta@oss.qualcomm.com>
Cc: robh@kernel.org, devicetree@vger.kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH] arm64: dts: qcom: kaanapali: Add memory-region for audio PD
Date: Tue, 22 Sep 2026 07:39:13 +0000	[thread overview]
Message-ID: <20260922073914.1C2E91F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260922-knp-rh-v1-1-35e29b104809@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] dts: fatal hypervisor fault due to reusable CMA memory assignment
--

commit 00239a518b7712da455472149c4770b8452bb6e8
Author: Ekansh Gupta <ekansh.gupta@oss.qualcomm.com>

arm64: dts: qcom: kaanapali: Add memory-region for audio PD
    
This commit reserves a memory region for audio PD dynamic loading and remote
heap requirements. It also adds the required VMID list for memory ownership
transfers to the fastrpc node.

> diff --git a/arch/arm64/boot/dts/qcom/kaanapali.dtsi b/arch/arm64/boot/dts/qcom/kaanapali.dtsi
> index 131fd2a16c545..f79f7679de02a 100644
> --- a/arch/arm64/boot/dts/qcom/kaanapali.dtsi
> +++ b/arch/arm64/boot/dts/qcom/kaanapali.dtsi
> @@ -451,6 +451,14 @@ rmtfs_mem: rmtfs@d7c00000 {
>  			qcom,client-id = <1>;
>  			qcom,vmid = <QCOM_SCM_VMID_MSS_MSA>;
>  		};
> +
> +		adsp_rpc_remote_heap_mem: adsp-rpc-remote-heap {
> +			compatible = "shared-dma-pool";
> +			alloc-ranges = <0x0 0x0 0x1 0x0>;
> +			reusable;

[Severity: High]
Could marking this region as "reusable" lead to a fatal hypervisor fault?

By defining this with compatible = "shared-dma-pool" and "reusable", the
region is added to the Linux CMA allocator pool. This means the memory remains
in the kernel's linear map and is considered available for movable OS
allocations, such as the page cache.

> +			alignment = <0x0 0x400000>;
> +			size = <0x0 0x800000>;
> +		};
>  	};
>  
>  	smp2p-adsp {
> @@ -2755,6 +2763,9 @@ fastrpc {
>  					compatible = "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>;

Since the fastrpc node references the remote heap memory region and provides
"qcom,vmids", the fastrpc driver will unconditionally strip HLOS permissions
from the entire CMA region during probe.

Specifically, fastrpc_init_reserved_mem() calls qcom_scm_assign_mem() to
transfer ownership to the DSP, removing host OS access at the hypervisor
level. Because the memory is directly assigned away without being allocated
from the CMA pool via cma_alloc(), the kernel remains unaware it has lost
access.

Will any subsequent page reclaim, CMA allocation, or speculative CPU fetch
to the linear map of this region trigger an XPU violation and crash the
kernel?

Should this memory region use "no-map" instead of "reusable" to safely
remove it from the kernel's linear map before it is statically assigned
away from the host?

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

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260922-knp-rh-v1-1-35e29b104809@oss.qualcomm.com?part=1

      reply	other threads:[~2026-09-22  7:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-22  7:27 [PATCH] arm64: dts: qcom: kaanapali: Add memory-region for audio PD Ekansh Gupta
2026-09-22  7:39 ` sashiko-bot [this message]

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