arm64: dts: qcom: talos: Make the ADSP remote heap no-map
PATCH 1/1 arm64: dts: qcom: talos: Make the ADSP remote heap no-map
The ADSP remote heap is declared as a reusable CMA pool. FastRPC assigns the entire region to the DSP through qcom_scm_assign_mem() during probe without allocating the pages from CMA. Consequently, the pages remain available for movable HLOS allocations even after HLOS access to the region has been revoked.
On Talos, GPU stress testing triggers a synchronous external abort when zram accesses pages within the ADSP remote heap.
Replace reusable with no-map to prevent the region from being reused for normal kernel allocations and exclude it from the kernel's standard memory mapping.
--- arch/arm64/boot/dts/qcom/talos.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/talos.dtsi +1 -1
@@ -682,7 +682,7 @@ pil_gpu_mem: pil-gpu@97715000 { adsp_rpc_remote_heap_mem: adsp-rpc-remote-heap { compatible = "shared-dma-pool"; alloc-ranges = <0x0 0x80000000 0x0 0x80000000>; - reusable; + no-map; alignment = <0x0 0x400000>; size = <0x0 0x800000>; };
Signature · 1 line
2.43.0
[email protected]
AI reviewThank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [High] arm64: dts: qcom: talos: SEA crash shifted to FastRPC dma_alloc_coherent due to un-restored HLOS…
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] arm64: dts: qcom: talos: SEA crash shifted to FastRPC dma_alloc_coherent due to un-restored HLOS permissions --
commit af4a6b835881c10ea8fa53c33cf956e604f98923
Author: Jianping Li <[email protected]>
arm64: dts: qcom: talos: Make the ADSP remote heap no-map
This commit isolates the ADSP remote heap by changing its declaration from reusable to no-map. This is intended to prevent normal kernel allocations from triggering a Synchronous External Abort (SEA) when accessing pages within the heap.
arch/arm64/boot/dts/qcom/talos.dtsi pil_gpu_mem: pil-gpu@97715000 { · line 686
Quoted 10 lines
arch/arm64/boot/dts/qcom/talos.dtsi +1
-1@@ -683,7 +683,7 @@ pil_gpu_mem: pil-gpu@97715000 { adsp_rpc_remote_heap_mem: adsp-rpc-remote-heap { compatible = "shared-dma-pool"; alloc-ranges = <0x0 0x80000000 0x0 0x80000000>; - reusable; + no-map;
[Severity: High]
Does changing this to no-map just shift the Synchronous External Abort from ZRAM to the FastRPC driver's dma_alloc_coherent() path?
By marking this region no-map, it becomes a coherent DMA pool, shifting its allocations to FastRPC's dma_alloc_coherent() path.
FastRPC dynamically assigns the allocated memory chunk to the DSP during fastrpc_req_mmap(), which revokes HLOS access:
drivers/misc/fastrpc.c:fastrpc_req_mmap() {
...
err = qcom_scm_assign_mem(buf->dma_addr, (u64)buf->size,
&src_perms, fl->cctx->vmperms, fl->cctx->vmcount);
...
}When the user unmaps the memory, fastrpc_req_munmap_impl() calls fastrpc_buf_free() and returns the memory to the DMA pool without restoring HLOS permissions.
The next allocation from the DMA pool will trigger an SEA when dma_alloc_coherent() attempts to memset() the still-DSP-owned pages:
drivers/misc/fastrpc.c:__fastrpc_buf_alloc() {
...
buf->virt = dma_alloc_coherent(dev, buf->size, &buf->dma_addr,
GFP_KERNEL);
...
}Quoted 3 lines
arch/arm64/boot/dts/qcom/talos.dtsi +0
-0alignment = <0x0 0x400000>; size = <0x0 0x800000>; };
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Quoted 9 lines · Jianping Li
The ADSP remote heap is declared as a reusable CMA pool. FastRPC assigns the entire region to the DSP through
qcom_scm_assign_mem()during probe without allocating the pages from CMA. Consequently, the pages remain available for movable HLOS allocations even after HLOS access to the region has been revoked.On Talos, GPU stress testing triggers a synchronous external abort when zram accesses pages within the ADSP remote heap.
Quoted 8 lines
Replace reusable with no-map to prevent the region from being reused for normal kernel allocations and exclude it from the kernel's standard memory mapping.
Fixes b0b51a5f1911f ("arm64: dts: qcom: talos: Add memory-region for audio PD")Signed-off-by Jianping Li <[email protected]>---
Konrad
Quoted 25 lines · Jianping Li
The ADSP remote heap is declared as a reusable CMA pool. FastRPC assigns the entire region to the DSP through
qcom_scm_assign_mem()during probe without allocating the pages from CMA. Consequently, the pages remain available for movable HLOS allocations even after HLOS access to the region has been revoked.On Talos, GPU stress testing triggers a synchronous external abort when zram accesses pages within the ADSP remote heap.
Replace reusable with no-map to prevent the region from being reused for normal kernel allocations and exclude it from the kernel's standard memory mapping.
Fixes b0b51a5f1911f ("arm64: dts: qcom: talos: Add memory-region for audio PD")Signed-off-by Jianping Li <[email protected]>--- arch/arm64/boot/dts/qcom/talos.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/arm64/boot/dts/qcom/talos.dtsi +0
-0
arch/arm64/boot/dts/qcom/talos.dtsi pil_gpu_mem: pil-gpu@97715000 { · line 688
Quoted 8 lines
arch/arm64/boot/dts/qcom/talos.dtsi +1
-1@@ -682,7 +682,7 @@ pil_gpu_mem: pil-gpu@97715000 { adsp_rpc_remote_heap_mem: adsp-rpc-remote-heap { compatible = "shared-dma-pool"; alloc-ranges = <0x0 0x80000000 0x0 0x80000000>; - reusable; + no-map; alignment = <0x0 0x400000>; size = <0x0 0x800000>; };
Quoted 13 lines · Jianping Li
The ADSP remote heap is declared as a reusable CMA pool. FastRPC assigns the entire region to the DSP through
qcom_scm_assign_mem()during probe without allocating the pages from CMA. Consequently, the pages remain available for movable HLOS allocations even after HLOS access to the region has been revoked.On Talos, GPU stress testing triggers a synchronous external abort when zram accesses pages within the ADSP remote heap.
Replace reusable with no-map to prevent the region from being reused for normal kernel allocations and exclude it from the kernel's standard memory mapping.
Quoted 5 lines
Fixes b0b51a5f1911f ("arm64: dts: qcom: talos: Add memory-region for audio PD")Signed-off-by Jianping Li <[email protected]>--- arch/arm64/boot/dts/qcom/talos.dtsi | 2 +-
This also applies to: glymur, agatti, sm8250, kodiak, sm8750.. (at least those I've found by grepping for the adsp_rpc_remote_heap_mem label)
I've been hitting the SEA on a kodiak phone (sm7325-motorola-dubai) constantly with just light everyday usage:
Internal error: synchronous external abort: 0000000096000010 [#1] SMP CPU: 7 UID: 10000 PID: 26485 Comm: pool-24 Tainted: G M W 7.3.0-rc6-next-20261009-uwu+ #167 PREEMPT(full) Tainted: [M]=MACHINE_CHECK, [W]=WARN Hardware name: motorola Motorola Edge 30 (Tianma)/Motorola Edge 30 (Tianma), BIOS 2026.07-gca7686425f32-dirty 07/01/2026 pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : clear_page+0x30/0x70 lr : prep_new_page+0x94/0x178 ... Call trace: clear_page+0x30/0x70 (P) get_page_from_freelist+0x1bd8/0x1c00 __alloc_frozen_pages_noprof+0x1cc/0x3f8 alloc_pages_mpol+0x124/0x210 vma_alloc_folio_noprof+0x124/0x200 vma_alloc_zeroed_movable_folio+0x3c/0x50 do_pte_missing+0x9e0/0xf80
...
This no-map does seem to fix it.
Thanks,
~val
Quoted 10 lines · Jianping Li
The ADSP remote heap is declared as a reusable CMA pool. FastRPC assigns the entire region to the DSP through
qcom_scm_assign_mem()during probe without allocating the pages from CMA. Consequently, the pages remain available for movable HLOS allocations even after HLOS access to the region has been revoked.On Talos, GPU stress testing triggers a synchronous external abort when zram accesses pages within the ADSP remote heap.
[...]
Applied, thanks!
[1/1] arm64: dts: qcom: talos: Make the ADSP remote heap no-map
commit: 99c8bf54fb62f458b4bd69fc7b42c6d344d16758
Best regards,
Signature · 1 line
Bjorn Andersson <[email protected]>