mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] arm64: dts: qcom: sdm845: Define guard pages within the rmtfs region
@ 2025-10-20 21:12 David Heidelberg via B4 Relay
  2025-10-21  2:49 ` Paul Sajna
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: David Heidelberg via B4 Relay @ 2025-10-20 21:12 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Paul Sajna
  Cc: linux-arm-msm, devicetree, linux-kernel, phone-devel, David Heidelberg

From: David Heidelberg <david@ixit.cz>

Use qcom,use-guard-pages property instead of polluting device-tree with
lower and upper rmtfs guard nodes.

No functional change intended.

cosmetic: set name the node rmtfs-region.

Signed-off-by: David Heidelberg <david@ixit.cz>
---
Tested on OnePlus 6T.
---
 arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi      | 17 +++--------------
 arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi | 18 +++---------------
 2 files changed, 6 insertions(+), 29 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi b/arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi
index 99dafc6716e76..83b98bad19dd2 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi
@@ -99,26 +99,15 @@ memory@9d400000 {
 			no-map;
 		};
 
-		/* rmtfs lower guard */
-		memory@f0800000 {
-			reg = <0 0xf0800000 0 0x1000>;
-			no-map;
-		};
-
-		rmtfs_mem: memory@f0801000 {
+		rmtfs_mem: rmtfs-region@f0800000 {
 			compatible = "qcom,rmtfs-mem";
-			reg = <0 0xf0801000 0 0x200000>;
+			reg = <0 0xf0800000 0 0x202000>;
+			qcom,use-guard-pages;
 			no-map;
 
 			qcom,client-id = <1>;
 			qcom,vmid = <QCOM_SCM_VMID_MSS_MSA>;
 		};
-
-		/* rmtfs upper guard */
-		memory@f0a01000 {
-			reg = <0 0xf0a01000 0 0x1000>;
-			no-map;
-		};
 	};
 
 	gpio-keys {
diff --git a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
index dcfffb271fcf3..61d63003fa371 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
@@ -75,32 +75,20 @@ key-vol-up {
 	};
 
 	reserved-memory {
-		/*
-		 * The rmtfs_mem needs to be guarded due to "XPU limitations"
-		 * it is otherwise possible for an allocation adjacent to the
-		 * rmtfs_mem region to trigger an XPU violation, causing a crash.
-		 */
-		rmtfs_lower_guard: rmtfs-lower-guard@f5b00000 {
-			no-map;
-			reg = <0 0xf5b00000 0 0x1000>;
-		};
 		/*
 		 * The rmtfs memory region in downstream is 'dynamically allocated'
 		 * but given the same address every time. Hard code it as this address is
 		 * where the modem firmware expects it to be.
 		 */
-		rmtfs_mem: rmtfs-mem@f5b01000 {
+		rmtfs_mem: rmtfs-region@f5b00000 {
 			compatible = "qcom,rmtfs-mem";
-			reg = <0 0xf5b01000 0 0x200000>;
+			reg = <0 0xf5b00000 0 0x202000>;
+			qcom,use-guard-pages;
 			no-map;
 
 			qcom,client-id = <1>;
 			qcom,vmid = <QCOM_SCM_VMID_MSS_MSA>;
 		};
-		rmtfs_upper_guard: rmtfs-upper-guard@f5d01000 {
-			no-map;
-			reg = <0 0xf5d01000 0 0x1000>;
-		};
 
 		/*
 		 * It seems like reserving the old rmtfs_mem region is also needed to prevent

---
base-commit: 606da5bb165594c052ee11de79bf05bc38bc1aa6
change-id: 20251020-sdm845-use-guard-pages-9c2b2fa0b71e

Best regards,
-- 
David Heidelberg <david@ixit.cz>



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] arm64: dts: qcom: sdm845: Define guard pages within the rmtfs region
  2025-10-20 21:12 [PATCH] arm64: dts: qcom: sdm845: Define guard pages within the rmtfs region David Heidelberg via B4 Relay
@ 2025-10-21  2:49 ` Paul Sajna
  2025-10-21  3:21   ` Paul Sajna
  2025-10-21  8:56 ` Konrad Dybcio
  2025-10-27 22:36 ` Bjorn Andersson
  2 siblings, 1 reply; 5+ messages in thread
From: Paul Sajna @ 2025-10-21  2:49 UTC (permalink / raw)
  To: david, Bjorn Andersson, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: linux-arm-msm, devicetree, linux-kernel, phone-devel, David Heidelberg

October 20, 2025 at 9:12 PM, "David Heidelberg via B4 Relay" <devnull+david.ixit.cz@kernel.org mailto:devnull+david.ixit.cz@kernel.org?to=%22David%20Heidelberg%20via%20B4%20Relay%22%20%3Cdevnull%2Bdavid.ixit.cz%40kernel.org%3E > wrote:


> 
> From: David Heidelberg <david@ixit.cz>
> 
> Use qcom,use-guard-pages property instead of polluting device-tree with
> lower and upper rmtfs guard nodes.
> 
> No functional change intended.
> 
> cosmetic: set name the node rmtfs-region.
> 
> Signed-off-by: David Heidelberg <david@ixit.cz>
> ---
> Tested on OnePlus 6T.
> ---
>  arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi | 17 +++--------------
>  arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi | 18 +++---------------
>  2 files changed, 6 insertions(+), 29 deletions(-)
> 
> diff --git a/arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi b/arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi
> index 99dafc6716e76..83b98bad19dd2 100644
> --- a/arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi
> @@ -99,26 +99,15 @@ memory@9d400000 {
>  no-map;
>  };
>  
> - /* rmtfs lower guard */
> - memory@f0800000 {
> - reg = <0 0xf0800000 0 0x1000>;
> - no-map;
> - };
> -
> - rmtfs_mem: memory@f0801000 {
> + rmtfs_mem: rmtfs-region@f0800000 {
>  compatible = "qcom,rmtfs-mem";
> - reg = <0 0xf0801000 0 0x200000>;
> + reg = <0 0xf0800000 0 0x202000>;
> + qcom,use-guard-pages;
>  no-map;
>  
>  qcom,client-id = <1>;
>  qcom,vmid = <QCOM_SCM_VMID_MSS_MSA>;
>  };
> -
> - /* rmtfs upper guard */
> - memory@f0a01000 {
> - reg = <0 0xf0a01000 0 0x1000>;
> - no-map;
> - };
>  };
>  
>  gpio-keys {
> diff --git a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
> index dcfffb271fcf3..61d63003fa371 100644
> --- a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
> @@ -75,32 +75,20 @@ key-vol-up {
>  };
>  
>  reserved-memory {
> - /*
> - * The rmtfs_mem needs to be guarded due to "XPU limitations"
> - * it is otherwise possible for an allocation adjacent to the
> - * rmtfs_mem region to trigger an XPU violation, causing a crash.
> - */
> - rmtfs_lower_guard: rmtfs-lower-guard@f5b00000 {
> - no-map;
> - reg = <0 0xf5b00000 0 0x1000>;
> - };
>  /*
>  * The rmtfs memory region in downstream is 'dynamically allocated'
>  * but given the same address every time. Hard code it as this address is
>  * where the modem firmware expects it to be.
>  */
> - rmtfs_mem: rmtfs-mem@f5b01000 {
> + rmtfs_mem: rmtfs-region@f5b00000 {
>  compatible = "qcom,rmtfs-mem";
> - reg = <0 0xf5b01000 0 0x200000>;
> + reg = <0 0xf5b00000 0 0x202000>;
> + qcom,use-guard-pages;
>  no-map;
>  
>  qcom,client-id = <1>;
>  qcom,vmid = <QCOM_SCM_VMID_MSS_MSA>;
>  };
> - rmtfs_upper_guard: rmtfs-upper-guard@f5d01000 {
> - no-map;
> - reg = <0 0xf5d01000 0 0x1000>;
> - };
>  
>  /*
>  * It seems like reserving the old rmtfs_mem region is also needed to prevent
> 
> ---
> base-commit: 606da5bb165594c052ee11de79bf05bc38bc1aa6
> change-id: 20251020-sdm845-use-guard-pages-9c2b2fa0b71e
> 
> Best regards,
> -- 
> David Heidelberg <david@ixit.cz>
>

I tried something similar before and didn't have much luck with it. I'll test your patch when I have time.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] arm64: dts: qcom: sdm845: Define guard pages within the rmtfs region
  2025-10-21  2:49 ` Paul Sajna
@ 2025-10-21  3:21   ` Paul Sajna
  0 siblings, 0 replies; 5+ messages in thread
From: Paul Sajna @ 2025-10-21  3:21 UTC (permalink / raw)
  To: david, Bjorn Andersson, Konrad Dybcio, Rob Herring,
	Krzysztof  Kozlowski, Conor Dooley
  Cc: linux-arm-msm, devicetree, linux-kernel, phone-devel, David  Heidelberg

October 21, 2025 at 2:49 AM, "Paul Sajna" <sajattack@postmarketos.org mailto:sajattack@postmarketos.org?to=%22Paul%20Sajna%22%20%3Csajattack%40postmarketos.org%3E > wrote:
> I tried something similar before and didn't have much luck with it. I'll test your patch when I have time.

Your version works as far as I can tell. 
ModemManager always reports sim-missing on judyln, so I can't fully test it, but no crashes and qrtr-lookup shows rmtfs is working.

Tested-By: Paul Sajna <sajattack@postmarketos.org>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] arm64: dts: qcom: sdm845: Define guard pages within the rmtfs region
  2025-10-20 21:12 [PATCH] arm64: dts: qcom: sdm845: Define guard pages within the rmtfs region David Heidelberg via B4 Relay
  2025-10-21  2:49 ` Paul Sajna
@ 2025-10-21  8:56 ` Konrad Dybcio
  2025-10-27 22:36 ` Bjorn Andersson
  2 siblings, 0 replies; 5+ messages in thread
From: Konrad Dybcio @ 2025-10-21  8:56 UTC (permalink / raw)
  To: david, Bjorn Andersson, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Paul Sajna
  Cc: linux-arm-msm, devicetree, linux-kernel, phone-devel

On 10/20/25 11:12 PM, David Heidelberg via B4 Relay wrote:
> From: David Heidelberg <david@ixit.cz>
> 
> Use qcom,use-guard-pages property instead of polluting device-tree with
> lower and upper rmtfs guard nodes.
> 
> No functional change intended.
> 
> cosmetic: set name the node rmtfs-region.
> 
> Signed-off-by: David Heidelberg <david@ixit.cz>
> ---

Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>

Konrad

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] arm64: dts: qcom: sdm845: Define guard pages within the rmtfs region
  2025-10-20 21:12 [PATCH] arm64: dts: qcom: sdm845: Define guard pages within the rmtfs region David Heidelberg via B4 Relay
  2025-10-21  2:49 ` Paul Sajna
  2025-10-21  8:56 ` Konrad Dybcio
@ 2025-10-27 22:36 ` Bjorn Andersson
  2 siblings, 0 replies; 5+ messages in thread
From: Bjorn Andersson @ 2025-10-27 22:36 UTC (permalink / raw)
  To: Konrad Dybcio, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Paul Sajna, David Heidelberg
  Cc: linux-arm-msm, devicetree, linux-kernel, phone-devel


On Mon, 20 Oct 2025 23:12:56 +0200, David Heidelberg wrote:
> Use qcom,use-guard-pages property instead of polluting device-tree with
> lower and upper rmtfs guard nodes.
> 
> No functional change intended.
> 
> cosmetic: set name the node rmtfs-region.
> 
> [...]

Applied, thanks!

[1/1] arm64: dts: qcom: sdm845: Define guard pages within the rmtfs region
      commit: ab9a2c821ad229c4e8dd48b0126e40cc85a8cd51

Best regards,
-- 
Bjorn Andersson <andersson@kernel.org>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-10-27 22:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-10-20 21:12 [PATCH] arm64: dts: qcom: sdm845: Define guard pages within the rmtfs region David Heidelberg via B4 Relay
2025-10-21  2:49 ` Paul Sajna
2025-10-21  3:21   ` Paul Sajna
2025-10-21  8:56 ` Konrad Dybcio
2025-10-27 22:36 ` Bjorn Andersson

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®