Skip to contentSkip to conversation

arm64: dts: qcom: kodiak: avoid EFI overlap for ADSP remote heap

PATCH Superseded Jianping Li 3 participants 5 messages Apr 23

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm64: dts: qcom: kodiak: avoid EFI overlap for ADSP remote heap

On KODIAK platforms boot can fail when the DT "adsp-rpc-remote-heap" reserved-memory region overlaps with firmware allocations (UEFI/EFI runtime). The kernel then reports failure to reserve the region and subsequent EFI runtime activity may trigger aborts.

The remote heap node was described as a fixed "no-map" region, which turns it into a hard carveout. Replace it with a "shared-dma-pool" reserved memory region with reusable CMA-backed allocation, specifying alignment and size.

This avoids hard carveouts and reduces the chance of conflicting with firmware memory maps while keeping an explicit pool for ADSP remote heap usage.

Fixes 90a58ffa9c55 ("arm64: dts: qcom: kodiak: Add memory region for audiopd")
---
 arch/arm64/boot/dts/qcom/kodiak.dtsi | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
arch/arm64/boot/dts/qcom/kodiak.dtsi +6 -3
index 988ca5f7c8a0..420219823496 100644
@@ -191,9 +191,12 @@ rmtfs_mem: rmtfs@9c900000 {
 			qcom,vmid = <QCOM_SCM_VMID_MSS_MSA>;
 		};
 
-		adsp_rpc_remote_heap_mem: adsp-rpc-remote-heap@9cb80000 {
-			reg = <0x0 0x9cb80000 0x0 0x800000>;
-			no-map;
+		adsp_rpc_remote_heap_mem: adsp-rpc-remote-heap {
+			compatible = "shared-dma-pool";
+			alloc-ranges = <0x0 0x00000000 0x0 0xffffffff>;
+			reusable;
+			alignment = <0x0 0x400000>;
+			size = <0x0 0x800000>;
 		};
 	};
 
Signature · 1 line
2.43.0
#1 lore raw
Quoted 26 lines · Jianping Li

On KODIAK platforms boot can fail when the DT "adsp-rpc-remote-heap" reserved-memory region overlaps with firmware allocations (UEFI/EFI runtime). The kernel then reports failure to reserve the region and subsequent EFI runtime activity may trigger aborts.

The remote heap node was described as a fixed "no-map" region, which turns it into a hard carveout. Replace it with a "shared-dma-pool" reserved memory region with reusable CMA-backed allocation, specifying alignment and size.

This avoids hard carveouts and reduces the chance of conflicting with firmware memory maps while keeping an explicit pool for ADSP remote heap usage.

Fixes 90a58ffa9c55 ("arm64: dts: qcom: kodiak: Add memory region for audiopd")
---
 arch/arm64/boot/dts/qcom/kodiak.dtsi | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
arch/arm64/boot/dts/qcom/kodiak.dtsi +0 -0
index 988ca5f7c8a0..420219823496 100644

arch/arm64/boot/dts/qcom/kodiak.dtsi rmtfs_mem: rmtfs@9c900000 { · line 196

Quoted 9 lines
arch/arm64/boot/dts/qcom/kodiak.dtsi +3 -3
@@ -191,9 +191,12 @@ rmtfs_mem: rmtfs@9c900000 {
 			qcom,vmid = <QCOM_SCM_VMID_MSS_MSA>;
 		};
 
-		adsp_rpc_remote_heap_mem: adsp-rpc-remote-heap@9cb80000 {
-			reg = <0x0 0x9cb80000 0x0 0x800000>;
-			no-map;
+		adsp_rpc_remote_heap_mem: adsp-rpc-remote-heap {
+			compatible = "shared-dma-pool";
+			alloc-ranges = <0x0 0x00000000 0x0 0xffffffff>;

Since DRAM starts at 0x8000_0000, is it intended to only allow this region to be in the lower 2 gigs?

(it may very well be for some historical reasons)

Konrad

#2 lore raw
Quoted 40 lines · Konrad Dybcio
Quoted 26 lines · Jianping Li

On KODIAK platforms boot can fail when the DT "adsp-rpc-remote-heap" reserved-memory region overlaps with firmware allocations (UEFI/EFI runtime). The kernel then reports failure to reserve the region and subsequent EFI runtime activity may trigger aborts.

The remote heap node was described as a fixed "no-map" region, which turns it into a hard carveout. Replace it with a "shared-dma-pool" reserved memory region with reusable CMA-backed allocation, specifying alignment and size.

This avoids hard carveouts and reduces the chance of conflicting with firmware memory maps while keeping an explicit pool for ADSP remote heap usage.

Fixes 90a58ffa9c55 ("arm64: dts: qcom: kodiak: Add memory region for audiopd")
---
 arch/arm64/boot/dts/qcom/kodiak.dtsi | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
arch/arm64/boot/dts/qcom/kodiak.dtsi +0 -0
index 988ca5f7c8a0..420219823496 100644

arch/arm64/boot/dts/qcom/kodiak.dtsi rmtfs_mem: rmtfs@9c900000 { · line 196

Quoted 9 lines
arch/arm64/boot/dts/qcom/kodiak.dtsi +3 -3
@@ -191,9 +191,12 @@ rmtfs_mem: rmtfs@9c900000 {
 			qcom,vmid = <QCOM_SCM_VMID_MSS_MSA>;
 		};
 
-		adsp_rpc_remote_heap_mem: adsp-rpc-remote-heap@9cb80000 {
-			reg = <0x0 0x9cb80000 0x0 0x800000>;
-			no-map;
+		adsp_rpc_remote_heap_mem: adsp-rpc-remote-heap {
+			compatible = "shared-dma-pool";
+			alloc-ranges = <0x0 0x00000000 0x0 0xffffffff>;

Since DRAM starts at 0x8000_0000, is it intended to only allow this region to be in the lower 2 gigs?

Quoted 1 line

(it may very well be for some historical reasons)

yes, this is intentional. ADSP supports 32-bit address.

Quoted 3 lines

Konrad

#3 lore raw
Quoted 41 lines · Ekansh Gupta
Quoted 40 lines · Konrad Dybcio
Quoted 26 lines · Jianping Li

On KODIAK platforms boot can fail when the DT "adsp-rpc-remote-heap" reserved-memory region overlaps with firmware allocations (UEFI/EFI runtime). The kernel then reports failure to reserve the region and subsequent EFI runtime activity may trigger aborts.

The remote heap node was described as a fixed "no-map" region, which turns it into a hard carveout. Replace it with a "shared-dma-pool" reserved memory region with reusable CMA-backed allocation, specifying alignment and size.

This avoids hard carveouts and reduces the chance of conflicting with firmware memory maps while keeping an explicit pool for ADSP remote heap usage.

Fixes 90a58ffa9c55 ("arm64: dts: qcom: kodiak: Add memory region for audiopd")
---
 arch/arm64/boot/dts/qcom/kodiak.dtsi | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
arch/arm64/boot/dts/qcom/kodiak.dtsi +0 -0
index 988ca5f7c8a0..420219823496 100644

arch/arm64/boot/dts/qcom/kodiak.dtsi rmtfs_mem: rmtfs@9c900000 { · line 196

Quoted 9 lines
arch/arm64/boot/dts/qcom/kodiak.dtsi +3 -3
@@ -191,9 +191,12 @@ rmtfs_mem: rmtfs@9c900000 {
 			qcom,vmid = <QCOM_SCM_VMID_MSS_MSA>;
 		};
 
-		adsp_rpc_remote_heap_mem: adsp-rpc-remote-heap@9cb80000 {
-			reg = <0x0 0x9cb80000 0x0 0x800000>;
-			no-map;
+		adsp_rpc_remote_heap_mem: adsp-rpc-remote-heap {
+			compatible = "shared-dma-pool";
+			alloc-ranges = <0x0 0x00000000 0x0 0xffffffff>;

Since DRAM starts at 0x8000_0000, is it intended to only allow this region to be in the lower 2 gigs?

Quoted 2 lines
Quoted 1 line

(it may very well be for some historical reasons)

yes, this is intentional. ADSP supports 32-bit address.

Okay, so I think this should be one of:

<0x0 0x80000000 0x0 0x80000000>;

(where we directly specify the DRAM start, which may just be form over function)

or:

<0x0 0x00000000 0x1 0x00000000>;

to cover 0x0000_0000 - 0xffff_ffff

Konrad

#4 lore raw
Quoted 42 lines · Konrad Dybcio
Quoted 41 lines · Ekansh Gupta
Quoted 40 lines · Konrad Dybcio
Quoted 26 lines · Jianping Li

On KODIAK platforms boot can fail when the DT "adsp-rpc-remote-heap" reserved-memory region overlaps with firmware allocations (UEFI/EFI runtime). The kernel then reports failure to reserve the region and subsequent EFI runtime activity may trigger aborts.

The remote heap node was described as a fixed "no-map" region, which turns it into a hard carveout. Replace it with a "shared-dma-pool" reserved memory region with reusable CMA-backed allocation, specifying alignment and size.

This avoids hard carveouts and reduces the chance of conflicting with firmware memory maps while keeping an explicit pool for ADSP remote heap usage.

Fixes 90a58ffa9c55 ("arm64: dts: qcom: kodiak: Add memory region for audiopd")
---
 arch/arm64/boot/dts/qcom/kodiak.dtsi | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
arch/arm64/boot/dts/qcom/kodiak.dtsi +0 -0
index 988ca5f7c8a0..420219823496 100644

arch/arm64/boot/dts/qcom/kodiak.dtsi rmtfs_mem: rmtfs@9c900000 { · line 196

Quoted 9 lines
arch/arm64/boot/dts/qcom/kodiak.dtsi +3 -3
@@ -191,9 +191,12 @@ rmtfs_mem: rmtfs@9c900000 {
 			qcom,vmid = <QCOM_SCM_VMID_MSS_MSA>;
 		};
 
-		adsp_rpc_remote_heap_mem: adsp-rpc-remote-heap@9cb80000 {
-			reg = <0x0 0x9cb80000 0x0 0x800000>;
-			no-map;
+		adsp_rpc_remote_heap_mem: adsp-rpc-remote-heap {
+			compatible = "shared-dma-pool";
+			alloc-ranges = <0x0 0x00000000 0x0 0xffffffff>;

Since DRAM starts at 0x8000_0000, is it intended to only allow this region to be in the lower 2 gigs?

Quoted 6 lines
Quoted 2 lines
Quoted 1 line

(it may very well be for some historical reasons)

yes, this is intentional. ADSP supports 32-bit address.

Okay, so I think this should be one of:

<0x0 0x80000000 0x0 0x80000000>;

SGTM.

Quoted 11 lines

(where we directly specify the DRAM start, which may just be form over function)

or:

<0x0 0x00000000 0x1 0x00000000>;

to cover 0x0000_0000 - 0xffff_ffff

Konrad