Skip to contentSkip to conversation

arm64: Use EL2 virtual timer when running VHE

PATCH Superseded Marc Zyngier 5 participants 32 messages May 14 – May 22

Subsystems (22)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Marc Zyngier

author maintainer
#0 lore raw

v2 cover arm64: Use EL2 virtual timer when running VHE

This is the second version of the series initially posted at [1], which

- updates the ACPI GTDT parsing to deal the v3 layout and the EL2 virtual timer,
- moves the architected timer driver to use it when running VHE,
- fixes a number of DTs to reflect the reality of the HW.

Patches based on -rc3, tested on Amlogic SM1, QC X1E, Ampere Altra, and Apple M2.

* From v1:

- Now also using the EL2 virtual counter, which further improve things when running at a deeper nesting level

- Updated consistency checks for the platform timers when finding a GTDTv3

- Collected ABs and RBs, with thanks

[1] https://lore.kernel.org/r/[email protected]

Marc Zyngier (17):
ACPI: GTDT: Account for GTDTv3 size when walking the platform timer
descriptors
ACPI: GTDT: Parse information related to the EL2 virtual timer clocksource/drivers/arm_arch_timer: Default to EL2 virtual timer when
running VHE
dt-bindings: timer: arm,arch_timer: Fix requirements for interrupt
description
arm64: dts: allwinner: Add EL2 virtual timer interrupt
arm64: dts: amlogic: Add EL2 virtual timer interrupt
arm64: dts: bst: Add EL2 virtual timer interrupt
arm64: dts: exynos: Add EL2 virtual timer interrupt
arm64: dts: freescale: Add EL2 virtual timer interrupt
arm64: dts: intel: Add EL2 virtual timer interrupt
arm64: dts: mediatek: Add EL2 virtual timer interrupt
arm64: dts: nvidia: Add EL2 virtual timer interrupt
arm64: dts: qcom: Add EL2 virtual timer interrupt
arm64: dts: realtek: Add EL2 virtual timer interrupt
arm64: dts: rockchip: Add EL2 virtual timer interrupt
arm64: dts: sprd: Add EL2 virtual timer interrupt
arm64: dts: xilinx: Add EL2 virtual timer interrupt

 .../bindings/timer/arm,arch_timer.yaml        | 21 ++++-----
 .../arm64/boot/dts/allwinner/sun55i-a523.dtsi |  3 +-
 .../boot/dts/amlogic/amlogic-a4-common.dtsi   |  8 ----
 arch/arm64/boot/dts/amlogic/amlogic-a4.dtsi   |  8 ++++
 arch/arm64/boot/dts/amlogic/amlogic-a5.dtsi   |  9 ++++
 arch/arm64/boot/dts/amlogic/amlogic-s6.dtsi   |  3 +-
 arch/arm64/boot/dts/amlogic/amlogic-s7.dtsi   |  3 +-
 arch/arm64/boot/dts/amlogic/amlogic-s7d.dtsi  |  3 +-
 .../boot/dts/amlogic/meson-g12-common.dtsi    | 13 -----
 arch/arm64/boot/dts/amlogic/meson-g12.dtsi    |  9 ++++
 arch/arm64/boot/dts/amlogic/meson-sm1.dtsi    | 10 ++++
 arch/arm64/boot/dts/bst/bstc1200.dtsi         |  3 +-
 arch/arm64/boot/dts/exynos/axis/artpec9.dtsi  |  3 +-
 arch/arm64/boot/dts/exynos/exynos2200.dtsi    |  3 +-
 arch/arm64/boot/dts/exynos/exynos990.dtsi     |  3 +-
 arch/arm64/boot/dts/exynos/exynosautov9.dtsi  |  3 +-
 arch/arm64/boot/dts/exynos/google/gs101.dtsi  |  3 +-
 .../boot/dts/freescale/imx91_93_common.dtsi   |  3 +-
 arch/arm64/boot/dts/freescale/imx94.dtsi      |  3 +-
 arch/arm64/boot/dts/freescale/imx95.dtsi      |  3 +-
 arch/arm64/boot/dts/freescale/imx952.dtsi     |  3 +-
 arch/arm64/boot/dts/freescale/s32n79.dtsi     |  3 +-
 .../arm64/boot/dts/intel/socfpga_agilex5.dtsi |  3 +-
 arch/arm64/boot/dts/mediatek/mt6779.dtsi      |  3 +-
 arch/arm64/boot/dts/mediatek/mt8186.dtsi      |  3 +-
 arch/arm64/boot/dts/mediatek/mt8188.dtsi      |  3 +-
 arch/arm64/boot/dts/mediatek/mt8192.dtsi      |  3 +-
 arch/arm64/boot/dts/mediatek/mt8195.dtsi      |  3 +-
 arch/arm64/boot/dts/nvidia/tegra194.dtsi      |  2 +
 arch/arm64/boot/dts/nvidia/tegra234.dtsi      |  3 +-
 arch/arm64/boot/dts/qcom/eliza.dtsi           |  3 +-
 arch/arm64/boot/dts/qcom/hamoa.dtsi           |  3 +-
 arch/arm64/boot/dts/qcom/kaanapali.dtsi       |  3 +-
 arch/arm64/boot/dts/qcom/kodiak.dtsi          |  3 +-
 arch/arm64/boot/dts/qcom/lemans.dtsi          |  3 +-
 arch/arm64/boot/dts/qcom/milos.dtsi           |  1 +
 arch/arm64/boot/dts/qcom/monaco.dtsi          |  3 +-
 arch/arm64/boot/dts/qcom/sar2130p.dtsi        |  3 +-
 arch/arm64/boot/dts/qcom/sc7180.dtsi          |  3 +-
 arch/arm64/boot/dts/qcom/sc8180x.dtsi         |  3 +-
 arch/arm64/boot/dts/qcom/sc8280xp.dtsi        |  3 +-
 arch/arm64/boot/dts/qcom/sdm670.dtsi          |  3 +-
 arch/arm64/boot/dts/qcom/sdm845.dtsi          |  3 +-
 arch/arm64/boot/dts/qcom/sdx75.dtsi           |  1 +
 arch/arm64/boot/dts/qcom/sm4450.dtsi          |  3 +-
 arch/arm64/boot/dts/qcom/sm6350.dtsi          |  3 +-
 arch/arm64/boot/dts/qcom/sm6375.dtsi          |  3 +-
 arch/arm64/boot/dts/qcom/sm8150.dtsi          |  3 +-
 arch/arm64/boot/dts/qcom/sm8250.dtsi          |  3 +-
 arch/arm64/boot/dts/qcom/sm8350.dtsi          |  3 +-
 arch/arm64/boot/dts/qcom/sm8450.dtsi          |  3 +-
 arch/arm64/boot/dts/qcom/sm8550.dtsi          |  3 +-
 arch/arm64/boot/dts/qcom/sm8650.dtsi          |  3 +-
 arch/arm64/boot/dts/qcom/sm8750.dtsi          |  3 +-
 arch/arm64/boot/dts/qcom/talos.dtsi           |  3 +-
 arch/arm64/boot/dts/realtek/rtd16xx.dtsi      |  3 +-
 arch/arm64/boot/dts/rockchip/rk356x-base.dtsi |  3 +-
 arch/arm64/boot/dts/sprd/sc9863a.dtsi         |  3 +-
 arch/arm64/boot/dts/sprd/ums512.dtsi          |  3 +-
 arch/arm64/boot/dts/sprd/ums9620.dtsi         |  3 +-
 arch/arm64/boot/dts/xilinx/versal-net.dtsi    |  3 +-
 drivers/acpi/arm64/gtdt.c                     | 35 +++++++++++++-
 drivers/clocksource/arm_arch_timer.c          | 47 +++++++++++--------
 63 files changed, 211 insertions(+), 106 deletions(-)
Signature · 1 line
2.47.3
author maintainer
#1 lore raw

PATCH v2 1/17 ACPI: GTDT: Account for GTDTv3 size when walking the platform timer descriptors

Since ARMv8.1, the architecture has grown an EL2-private virtual timer. This has been described in ACPI since ACPI v6.3 and revision 3 of the GTDT table.

An aditional structure was added in ACPICA, though in a rather bizarre way, and merged in v5.1 as 8f5a14d053100 ("ACPICA: ACPI 6.3:
add GTDT Revision 3 support").

Finally plug the table parsing in GTDT, and correct the parsing of the platform timer subtables to account for the expanded size of the base table.

---
 drivers/acpi/arm64/gtdt.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)
drivers/acpi/arm64/gtdt.c +14 -1
index ffc867bac2d60..b9d9b8edf2df7 100644
@@ -32,6 +32,12 @@ struct acpi_gtdt_descriptor {
 	struct acpi_table_gtdt *gtdt;
 	void *gtdt_end;
 	void *platform_timer;
+	bool v3;
+};
+
+struct gtdt_v3 {
+	struct acpi_table_gtdt	gtdt_v2;
+	struct acpi_gtdt_el2	el2_vtimer;
 };
 
 static struct acpi_gtdt_descriptor acpi_gtdt_desc __initdata;
@@ -39,8 +45,14 @@ static struct acpi_gtdt_descriptor acpi_gtdt_desc __initdata;
 static __init bool platform_timer_valid(void *platform_timer)
 {
 	struct acpi_gtdt_header *gh = platform_timer;
+	void *platform_timer_begin;
+
+	if (acpi_gtdt_desc.v3)
+		platform_timer_begin = container_of(acpi_gtdt_desc.gtdt, struct gtdt_v3, gtdt_v2) + 1;
+	else
+		platform_timer_begin = acpi_gtdt_desc.gtdt + 1;
 
-	return (platform_timer >= (void *)(acpi_gtdt_desc.gtdt + 1) &&
+	return (platform_timer >= platform_timer_begin &&
 		platform_timer < acpi_gtdt_desc.gtdt_end &&
 		gh->length != 0 &&
 		platform_timer + gh->length <= acpi_gtdt_desc.gtdt_end);
@@ -169,6 +181,7 @@ int __init acpi_gtdt_init(struct acpi_table_header *table,
 	acpi_gtdt_desc.gtdt = gtdt;
 	acpi_gtdt_desc.gtdt_end = (void *)table + table->length;
 	acpi_gtdt_desc.platform_timer = NULL;
+	acpi_gtdt_desc.v3 = gtdt->header.revision >= 3 && gtdt->header.length >= sizeof(struct gtdt_v3);
 	if (platform_timer_count)
 		*platform_timer_count = 0;
 
Signature · 1 line
2.47.3
#2 lore raw

Re: [PATCH v2 01/17] ACPI: GTDT: Account for GTDTv3 size when walking the platform timer descriptors

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider: - [High] Insufficient bounds checking in `platform_timer_valid()` allows reading past the end of the ACPI…

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] Insufficient bounds checking in platform_timer_valid() allows reading past the end of the ACPI table.
- [High] Missing base table length validation in acpi_gtdt_init() allows an out-of-bounds read of the GTDT table. --

commit 4d6d9fd7f79fd90d8c3bbeefd718d1658523dfab
Author: Marc Zyngier <[email protected]>

ACPI: GTDT: Account for GTDTv3 size when walking the platform timer descriptors

This commit updates the GTDT table parsing to correctly account for the expanded size of the base table when dealing with GTDT revision 3. It adds support for the additional EL2 virtual timer structure when walking the platform timer descriptors.

Quoted 9 lines
drivers/acpi/arm64/gtdt.c +1 -0
index ffc867bac2d60..b9d9b8edf2df7 100644
@@ -39,8 +45,14 @@ static struct acpi_gtdt_descriptor acpi_gtdt_desc __initdata;
 static __init bool platform_timer_valid(void *platform_timer)
 {
 	struct acpi_gtdt_header *gh = platform_timer;
+	void *platform_timer_begin;

drivers/acpi/arm64/gtdt.c static struct acpi_gtdt_descriptor acpi_gtdt_desc __initdata; · line 57

Quoted 10 lines
drivers/acpi/arm64/gtdt.c +6 -1
+
+	if (acpi_gtdt_desc.v3)
+		platform_timer_begin = container_of(acpi_gtdt_desc.gtdt, struct gtdt_v3, gtdt_v2) + 1;
+	else
+		platform_timer_begin = acpi_gtdt_desc.gtdt + 1;
 
-	return (platform_timer >= (void *)(acpi_gtdt_desc.gtdt + 1) &&
+	return (platform_timer >= platform_timer_begin &&
 		platform_timer < acpi_gtdt_desc.gtdt_end &&
 		gh->length != 0 &&

Is there an out-of-bounds read regression here where the code allows reading past the end of the ACPI table?

The condition platform_timer < acpi_gtdt_desc.gtdt_end only ensures that at least 1 byte remains within the mapped table limits. If a malformed table positions platform_timer exactly 1 or 2 bytes before gtdt_end, evaluating gh->length reads a 16-bit integer at offset 1 from platform_timer.

This causes a read of 1 to 2 bytes past gtdt_end. Should this enforce platform_timer + sizeof(struct acpi_gtdt_header) <= acpi_gtdt_desc.gtdt_end before dereferencing gh->length?

Quoted 2 lines
drivers/acpi/arm64/gtdt.c +0 -0
 		platform_timer + gh->length <= acpi_gtdt_desc.gtdt_end);

}

[ ... ]

drivers/acpi/arm64/gtdt.c int __init acpi_gtdt_init(struct acpi_table_header *table, · line 184

Quoted 5 lines
drivers/acpi/arm64/gtdt.c +1 -0
@@ -169,6 +181,7 @@ int __init acpi_gtdt_init(struct acpi_table_header *table,
 	acpi_gtdt_desc.gtdt = gtdt;
 	acpi_gtdt_desc.gtdt_end = (void *)table + table->length;
 	acpi_gtdt_desc.platform_timer = NULL;
+	acpi_gtdt_desc.v3 = gtdt->header.revision >= 3 && gtdt->header.length >= sizeof(struct gtdt_v3);

Could the lack of base table length validation lead to an out-of-bounds read regression?

While this patch adds a size check for V3 tables, it doesn't appear to verify that the base V2 table meets the minimum length requirement (table->length >= sizeof(struct acpi_table_gtdt)).

If firmware provides a truncated GTDT table containing only the standard 36-byte ACPI header, accessing gtdt->platform_timer_count later in this function reads out-of-bounds memory.

Quoted 3 lines
drivers/acpi/arm64/gtdt.c +0 -0
 	if (platform_timer_count)
 		*platform_timer_count = 0;
 
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
maintainer
#3 lore raw

Re: [PATCH v2 01/17] ACPI: GTDT: Account for GTDTv3 size when walking the platform timer descriptors

In reply to Marc Zyngier
Quoted 52 lines · Marc Zyngier

Since ARMv8.1, the architecture has grown an EL2-private virtual timer. This has been described in ACPI since ACPI v6.3 and revision 3 of the GTDT table.

An aditional structure was added in ACPICA, though in a rather bizarre way, and merged in v5.1 as 8f5a14d053100 ("ACPICA: ACPI 6.3:
add GTDT Revision 3 support").

Finally plug the table parsing in GTDT, and correct the parsing of the platform timer subtables to account for the expanded size of the base table.

---
 drivers/acpi/arm64/gtdt.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)
drivers/acpi/arm64/gtdt.c +13 -1
index ffc867bac2d60..b9d9b8edf2df7 100644
@@ -32,6 +32,12 @@ struct acpi_gtdt_descriptor {
 	struct acpi_table_gtdt *gtdt;
 	void *gtdt_end;
 	void *platform_timer;
+	bool v3;
+};
+
+struct gtdt_v3 {
+	struct acpi_table_gtdt	gtdt_v2;
+	struct acpi_gtdt_el2	el2_vtimer;
 };
 
 static struct acpi_gtdt_descriptor acpi_gtdt_desc __initdata;
@@ -39,8 +45,14 @@ static struct acpi_gtdt_descriptor acpi_gtdt_desc __initdata;
 static __init bool platform_timer_valid(void *platform_timer)
 {
 	struct acpi_gtdt_header *gh = platform_timer;
+	void *platform_timer_begin;
+
+	if (acpi_gtdt_desc.v3)
+		platform_timer_begin = container_of(acpi_gtdt_desc.gtdt, struct gtdt_v3, gtdt_v2) + 1;
+	else
+		platform_timer_begin = acpi_gtdt_desc.gtdt + 1;
 
-	return (platform_timer >= (void *)(acpi_gtdt_desc.gtdt + 1) &&
+	return (platform_timer >= platform_timer_begin &&
 		platform_timer < acpi_gtdt_desc.gtdt_end &&
 		gh->length != 0 &&
 		platform_timer + gh->length <= acpi_gtdt_desc.gtdt_end);

drivers/acpi/arm64/gtdt.c int __init acpi_gtdt_init(struct acpi_table_header *table, · line 184

Quoted 4 lines
drivers/acpi/arm64/gtdt.c +1 -0
@@ -169,6 +181,7 @@ int __init acpi_gtdt_init(struct acpi_table_header *table,
 	acpi_gtdt_desc.gtdt = gtdt;
 	acpi_gtdt_desc.gtdt_end = (void *)table + table->length;
 	acpi_gtdt_desc.platform_timer = NULL;
+	acpi_gtdt_desc.v3 = gtdt->header.revision >= 3 && gtdt->header.length >= sizeof(struct gtdt_v3);

Regarding Sashiko’s comment about the missing length validation for GTDT v2, I realised that the current check could cause a malformed v3 table to be interpreted as v2 if its length does not match the expected v3 length.

It would be better to fail early and return an error rather than allow processing to continue with the table incorrectly interpreted as v2.

Signature · 2 lines
Regards,
Sudeep
author maintainer
#4 lore raw

Re: [PATCH v2 01/17] ACPI: GTDT: Account for GTDTv3 size when walking the platform timer descriptors

Quoted 48 lines · Sudeep Holla
Quoted 46 lines · Marc Zyngier

Since ARMv8.1, the architecture has grown an EL2-private virtual timer. This has been described in ACPI since ACPI v6.3 and revision 3 of the GTDT table.

An aditional structure was added in ACPICA, though in a rather bizarre way, and merged in v5.1 as 8f5a14d053100 ("ACPICA: ACPI 6.3:
add GTDT Revision 3 support").

Finally plug the table parsing in GTDT, and correct the parsing of the platform timer subtables to account for the expanded size of the base table.

---
 drivers/acpi/arm64/gtdt.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)
drivers/acpi/arm64/gtdt.c +12 -0
index ffc867bac2d60..b9d9b8edf2df7 100644
@@ -32,6 +32,12 @@ struct acpi_gtdt_descriptor {
 	struct acpi_table_gtdt *gtdt;
 	void *gtdt_end;
 	void *platform_timer;
+	bool v3;
+};
+
+struct gtdt_v3 {
+	struct acpi_table_gtdt	gtdt_v2;
+	struct acpi_gtdt_el2	el2_vtimer;
 };
 
 static struct acpi_gtdt_descriptor acpi_gtdt_desc __initdata;
@@ -39,8 +45,14 @@ static struct acpi_gtdt_descriptor acpi_gtdt_desc __initdata;
 static __init bool platform_timer_valid(void *platform_timer)
 {
 	struct acpi_gtdt_header *gh = platform_timer;
+	void *platform_timer_begin;
+
+	if (acpi_gtdt_desc.v3)
+		platform_timer_begin = container_of(acpi_gtdt_desc.gtdt, struct gtdt_v3, gtdt_v2) + 1;
+	else
+		platform_timer_begin = acpi_gtdt_desc.gtdt + 1;
 
Quoted 15 lines

drivers/acpi/arm64/gtdt.c int __init acpi_gtdt_init(struct acpi_table_header *table, · line 184

Quoted 10 lines
drivers/acpi/arm64/gtdt.c +2 -1
-	return (platform_timer >= (void *)(acpi_gtdt_desc.gtdt + 1) &&
+	return (platform_timer >= platform_timer_begin &&
 		platform_timer < acpi_gtdt_desc.gtdt_end &&
 		gh->length != 0 &&
 		platform_timer + gh->length <= acpi_gtdt_desc.gtdt_end);
@@ -169,6 +181,7 @@ int __init acpi_gtdt_init(struct acpi_table_header *table,
 	acpi_gtdt_desc.gtdt = gtdt;
 	acpi_gtdt_desc.gtdt_end = (void *)table + table->length;
 	acpi_gtdt_desc.platform_timer = NULL;
+	acpi_gtdt_desc.v3 = gtdt->header.revision >= 3 && gtdt->header.length >= sizeof(struct gtdt_v3);

Regarding Sashiko’s comment about the missing length validation for GTDT v2, I realised that the current check could cause a malformed v3 table to be interpreted as v2 if its length does not match the expected v3 length.

Yeah, that's overall dodgy. As much as I hate having to write a validating parser for ACPI, we need to be prepared for the worst.

Quoted 2 lines

It would be better to fail early and return an error rather than allow processing to continue with the table incorrectly interpreted as v2.

How about something like the hack below?

Thanks,

	M.
drivers/acpi/arm64/gtdt.c +9 -1
index 12bc8875e95e2..ceec69609f038 100644
@@ -202,7 +202,15 @@ int __init acpi_gtdt_init(struct acpi_table_header *table,
 	acpi_gtdt_desc.gtdt = gtdt;
 	acpi_gtdt_desc.gtdt_end = (void *)table + table->length;
 	acpi_gtdt_desc.platform_timer = NULL;
-	acpi_gtdt_desc.v3 = gtdt->header.revision >= 3 && gtdt->header.length >= sizeof(struct gtdt_v3);
+
+	if ((gtdt->header.revision >= 3 && gtdt->header.length < sizeof(struct gtdt_v3)) ||
+	    (gtdt->header.revision == 2 && gtdt->header.length < sizeof(*gtdt))) {
+		pr_err(FW_BUG "GTDT with invalid size %d\n", gtdt->header.length);
+		return -EINVAL;
+	}
+
+	acpi_gtdt_desc.v3 = gtdt->header.revision >= 3;
+
 	if (platform_timer_count)
 		*platform_timer_count = 0;
 
Signature · 1 line
Without deviation from the norm, progress is not possible.
maintainer Reviewed-by
#5 lore raw

Re: [PATCH v2 01/17] ACPI: GTDT: Account for GTDTv3 size when walking the platform timer descriptors

Quoted 66 lines · Marc Zyngier
Quoted 48 lines · Sudeep Holla
Quoted 46 lines · Marc Zyngier

Since ARMv8.1, the architecture has grown an EL2-private virtual timer. This has been described in ACPI since ACPI v6.3 and revision 3 of the GTDT table.

An aditional structure was added in ACPICA, though in a rather bizarre way, and merged in v5.1 as 8f5a14d053100 ("ACPICA: ACPI 6.3:
add GTDT Revision 3 support").

Finally plug the table parsing in GTDT, and correct the parsing of the platform timer subtables to account for the expanded size of the base table.

---
 drivers/acpi/arm64/gtdt.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)
drivers/acpi/arm64/gtdt.c +12 -0
index ffc867bac2d60..b9d9b8edf2df7 100644
@@ -32,6 +32,12 @@ struct acpi_gtdt_descriptor {
 	struct acpi_table_gtdt *gtdt;
 	void *gtdt_end;
 	void *platform_timer;
+	bool v3;
+};
+
+struct gtdt_v3 {
+	struct acpi_table_gtdt	gtdt_v2;
+	struct acpi_gtdt_el2	el2_vtimer;
 };
 
 static struct acpi_gtdt_descriptor acpi_gtdt_desc __initdata;
@@ -39,8 +45,14 @@ static struct acpi_gtdt_descriptor acpi_gtdt_desc __initdata;
 static __init bool platform_timer_valid(void *platform_timer)
 {
 	struct acpi_gtdt_header *gh = platform_timer;
+	void *platform_timer_begin;
+
+	if (acpi_gtdt_desc.v3)
+		platform_timer_begin = container_of(acpi_gtdt_desc.gtdt, struct gtdt_v3, gtdt_v2) + 1;
+	else
+		platform_timer_begin = acpi_gtdt_desc.gtdt + 1;
 
Quoted 15 lines

drivers/acpi/arm64/gtdt.c int __init acpi_gtdt_init(struct acpi_table_header *table, · line 184

Quoted 10 lines
drivers/acpi/arm64/gtdt.c +2 -1
-	return (platform_timer >= (void *)(acpi_gtdt_desc.gtdt + 1) &&
+	return (platform_timer >= platform_timer_begin &&
 		platform_timer < acpi_gtdt_desc.gtdt_end &&
 		gh->length != 0 &&
 		platform_timer + gh->length <= acpi_gtdt_desc.gtdt_end);
@@ -169,6 +181,7 @@ int __init acpi_gtdt_init(struct acpi_table_header *table,
 	acpi_gtdt_desc.gtdt = gtdt;
 	acpi_gtdt_desc.gtdt_end = (void *)table + table->length;
 	acpi_gtdt_desc.platform_timer = NULL;
+	acpi_gtdt_desc.v3 = gtdt->header.revision >= 3 && gtdt->header.length >= sizeof(struct gtdt_v3);

Regarding Sashiko’s comment about the missing length validation for GTDT v2, I realised that the current check could cause a malformed v3 table to be interpreted as v2 if its length does not match the expected v3 length.

Quoted 8 lines

Yeah, that's overall dodgy. As much as I hate having to write a validating parser for ACPI, we need to be prepared for the worst.

Quoted 2 lines

It would be better to fail early and return an error rather than allow processing to continue with the table incorrectly interpreted as v2.

How about something like the hack below?

LGTM and might please Sashiko too.

Signature · 2 lines
Regards,
Sudeep
author maintainer
#6 lore raw

PATCH v2 2/17 ACPI: GTDT: Parse information related to the EL2 virtual timer

In reply to Marc Zyngier

Now that we have a way to identify GTDTv3, allow the information related to the EL2 virtual timer to be retrieved by the interface used by the architected timer driver.

---
 drivers/acpi/arm64/gtdt.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
drivers/acpi/arm64/gtdt.c +20 -0
index b9d9b8edf2df7..d9b43592c22cd 100644
@@ -42,6 +42,14 @@ struct gtdt_v3 {
 
 static struct acpi_gtdt_descriptor acpi_gtdt_desc __initdata;
 
+static __init struct acpi_gtdt_el2 *gtdt_to_el2_vtimer(struct acpi_table_gtdt *gtdt)
+{
+	if (!acpi_gtdt_desc.v3)
+		return NULL;
+
+	return &container_of(gtdt, struct gtdt_v3, gtdt_v2)->el2_vtimer;
+}
+
 static __init bool platform_timer_valid(void *platform_timer)
 {
 	struct acpi_gtdt_header *gh = platform_timer;
@@ -113,6 +121,7 @@ static int __init map_gt_gsi(u32 interrupt, u32 flags)
 int __init acpi_gtdt_map_ppi(int type)
 {
 	struct acpi_table_gtdt *gtdt = acpi_gtdt_desc.gtdt;
+	struct acpi_gtdt_el2 *el2_vtimer = gtdt_to_el2_vtimer(gtdt);
 
 	switch (type) {
 	case ARCH_TIMER_PHYS_NONSECURE_PPI:
@@ -125,6 +134,12 @@ int __init acpi_gtdt_map_ppi(int type)
 	case ARCH_TIMER_HYP_PPI:
 		return map_gt_gsi(gtdt->non_secure_el2_interrupt,
 				  gtdt->non_secure_el2_flags);
+	case ARCH_TIMER_HYP_VIRT_PPI:
+		if (el2_vtimer && el2_vtimer->virtual_el2_timer_gsiv)
+			return map_gt_gsi(el2_vtimer->virtual_el2_timer_gsiv,
+					  el2_vtimer->virtual_el2_timer_flags);
+
+		return 0;
 	default:
 		pr_err("Failed to map timer interrupt: invalid type.\n");
 	}
@@ -142,6 +157,7 @@ int __init acpi_gtdt_map_ppi(int type)
 bool __init acpi_gtdt_c3stop(int type)
 {
 	struct acpi_table_gtdt *gtdt = acpi_gtdt_desc.gtdt;
+	struct acpi_gtdt_el2 *el2_vtimer = gtdt_to_el2_vtimer(gtdt);
 
 	switch (type) {
 	case ARCH_TIMER_PHYS_NONSECURE_PPI:
@@ -153,6 +169,10 @@ bool __init acpi_gtdt_c3stop(int type)
 	case ARCH_TIMER_HYP_PPI:
 		return !(gtdt->non_secure_el2_flags & ACPI_GTDT_ALWAYS_ON);
 
+	case ARCH_TIMER_HYP_VIRT_PPI:
+		return el2_vtimer && el2_vtimer->virtual_el2_timer_gsiv &&
+		       !(el2_vtimer->virtual_el2_timer_flags & ACPI_GTDT_ALWAYS_ON);
+
 	default:
 		pr_err("Failed to get c3stop info: invalid type.\n");
 	}
Signature · 1 line
2.47.3
author maintainer
#7 lore raw

PATCH v2 3/17 clocksource/drivers/arm_arch_timer: Default to EL2 virtual timer when running VHE

In reply to Marc Zyngier

When running with at EL2 with VHE enabled, the architecture provides two EL2 timer/counters, dubbed physical and virtual. Apart from their names, they are strictly identical.

However, they don't get virtualised the same way, specially when it comes to adding arbitrary offsets to the timers. When running as a guest, the host CNTVOFF_EL2 does apply to the guest's view of CNTHV*_El2. This is not true for CNTPOFF_EL2 and CNTHP*_EL2, as the architecture is broken past the first level of virtualisation (it lacks some essential mechanisms to be usable, despite what the ARM ARM pretends).

This means that when running as a L2 guest hypervisor, using the physical timer results in traps to L0, which are then forwarded to L1 in order to emulate the offset, leading to even worse performance due to massive trap amplification (the combination of register and ERET trapping is absolutely lethal).

Switch the arch timer code to using the virtual timer when running in VHE by default, only using the physical timer if the interrupt is not correctly described in the firmware tables (which seems to be an unfortunately common case). This comes as no impact on bare-metal, and slightly improves the situation in the virtualised case.

---
 drivers/clocksource/arm_arch_timer.c | 47 ++++++++++++++++------------
 1 file changed, 27 insertions(+), 20 deletions(-)
drivers/clocksource/arm_arch_timer.c +27 -20
index 90aeff44a2764..e3eb527650ec7 100644
@@ -688,6 +688,7 @@ static void __arch_timer_setup(struct clock_event_device *clk)
 	clk->irq = arch_timer_ppi[arch_timer_uses_ppi];
 	switch (arch_timer_uses_ppi) {
 	case ARCH_TIMER_VIRT_PPI:
+	case ARCH_TIMER_HYP_VIRT_PPI:
 		clk->set_state_shutdown = arch_timer_shutdown_virt;
 		clk->set_state_oneshot_stopped = arch_timer_shutdown_virt;
 		sne = erratum_handler(set_next_event_virt);
@@ -879,7 +880,7 @@ static void __init arch_timer_banner(void)
 	pr_info("cp15 timer running at %lu.%02luMHz (%s).\n",
 		(unsigned long)arch_timer_rate / 1000000,
 		(unsigned long)(arch_timer_rate / 10000) % 100,
-		(arch_timer_uses_ppi == ARCH_TIMER_VIRT_PPI) ? "virt" : "phys");
+		arch_timer_ppi_names[arch_timer_uses_ppi]);
 }
 
 u32 arch_timer_get_rate(void)
@@ -912,7 +913,8 @@ static void __init arch_counter_register(void)
 	int width;
 
 	if ((IS_ENABLED(CONFIG_ARM64) && !is_hyp_mode_available()) ||
-	    arch_timer_uses_ppi == ARCH_TIMER_VIRT_PPI) {
+	    arch_timer_uses_ppi == ARCH_TIMER_VIRT_PPI ||
+	    arch_timer_uses_ppi == ARCH_TIMER_HYP_VIRT_PPI) {
 		if (arch_timer_counter_has_wa()) {
 			rd = arch_counter_get_cntvct_stable;
 			scr = raw_counter_get_cntvct_stable;
@@ -1023,6 +1025,7 @@ static int __init arch_timer_register(void)
 	ppi = arch_timer_ppi[arch_timer_uses_ppi];
 	switch (arch_timer_uses_ppi) {
 	case ARCH_TIMER_VIRT_PPI:
+	case ARCH_TIMER_HYP_VIRT_PPI:
 		err = request_percpu_irq(ppi, arch_timer_handler_virt,
 					 "arch_timer", arch_timer_evt);
 		break;
@@ -1090,25 +1093,34 @@ static int __init arch_timer_common_init(void)
 /**
  * arch_timer_select_ppi() - Select suitable PPI for the current system.
  *
- * If HYP mode is available, we know that the physical timer
- * has been configured to be accessible from PL1. Use it, so
- * that a guest can use the virtual timer instead.
+ * On AArch32, if HYP mode is available, we know that the physical
+ * timer has been configured to be accessible from PL1. Use it, so
+ * that a guest can use the virtual timer instead (though KVM host
+ * support has long been removed).
  *
- * On ARMv8.1 with VH extensions, the kernel runs in HYP. VHE
- * accesses to CNTP_*_EL1 registers are silently redirected to
- * their CNTHP_*_EL2 counterparts, and use a different PPI
- * number.
+ * On ARMv8.1 with FEAT_VHE, the kernel runs in EL2. Accesses to
+ * CNTV_*_EL1 registers are silently redirected to their CNTHV_*_EL2
+ * counterparts, and the timer uses a different PPI number. Similar
+ * thing happen when using the EL2 physical timer. Note that a bunch
+ * of DTs out there omit the virtual EL2 timer, so fallback gracefully
+ * on the physical timer.
+ *
+ * Without VHE, if no interrupt provided for virtual timer, we'll have
+ * to stick to the physical timer. It'd better be accessible...
  *
- * If no interrupt provided for virtual timer, we'll have to
- * stick to the physical timer. It'd better be accessible...
  * For arm64 we never use the secure interrupt.
  *
  * Return: a suitable PPI type for the current system.
  */
 static enum arch_timer_ppi_nr __init arch_timer_select_ppi(void)
 {
-	if (is_kernel_in_hyp_mode())
+	if (is_kernel_in_hyp_mode()) {
+		if (arch_timer_ppi[ARCH_TIMER_HYP_VIRT_PPI])
+			return ARCH_TIMER_HYP_VIRT_PPI;
+
+		pr_warn_once(FW_BUG "VHE-capable CPU without EL2 virtual timer interrupt\n");
 		return ARCH_TIMER_HYP_PPI;
+	}
 
 	if (!is_hyp_mode_available() && arch_timer_ppi[ARCH_TIMER_VIRT_PPI])
 		return ARCH_TIMER_VIRT_PPI;
@@ -1200,14 +1212,9 @@ static int __init arch_timer_acpi_init(struct acpi_table_header *table)
 	if (ret)
 		return ret;
 
-	arch_timer_ppi[ARCH_TIMER_PHYS_NONSECURE_PPI] =
-		acpi_gtdt_map_ppi(ARCH_TIMER_PHYS_NONSECURE_PPI);
-
-	arch_timer_ppi[ARCH_TIMER_VIRT_PPI] =
-		acpi_gtdt_map_ppi(ARCH_TIMER_VIRT_PPI);
-
-	arch_timer_ppi[ARCH_TIMER_HYP_PPI] =
-		acpi_gtdt_map_ppi(ARCH_TIMER_HYP_PPI);
+	/* The GTDT parser can't be bothered with the secure timer */
+	for (int i = ARCH_TIMER_PHYS_NONSECURE_PPI; i < ARCH_TIMER_MAX_TIMER_PPI; i++)
+		arch_timer_ppi[i] = acpi_gtdt_map_ppi(i);
 
 	arch_timer_populate_kvm_info();
 
Signature · 1 line
2.47.3
#8 lore raw

Re: [PATCH v2 03/17] clocksource/drivers/arm_arch_timer: Default to EL2 virtual timer when running VHE

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [High] kvm_arch_ptp_get_crosststamp requests the physical counter from KVM when ARCH_TIMER_HYP_VIRT_PPI…

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] kvm_arch_ptp_get_crosststamp requests the physical counter from KVM when ARCH_TIMER_HYP_VIRT_PPI is used, conflicting with the virtual counter clocksource. --

commit 46b3cf01730c13b97527ab1495a76cb40a0bdad8
Author: Marc Zyngier <[email protected]>

clocksource/drivers/arm_arch_timer: Default to EL2 virtual timer when running VHE

This commit switches the arch timer code to default to the virtual timer when running in VHE mode. It ensures that the system clocksource utilizes the virtual counter by treating ARCH_TIMER_HYP_VIRT_PPI similarly to ARCH_TIMER_VIRT_PPI.

Quoted 4 lines
drivers/clocksource/arm_arch_timer.c +0 -0
index 90aeff44a2764..e3eb527650ec7 100644

[ ... ]

drivers/clocksource/arm_arch_timer.c static void __init arch_counter_register(void) · line 920

Quoted 10 lines
drivers/clocksource/arm_arch_timer.c +2 -1
@@ -912,7 +913,8 @@ static void __init arch_counter_register(void)
 	int width;
 
 	if ((IS_ENABLED(CONFIG_ARM64) && !is_hyp_mode_available()) ||
-	    arch_timer_uses_ppi == ARCH_TIMER_VIRT_PPI) {
+	    arch_timer_uses_ppi == ARCH_TIMER_VIRT_PPI ||
+	    arch_timer_uses_ppi == ARCH_TIMER_HYP_VIRT_PPI) {
 		if (arch_timer_counter_has_wa()) {
 			rd = arch_counter_get_cntvct_stable;
 			scr = raw_counter_get_cntvct_stable;

Could this cause a mismatch in kvm_arch_ptp_get_crosststamp() where it still only checks for ARCH_TIMER_VIRT_PPI?

When ARCH_TIMER_HYP_VIRT_PPI is selected, the clocksource is backed by the virtual counter here, but kvm_arch_ptp_get_crosststamp() will fall through to the else branch and request KVM_PTP_PHYS_COUNTER from KVM:

drivers/clocksource/arm_arch_timer.c:kvm_arch_ptp_get_crosststamp() {
	...
	if (arch_timer_uses_ppi == ARCH_TIMER_VIRT_PPI)
		ptp_counter = KVM_PTP_VIRT_COUNTER;
	else
		ptp_counter = KVM_PTP_PHYS_COUNTER;
	...
}

When running as an L1 guest hypervisor in VHE mode, could this pair the guest's virtual clocksource with the host's returned physical counter timestamp?

Since the host hypervisor (L0) can apply an offset to the virtual counter, comparing the guest's virtual counter cycle with the host's physical counter timestamp might result in an incorrect time offset and affect PTP clock synchronization for nested VHE guests.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=3
author maintainer
#9 lore raw

Re: [PATCH v2 03/17] clocksource/drivers/arm_arch_timer: Default to EL2 virtual timer when running VHE

Quoted 49 lines · On Thu, 14 May 2026 22:23:12 +0100, [email protected] wrote:

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] kvm_arch_ptp_get_crosststamp requests the physical counter from KVM when ARCH_TIMER_HYP_VIRT_PPI is used, conflicting with the virtual counter clocksource. --

commit 46b3cf01730c13b97527ab1495a76cb40a0bdad8
Author: Marc Zyngier <[email protected]>

clocksource/drivers/arm_arch_timer: Default to EL2 virtual timer when running VHE

This commit switches the arch timer code to default to the virtual timer when running in VHE mode. It ensures that the system clocksource utilizes the virtual counter by treating ARCH_TIMER_HYP_VIRT_PPI similarly to ARCH_TIMER_VIRT_PPI.

Quoted 4 lines
drivers/clocksource/arm_arch_timer.c +0 -0
index 90aeff44a2764..e3eb527650ec7 100644

[ ... ]

drivers/clocksource/arm_arch_timer.c static void __init arch_counter_register(void) · line 920

Quoted 10 lines
drivers/clocksource/arm_arch_timer.c +2 -1
@@ -912,7 +913,8 @@ static void __init arch_counter_register(void)
 	int width;
 
 	if ((IS_ENABLED(CONFIG_ARM64) && !is_hyp_mode_available()) ||
-	    arch_timer_uses_ppi == ARCH_TIMER_VIRT_PPI) {
+	    arch_timer_uses_ppi == ARCH_TIMER_VIRT_PPI ||
+	    arch_timer_uses_ppi == ARCH_TIMER_HYP_VIRT_PPI) {
 		if (arch_timer_counter_has_wa()) {
 			rd = arch_counter_get_cntvct_stable;
 			scr = raw_counter_get_cntvct_stable;

Could this cause a mismatch in kvm_arch_ptp_get_crosststamp() where it still only checks for ARCH_TIMER_VIRT_PPI?

When ARCH_TIMER_HYP_VIRT_PPI is selected, the clocksource is backed by the virtual counter here, but kvm_arch_ptp_get_crosststamp() will fall through to the else branch and request KVM_PTP_PHYS_COUNTER from KVM:

drivers/clocksource/arm_arch_timer.c:kvm_arch_ptp_get_crosststamp() {
	...
	if (arch_timer_uses_ppi == ARCH_TIMER_VIRT_PPI)
		ptp_counter = KVM_PTP_VIRT_COUNTER;
	else
		ptp_counter = KVM_PTP_PHYS_COUNTER;
	...
}
Quoted 3 lines

When running as an L1 guest hypervisor in VHE mode, could this pair the guest's virtual clocksource with the host's returned physical counter timestamp?

A VHE guest always sees physical and virtual timer being equal. There should be no offset applied, as per the architecture. The only case where an offset can be applied is when TGE=0 and that FEAT_ECV_POFF is implemented and enabled. But that an offset applied by the guest itself, and not the host.

Quoted 4 lines

Since the host hypervisor (L0) can apply an offset to the virtual counter, comparing the guest's virtual counter cycle with the host's physical counter timestamp might result in an incorrect time offset and affect PTP clock synchronization for nested VHE guests.

If there was an offset applied to one counter but not the other, L0 would be completely buggy.

The only benefit to following the PPI in the case of a VHE guest would be to avoid a trap. So this only affects performance, not correctness.

	M.
Signature · 1 line
Jazz isn't dead. It just smells funny.
author maintainer
#10 lore raw

PATCH v2 4/17 dt-bindings: timer: arm,arch_timer: Fix requirements for interrupt description

In reply to Marc Zyngier

The arm,arch_timer DT binding is extremely imprecise in describing the requirements for interrupts.

Follow the architecture by making it explicit that:
- the EL1 secure timer irq is required if EL3 is implemented
- the EL1 physical timer irq is always required
- the EL1 virtual timer irq is always required
- the EL2 physical timer irq is required if EL2 is implemented
- the EL2 virtual timer irq is required if FEAT_VHE is implemented

The consequence of the above is that the minimum number of interrupts to be described is 2, and not 1.

Finally, clean up the description which made the assumption that the timers are plugged into a GIC (unfortunately, that's not always true), drop the MMIO nonsense that has long be moved to a separate binding, and use the architectural terminology to describe the various interrupts.

---
 .../bindings/timer/arm,arch_timer.yaml        | 21 +++++++------------
 1 file changed, 8 insertions(+), 13 deletions(-)
Documentation/devicetree/bindings/timer/arm,arch_timer.yaml +8 -13
index c5fc3b6c8bd0b..c65e48a155ab6 100644
@@ -10,13 +10,8 @@ maintainers:
   - Marc Zyngier <[email protected]>
   - Mark Rutland <[email protected]>
 description: |+
-  ARM cores may have a per-core architected timer, which provides per-cpu timers,
-  or a memory mapped architected timer, which provides up to 8 frames with a
-  physical and optional virtual timer per frame.
-
-  The per-core architected timer is attached to a GIC to deliver its
-  per-processor interrupts via PPIs. The memory mapped timer is attached to a GIC
-  to deliver its interrupts via SPIs.
+  The per-core architected timer is expected to deliver per-CPU interrupts
+  (commonly to a GIC to deliver its per-processor interrupts as PPIs).
 
 properties:
   compatible:
@@ -33,13 +28,13 @@ properties:
           - const: arm,armv7-timer
 
   interrupts:
-    minItems: 1
+    minItems: 2
     items:
-      - description: secure timer irq
-      - description: non-secure timer irq
-      - description: virtual timer irq
-      - description: hypervisor timer irq
-      - description: hypervisor virtual timer irq
+      - description: EL1 secure physical timer irq, if EL3 is implemented
+      - description: EL1 non-secure physical timer irq
+      - description: EL1 virtual timer irq
+      - description: EL2 physical timer irq, if EL2 is implemented
+      - description: EL2 virtual timer irq, if FEAT_VHE is implemented
 
   interrupt-names:
     oneOf:
Signature · 1 line
2.47.3
#11 lore raw

Re: [PATCH v2 04/17] dt-bindings: timer: arm,arch_timer: Fix requirements for interrupt description

Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider: - [Critical] The schema permits omitting the EL3 secure timer but fails to make `interrupt-names` a…

Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [Critical] The schema permits omitting the EL3 secure timer but fails to make interrupt-names a required property, which allows configurations that fatally misroute interrupts and hang the system.
- [Medium] The static items array with minItems: 2 structurally fails to enforce the stated architectural rules and causes positional misalignment for valid configurations.
- [Medium] The commit incorrectly asserts that the EL1 virtual timer IRQ is 'always required', which misrepresents ARMv7 hardware and contradicts existing device trees. --

commit 01733bbba71a7bef01e5c0820740d8ab21f684f8
Author: Marc Zyngier <[email protected]>

dt-bindings: timer: arm,arch_timer: Fix requirements for interrupt description

This commit updates the arm,arch_timer binding to clarify the requirements for timer interrupts based on the implemented architecture. It raises the minimum number of interrupts to two and uses architectural terminology.

Quoted 4 lines

Follow the architecture by making it explicit that:
- the EL1 secure timer irq is required if EL3 is implemented
- the EL1 physical timer irq is always required
- the EL1 virtual timer irq is always required

Is this description architecturally accurate for ARMv7?

In ARMv7, Virtualization Extensions are optional, so hardware lacking these extensions does not implement a virtual timer. Existing device trees, such as arch/arm/boot/dts/rockchip/rv1108.dtsi, accurately reflect this by providing exactly two physical interrupts (secure and non-secure) and completely omitting the virtual timer.

Establishing the EL1 virtual timer as always required seems to contradict these valid hardware configurations.

Quoted 3 lines
Documentation/devicetree/bindings/timer/arm,arch_timer.yaml +0 -0

[ ... ]

Quoted 5 lines
Documentation/devicetree/bindings/timer/arm,arch_timer.yaml +0 -1
@@ -33,13 +28,13 @@ properties:
           - const: arm,armv7-timer
 
   interrupts:
-    minItems: 1

Documentation/devicetree/bindings/timer/arm,arch_timer.yaml properties: · line 35

Quoted 10 lines
Documentation/devicetree/bindings/timer/arm,arch_timer.yaml +4 -5
+    minItems: 2
     items:
-      - description: secure timer irq
-      - description: non-secure timer irq
-      - description: virtual timer irq
-      - description: hypervisor timer irq
-      - description: hypervisor virtual timer irq
+      - description: EL1 secure physical timer irq, if EL3 is implemented
+      - description: EL1 non-secure physical timer irq
+      - description: EL1 virtual timer irq

Will this static array structure cause positional misalignment and fail to enforce the stated requirements?

JSON Schema array validation evaluates strictly by index. If a platform lacks EL3 and correctly omits the secure timer IRQ, its first provided interrupt (the non-secure physical timer) shifts to index 0. The schema would then incorrectly validate it against the secure physical timer description.

Additionally, because the EL1 virtual timer is listed as the 3rd item,
minItems: 2 only enforces the presence of the first two items. A device with EL3 that erroneously omits the virtual timer would silently pass validation.

Should this be restructured using a oneOf block to define the specific valid sequences?

Since this patch explicitly documents that the secure timer can be omitted, does this create an issue where missing interrupt-names can lead to a system hang?

If a device tree provides the two required interrupts (physical and virtual) and omits interrupt-names, it will pass schema validation with minItems: 2. However, drivers/clocksource/arm_arch_timer.c maps interrupts by strict index if interrupt-names is absent (0 to secure, 1 to non-secure).

This causes the driver to incorrectly map the virtual IRQ as the non-secure physical interrupt. The system will then request the virtual IRQ from the GIC but program the physical timer registers, causing unhandled physical interrupts and a system hang on boot due to missing timer ticks.

Should interrupt-names be made a required property to prevent this valid schema from causing a runtime misconfiguration?

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=4
author maintainer
#12 lore raw

Re: [PATCH v2 04/17] dt-bindings: timer: arm,arch_timer: Fix requirements for interrupt description

Quoted 21 lines · On Thu, 14 May 2026 22:37:07 +0100, [email protected] wrote:

Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [Critical] The schema permits omitting the EL3 secure timer but fails to make interrupt-names a required property, which allows configurations that fatally misroute interrupts and hang the system.
- [Medium] The static items array with minItems: 2 structurally fails to enforce the stated architectural rules and causes positional misalignment for valid configurations.
- [Medium] The commit incorrectly asserts that the EL1 virtual timer IRQ is 'always required', which misrepresents ARMv7 hardware and contradicts existing device trees. --

commit 01733bbba71a7bef01e5c0820740d8ab21f684f8
Author: Marc Zyngier <[email protected]>

dt-bindings: timer: arm,arch_timer: Fix requirements for interrupt description

This commit updates the arm,arch_timer binding to clarify the requirements for timer interrupts based on the implemented architecture. It raises the minimum number of interrupts to two and uses architectural terminology.

Quoted 4 lines

Follow the architecture by making it explicit that:
- the EL1 secure timer irq is required if EL3 is implemented
- the EL1 physical timer irq is always required
- the EL1 virtual timer irq is always required

Quoted 7 lines

Is this description architecturally accurate for ARMv7?

In ARMv7, Virtualization Extensions are optional, so hardware lacking these extensions does not implement a virtual timer. Existing device trees, such as arch/arm/boot/dts/rockchip/rv1108.dtsi, accurately reflect this by providing exactly two physical interrupts (secure and non-secure) and completely omitting the virtual timer.

This *is* valid for all known implementations of ARMv7, as the architected timer is present only on implementations that have the virtualisation extensions.

Quoted 2 lines

Establishing the EL1 virtual timer as always required seems to contradict these valid hardware configurations.

That's because that DT was broken the first place.

Quoted 10 lines
Quoted 4 lines
Documentation/devicetree/bindings/timer/arm,arch_timer.yaml +0 -0

[ ... ]

Quoted 3 lines
Documentation/devicetree/bindings/timer/arm,arch_timer.yaml +0 -0
@@ -33,13 +28,13 @@ properties:
           - const: arm,armv7-timer
 
Quoted 15 lines

Documentation/devicetree/bindings/timer/arm,arch_timer.yaml properties: · line 35

Quoted 12 lines
Documentation/devicetree/bindings/timer/arm,arch_timer.yaml +4 -6
   interrupts:
-    minItems: 1
+    minItems: 2
     items:
-      - description: secure timer irq
-      - description: non-secure timer irq
-      - description: virtual timer irq
-      - description: hypervisor timer irq
-      - description: hypervisor virtual timer irq
+      - description: EL1 secure physical timer irq, if EL3 is implemented
+      - description: EL1 non-secure physical timer irq
+      - description: EL1 virtual timer irq

Will this static array structure cause positional misalignment and fail to enforce the stated requirements?

It always has been a problem, and this is worked around on the sole platform affected by this (APM XGene) by having a dummy interrupt for the secure timer.

We could add a separate requirement that interrupt names must be provided if secure is not implemented, but I have no idea how to specify this.

	M.
Signature · 1 line
Without deviation from the norm, progress is not possible.
author maintainer
#13 lore raw

PATCH v2 5/17 arm64: dts: allwinner: Add EL2 virtual timer interrupt

In reply to Marc Zyngier

The ARMv8.2 based CPUs used in the A523 SoC (and derivatives) are missing the EL2 virtual timer interrupt. Add it.

---
 arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi +2 -1
index 5afa8d92acbfb..d3c47966e8fc8 100644
@@ -101,7 +101,8 @@ timer {
 		interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_HIGH>,
 			     <GIC_PPI 14 IRQ_TYPE_LEVEL_HIGH>,
 			     <GIC_PPI 11 IRQ_TYPE_LEVEL_HIGH>,
-			     <GIC_PPI 10 IRQ_TYPE_LEVEL_HIGH>;
+			     <GIC_PPI 10 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_PPI 12 IRQ_TYPE_LEVEL_HIGH>;
 	};
 
 	soc {
Signature · 1 line
2.47.3
Reviewed-by Tested-by on v2 5/17
#14 lore raw

Re: [PATCH v2 05/17] arm64: dts: allwinner: Add EL2 virtual timer interrupt

Quoted 4 lines · On Thu, 14 May 2026 16:09:33 +0100 Marc Zyngier <[email protected]> wrote:

The ARMv8.2 based CPUs used in the A523 SoC (and derivatives) are missing the EL2 virtual timer interrupt. Add it.

Works, with [v2 03/17] and this patch I see the arch timer IRQ being int ID 28, and working, where it was 26 before. dmesg confirms that:

[    0.000000] arch_timer: cp15 timer running at 24.00MHz (hyp-virt).

Cheers,
Andre

Quoted 18 lines
---
 arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi +2 -1
index 5afa8d92acbfb..d3c47966e8fc8 100644
@@ -101,7 +101,8 @@ timer {
 		interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_HIGH>,
 			     <GIC_PPI 14 IRQ_TYPE_LEVEL_HIGH>,
 			     <GIC_PPI 11 IRQ_TYPE_LEVEL_HIGH>,
-			     <GIC_PPI 10 IRQ_TYPE_LEVEL_HIGH>;
+			     <GIC_PPI 10 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_PPI 12 IRQ_TYPE_LEVEL_HIGH>;
 	};
 
 	soc {
author maintainer
#15 lore raw

PATCH v2 6/17 arm64: dts: amlogic: Add EL2 virtual timer interrupt

In reply to Marc Zyngier

The ARMv8.2 based CPUs used in a number of Amlogic SoCs are missing the EL2 virtual timer interrupt. Add it.

This requires some surgery in the "common" files to move the timer node to locations that makes it possible to add the interrupt only where it is actually implemented.

---
 arch/arm64/boot/dts/amlogic/amlogic-a4-common.dtsi |  8 --------
 arch/arm64/boot/dts/amlogic/amlogic-a4.dtsi        |  8 ++++++++
 arch/arm64/boot/dts/amlogic/amlogic-a5.dtsi        |  9 +++++++++
 arch/arm64/boot/dts/amlogic/amlogic-s6.dtsi        |  3 ++-
 arch/arm64/boot/dts/amlogic/amlogic-s7.dtsi        |  3 ++-
 arch/arm64/boot/dts/amlogic/amlogic-s7d.dtsi       |  3 ++-
 arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi  | 13 -------------
 arch/arm64/boot/dts/amlogic/meson-g12.dtsi         |  9 +++++++++
 arch/arm64/boot/dts/amlogic/meson-sm1.dtsi         | 10 ++++++++++
 9 files changed, 42 insertions(+), 24 deletions(-)
arch/arm64/boot/dts/amlogic/amlogic-a4-common.dtsi +0 -8
index 54d7a2d56ef64..6f559e4dd9ee9 100644
@@ -7,14 +7,6 @@
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/gpio/gpio.h>
 / {
-	timer {
-		compatible = "arm,armv8-timer";
-		interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
-			     <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
-			     <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
-			     <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>;
-	};
-
 	psci {
 		compatible = "arm,psci-1.0";
 		method = "smc";
arch/arm64/boot/dts/amlogic/amlogic-a4.dtsi +8 -0
index fce45933fa28b..c28fc7fcbae7f 100644
@@ -86,6 +86,14 @@ pwrc: power-controller {
 			#power-domain-cells = <1>;
 		};
 	};
+
+	timer {
+		compatible = "arm,armv8-timer";
+		interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
+			     <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
+			     <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
+			     <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>;
+	};
 };
 
 &apb {
arch/arm64/boot/dts/amlogic/amlogic-a5.dtsi +9 -0
index 2b12d8284594f..c22c0acb4807e 100644
@@ -49,6 +49,15 @@ pwrc: power-controller {
 			#power-domain-cells = <1>;
 		};
 	};
+
+	timer {
+		compatible = "arm,armv8-timer";
+		interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
+			     <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
+			     <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
+			     <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
+			     <GIC_PPI 12 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>;
+	};
 };
 
 &apb {
arch/arm64/boot/dts/amlogic/amlogic-s6.dtsi +2 -1
index ab3acef2b147e..853d32929ff46 100644
@@ -56,7 +56,8 @@ timer {
 		interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 14 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 11 IRQ_TYPE_LEVEL_LOW>,
-			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>;
+			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>,
+			     <GIC_PPI 12 IRQ_TYPE_LEVEL_LOW>;
 	};
 
 	psci {
arch/arm64/boot/dts/amlogic/amlogic-s7.dtsi +2 -1
index a3faf4d188e11..bfaac5f3e22da 100644
@@ -94,7 +94,8 @@ timer {
 		interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
 			     <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
 			     <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
-			     <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>;
+			     <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
+			     <GIC_PPI 12 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>;
 	};
 
 	psci {
arch/arm64/boot/dts/amlogic/amlogic-s7d.dtsi +2 -1
index 0c4417bcd6827..32d8683059964 100644
@@ -58,7 +58,8 @@ timer {
 		interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
 			     <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
 			     <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
-			     <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>;
+			     <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
+			     <GIC_PPI 12 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>;
 	};
 
 	psci {
arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi +0 -13
index 00609d2da6743..a911a5181a88d 100644
@@ -2579,19 +2579,6 @@ map {
 		};
 	};
 
-	timer {
-		compatible = "arm,armv8-timer";
-		interrupts = <GIC_PPI 13
-			(GIC_CPU_MASK_RAW(0xff) | IRQ_TYPE_LEVEL_LOW)>,
-			     <GIC_PPI 14
-			(GIC_CPU_MASK_RAW(0xff) | IRQ_TYPE_LEVEL_LOW)>,
-			     <GIC_PPI 11
-			(GIC_CPU_MASK_RAW(0xff) | IRQ_TYPE_LEVEL_LOW)>,
-			     <GIC_PPI 10
-			(GIC_CPU_MASK_RAW(0xff) | IRQ_TYPE_LEVEL_LOW)>;
-		arm,no-tick-in-suspend;
-	};
-
 	xtal: xtal-clk {
 		compatible = "fixed-clock";
 		clock-frequency = <24000000>;
arch/arm64/boot/dts/amlogic/meson-g12.dtsi +9 -0
index 664912d1beaab..866fc07d1b0ae 100644
@@ -43,6 +43,15 @@ tdmif_c: audio-controller-2 {
 		clock-names = "sclk", "lrclk", "mclk";
 		status = "disabled";
 	};
+
+	timer {
+		compatible = "arm,armv8-timer";
+		interrupts = <GIC_PPI 13 (GIC_CPU_MASK_RAW(0xff) | IRQ_TYPE_LEVEL_LOW)>,
+			     <GIC_PPI 14 (GIC_CPU_MASK_RAW(0xff) | IRQ_TYPE_LEVEL_LOW)>,
+			     <GIC_PPI 11 (GIC_CPU_MASK_RAW(0xff) | IRQ_TYPE_LEVEL_LOW)>,
+			     <GIC_PPI 10 (GIC_CPU_MASK_RAW(0xff) | IRQ_TYPE_LEVEL_LOW)>;
+		arm,no-tick-in-suspend;
+	};
 };
 
 &apb {
arch/arm64/boot/dts/amlogic/meson-sm1.dtsi +10 -0
index 8f5b850b1774f..77c72936ffdd3 100644
@@ -128,6 +128,16 @@ l2: l2-cache0 {
 		};
 	};
 
+	timer {
+		compatible = "arm,armv8-timer";
+		interrupts = <GIC_PPI 13 (GIC_CPU_MASK_RAW(0xff) | IRQ_TYPE_LEVEL_LOW)>,
+			     <GIC_PPI 14 (GIC_CPU_MASK_RAW(0xff) | IRQ_TYPE_LEVEL_LOW)>,
+			     <GIC_PPI 11 (GIC_CPU_MASK_RAW(0xff) | IRQ_TYPE_LEVEL_LOW)>,
+			     <GIC_PPI 10 (GIC_CPU_MASK_RAW(0xff) | IRQ_TYPE_LEVEL_LOW)>,
+			     <GIC_PPI 12 (GIC_CPU_MASK_RAW(0xff) | IRQ_TYPE_LEVEL_LOW)>;
+		arm,no-tick-in-suspend;
+	};
+
 	cpu_opp_table: opp-table {
 		compatible = "operating-points-v2";
 		opp-shared;
Signature · 1 line
2.47.3
author maintainer
#16 lore raw

PATCH v2 7/17 arm64: dts: bst: Add EL2 virtual timer interrupt

In reply to Marc Zyngier

The ARMv8.2 based CPUs used in the bst c1200 SoC are missing the EL2 virtual timer interrupt. Add it.

---
 arch/arm64/boot/dts/bst/bstc1200.dtsi | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/bst/bstc1200.dtsi +2 -1
index dd13c6bfc3c89..104ecf76ced10 100644
@@ -92,6 +92,7 @@ timer {
 		interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 14 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 11 IRQ_TYPE_LEVEL_LOW>,
-			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>;
+			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>,
+			     <GIC_PPI 12 IRQ_TYPE_LEVEL_LOW>;
 	};
 };
Signature · 1 line
2.47.3
author maintainer
#17 lore raw

PATCH v2 8/17 arm64: dts: exynos: Add EL2 virtual timer interrupt

In reply to Marc Zyngier

A bunch of Samsung SoCs are missing the EL2 virtual timer interrupt despite using ARMv8.1+ CPUs. Add the missing interrupt, except for those broken designs where the interrupt is documented as not being wired.

---
 arch/arm64/boot/dts/exynos/axis/artpec9.dtsi | 3 ++-
 arch/arm64/boot/dts/exynos/exynos2200.dtsi   | 3 ++-
 arch/arm64/boot/dts/exynos/exynos990.dtsi    | 3 ++-
 arch/arm64/boot/dts/exynos/exynosautov9.dtsi | 3 ++-
 arch/arm64/boot/dts/exynos/google/gs101.dtsi | 3 ++-
 5 files changed, 10 insertions(+), 5 deletions(-)
arch/arm64/boot/dts/exynos/axis/artpec9.dtsi +2 -1
index f8ed43c6e8258..cd46aaf056287 100644
@@ -272,6 +272,7 @@ timer {
 		interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 14 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 11 IRQ_TYPE_LEVEL_LOW>,
-			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>;
+			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>,
+			     <GIC_PPI 12 IRQ_TYPE_LEVEL_LOW>;
 	};
 };
arch/arm64/boot/dts/exynos/exynos2200.dtsi +2 -1
index 6487ccb58ae76..59662f9bdb98f 100644
@@ -1911,7 +1911,8 @@ timer {
 		interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_LOW 0>,
 			     <GIC_PPI 14 IRQ_TYPE_LEVEL_LOW 0>,
 			     <GIC_PPI 11 IRQ_TYPE_LEVEL_LOW 0>,
-			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW 0>;
+			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW 0>,
+			     <GIC_PPI 12 IRQ_TYPE_LEVEL_LOW 0>;
 		/*
 		 * Non-updatable, broken stock Samsung bootloader does not
 		 * configure CNTFRQ_EL0
arch/arm64/boot/dts/exynos/exynos990.dtsi +2 -1
index f8e2a31b4b751..2e6fb24a3c928 100644
@@ -405,7 +405,8 @@ timer {
 		interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>,
 			     <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>,
 			     <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>,
-			     <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>;
+			     <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>,
+			     <GIC_PPI 12 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>;
 
 		/*
 		 * Non-updatable, broken stock Samsung bootloader does not
arch/arm64/boot/dts/exynos/exynosautov9.dtsi +2 -1
index 66628cb32776e..2c34a2b30ad02 100644
@@ -148,7 +148,8 @@ timer {
 		interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>,
 			     <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>,
 			     <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>,
-			     <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>;
+			     <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>,
+			     <GIC_PPI 12 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>;
 	};
 
 	fixed-rate-clocks {
arch/arm64/boot/dts/exynos/google/gs101.dtsi +2 -1
index d085f9fb0f62a..86933f22647b7 100644
@@ -1856,7 +1856,8 @@ timer {
 		   <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW) 0>,
 		   <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW) 0>,
 		   <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW) 0>,
-		   <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW) 0>;
+		   <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW) 0>,
+		   <GIC_PPI 12 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW) 0>;
 	};
 };
 
Signature · 1 line
2.47.3
author maintainer
#18 lore raw

PATCH v2 9/17 arm64: dts: freescale: Add EL2 virtual timer interrupt

In reply to Marc Zyngier

The ARMv8.2 based CPUs used in a number of NXP/FSL SoCs are missing the EL2 virtual timer interrupt. Add it.

---
 arch/arm64/boot/dts/freescale/imx91_93_common.dtsi | 3 ++-
 arch/arm64/boot/dts/freescale/imx94.dtsi           | 3 ++-
 arch/arm64/boot/dts/freescale/imx95.dtsi           | 3 ++-
 arch/arm64/boot/dts/freescale/imx952.dtsi          | 3 ++-
 arch/arm64/boot/dts/freescale/s32n79.dtsi          | 3 ++-
 5 files changed, 10 insertions(+), 5 deletions(-)
arch/arm64/boot/dts/freescale/imx91_93_common.dtsi +2 -1
index 46a5d2df074d5..679b9a6f7160f 100644
@@ -82,7 +82,8 @@ timer {
 		interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 14 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 11 IRQ_TYPE_LEVEL_LOW>,
-			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>;
+			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>,
+			     <GIC_PPI 12 IRQ_TYPE_LEVEL_LOW>;
 		clock-frequency = <24000000>;
 		arm,no-tick-in-suspend;
 		interrupt-parent = <&gic>;
arch/arm64/boot/dts/freescale/imx94.dtsi +2 -1
index c460ece6070f8..7431ce293625b 100644
@@ -147,7 +147,8 @@ timer {
 		interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 14 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 11 IRQ_TYPE_LEVEL_LOW>,
-			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>;
+			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>,
+			     <GIC_PPI 12 IRQ_TYPE_LEVEL_LOW>;
 		clock-frequency = <24000000>;
 		interrupt-parent = <&gic>;
 		arm,no-tick-in-suspend;
arch/arm64/boot/dts/freescale/imx95.dtsi +2 -1
index 71394871d8dd0..e318048dc755b 100644
@@ -524,7 +524,8 @@ timer {
 		interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 14 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 11 IRQ_TYPE_LEVEL_LOW>,
-			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>;
+			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>,
+			     <GIC_PPI 12 IRQ_TYPE_LEVEL_LOW>;
 		clock-frequency = <24000000>;
 		arm,no-tick-in-suspend;
 		interrupt-parent = <&gic>;
arch/arm64/boot/dts/freescale/imx952.dtsi +2 -1
index b30707837f353..7c65956bc72dc 100644
@@ -298,7 +298,8 @@ timer {
 		interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 14 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 11 IRQ_TYPE_LEVEL_LOW>,
-			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>;
+			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>,
+			     <GIC_PPI 12 IRQ_TYPE_LEVEL_LOW>;
 		clock-frequency = <24000000>;
 		arm,no-tick-in-suspend;
 		interrupt-parent = <&gic>;
arch/arm64/boot/dts/freescale/s32n79.dtsi +2 -1
index 94ab58783fdc8..fb40abec4c5cd 100644
@@ -357,6 +357,7 @@ timer: timer {
 		interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 14 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 11 IRQ_TYPE_LEVEL_LOW>,
-			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>;
+			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>,
+			     <GIC_PPI 12 IRQ_TYPE_LEVEL_LOW>;
 	};
 };
Signature · 1 line
2.47.3
author maintainer
#19 lore raw

PATCH v2 10/17 arm64: dts: intel: Add EL2 virtual timer interrupt

In reply to Marc Zyngier

The ARMv8.2 based CPUs used in the agilex5 SoC are missing the EL2 virtual timer interrupt. Add it.

---
 arch/arm64/boot/dts/intel/socfpga_agilex5.dtsi | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/intel/socfpga_agilex5.dtsi +2 -1
index 02e62d954e949..6db2d48b9bad3 100644
@@ -155,7 +155,8 @@ timer {
 		interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 14 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 11 IRQ_TYPE_LEVEL_LOW>,
-			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>;
+			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>,
+			     <GIC_PPI 12 IRQ_TYPE_LEVEL_LOW>;
 	};
 
 	usbphy0: usbphy {
Signature · 1 line
2.47.3
author maintainer
#20 lore raw

PATCH v2 11/17 arm64: dts: mediatek: Add EL2 virtual timer interrupt

In reply to Marc Zyngier

The ARMv8.1+ based CPUs used in a number of Mediatek SoCs are missing the EL2 virtual timer interrupt. Add it.

---
 arch/arm64/boot/dts/mediatek/mt6779.dtsi | 3 ++-
 arch/arm64/boot/dts/mediatek/mt8186.dtsi | 3 ++-
 arch/arm64/boot/dts/mediatek/mt8188.dtsi | 3 ++-
 arch/arm64/boot/dts/mediatek/mt8192.dtsi | 3 ++-
 arch/arm64/boot/dts/mediatek/mt8195.dtsi | 3 ++-
 5 files changed, 10 insertions(+), 5 deletions(-)
arch/arm64/boot/dts/mediatek/mt6779.dtsi +2 -1
index 70f3375916e8c..106df7603d533 100644
@@ -108,7 +108,8 @@ timer {
 		interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_LOW 0>,
 			     <GIC_PPI 14 IRQ_TYPE_LEVEL_LOW 0>,
 			     <GIC_PPI 11 IRQ_TYPE_LEVEL_LOW 0>,
-			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW 0>;
+			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW 0>,
+			     <GIC_PPI 12 IRQ_TYPE_LEVEL_LOW 0>;
 	};
 
 	soc {
arch/arm64/boot/dts/mediatek/mt8186.dtsi +2 -1
index b91f88ffae0e8..a4621ce370d8e 100644
@@ -815,7 +815,8 @@ timer {
 		interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_LOW 0>,
 			     <GIC_PPI 14 IRQ_TYPE_LEVEL_LOW 0>,
 			     <GIC_PPI 11 IRQ_TYPE_LEVEL_LOW 0>,
-			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW 0>;
+			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW 0>,
+			     <GIC_PPI 12 IRQ_TYPE_LEVEL_LOW 0>;
 	};
 
 	soc {
arch/arm64/boot/dts/mediatek/mt8188.dtsi +2 -1
index 75133794cec38..614e75f46c72d 100644
@@ -918,7 +918,8 @@ timer: timer {
 		interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_HIGH 0>,
 			     <GIC_PPI 14 IRQ_TYPE_LEVEL_HIGH 0>,
 			     <GIC_PPI 11 IRQ_TYPE_LEVEL_HIGH 0>,
-			     <GIC_PPI 10 IRQ_TYPE_LEVEL_HIGH 0>;
+			     <GIC_PPI 10 IRQ_TYPE_LEVEL_HIGH 0>,
+			     <GIC_PPI 12 IRQ_TYPE_LEVEL_HIGH 0>;
 		clock-frequency = <13000000>;
 	};
 
arch/arm64/boot/dts/mediatek/mt8192.dtsi +2 -1
index 9f8f115edd4cc..873c4fae6afc9 100644
@@ -328,7 +328,8 @@ timer: timer {
 		interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_HIGH 0>,
 			     <GIC_PPI 14 IRQ_TYPE_LEVEL_HIGH 0>,
 			     <GIC_PPI 11 IRQ_TYPE_LEVEL_HIGH 0>,
-			     <GIC_PPI 10 IRQ_TYPE_LEVEL_HIGH 0>;
+			     <GIC_PPI 10 IRQ_TYPE_LEVEL_HIGH 0>,
+			     <GIC_PPI 12 IRQ_TYPE_LEVEL_HIGH 0>;
 		clock-frequency = <13000000>;
 	};
 
arch/arm64/boot/dts/mediatek/mt8195.dtsi +2 -1
index c72e34c57629d..3c9a7a08612b9 100644
@@ -451,7 +451,8 @@ timer: timer {
 		interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_HIGH 0>,
 			     <GIC_PPI 14 IRQ_TYPE_LEVEL_HIGH 0>,
 			     <GIC_PPI 11 IRQ_TYPE_LEVEL_HIGH 0>,
-			     <GIC_PPI 10 IRQ_TYPE_LEVEL_HIGH 0>;
+			     <GIC_PPI 10 IRQ_TYPE_LEVEL_HIGH 0>,
+			     <GIC_PPI 12 IRQ_TYPE_LEVEL_HIGH 0>;
 	};
 
 	soc {
Signature · 1 line
2.47.3
author maintainer
#21 lore raw

PATCH v2 12/17 arm64: dts: nvidia: Add EL2 virtual timer interrupt

In reply to Marc Zyngier

The ARMv8.2 based CPUs used in a number of nvidia SoCs are missing the EL2 virtual timer interrupt. Add it.

---
 arch/arm64/boot/dts/nvidia/tegra194.dtsi | 2 ++
 arch/arm64/boot/dts/nvidia/tegra234.dtsi | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/nvidia/tegra194.dtsi +2 -0
index 849694f751d90..45cc180ac9973 100644
@@ -3163,6 +3163,8 @@ timer {
 			     <GIC_PPI 11
 				(GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
 			     <GIC_PPI 10
+				(GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
+			     <GIC_PPI 12
 				(GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>;
 		interrupt-parent = <&gic>;
 		always-on;
arch/arm64/boot/dts/nvidia/tegra234.dtsi +2 -1
index 04a95b6658caa..ab9813f9ba30c 100644
@@ -5872,7 +5872,8 @@ timer {
 		interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
 			     <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
 			     <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
-			     <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>;
+			     <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
+			     <GIC_PPI 12 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>;
 		interrupt-parent = <&gic>;
 		always-on;
 	};
Signature · 1 line
2.47.3
author maintainer
#22 lore raw

PATCH v2 13/17 arm64: dts: qcom: Add EL2 virtual timer interrupt

In reply to Marc Zyngier

The ARMv8.1+ based CPUs used in a number of Qualcomm SoCs are missing the EL2 virtual timer interrupt. Add it.

---
 arch/arm64/boot/dts/qcom/eliza.dtsi     | 3 ++-
 arch/arm64/boot/dts/qcom/hamoa.dtsi     | 3 ++-
 arch/arm64/boot/dts/qcom/kaanapali.dtsi | 3 ++-
 arch/arm64/boot/dts/qcom/kodiak.dtsi    | 3 ++-
 arch/arm64/boot/dts/qcom/lemans.dtsi    | 3 ++-
 arch/arm64/boot/dts/qcom/milos.dtsi     | 1 +
 arch/arm64/boot/dts/qcom/monaco.dtsi    | 3 ++-
 arch/arm64/boot/dts/qcom/sar2130p.dtsi  | 3 ++-
 arch/arm64/boot/dts/qcom/sc7180.dtsi    | 3 ++-
 arch/arm64/boot/dts/qcom/sc8180x.dtsi   | 3 ++-
 arch/arm64/boot/dts/qcom/sc8280xp.dtsi  | 3 ++-
 arch/arm64/boot/dts/qcom/sdm670.dtsi    | 3 ++-
 arch/arm64/boot/dts/qcom/sdm845.dtsi    | 3 ++-
 arch/arm64/boot/dts/qcom/sdx75.dtsi     | 1 +
 arch/arm64/boot/dts/qcom/sm4450.dtsi    | 3 ++-
 arch/arm64/boot/dts/qcom/sm6350.dtsi    | 3 ++-
 arch/arm64/boot/dts/qcom/sm6375.dtsi    | 3 ++-
 arch/arm64/boot/dts/qcom/sm8150.dtsi    | 3 ++-
 arch/arm64/boot/dts/qcom/sm8250.dtsi    | 3 ++-
 arch/arm64/boot/dts/qcom/sm8350.dtsi    | 3 ++-
 arch/arm64/boot/dts/qcom/sm8450.dtsi    | 3 ++-
 arch/arm64/boot/dts/qcom/sm8550.dtsi    | 3 ++-
 arch/arm64/boot/dts/qcom/sm8650.dtsi    | 3 ++-
 arch/arm64/boot/dts/qcom/sm8750.dtsi    | 3 ++-
 arch/arm64/boot/dts/qcom/talos.dtsi     | 3 ++-
 25 files changed, 48 insertions(+), 23 deletions(-)
arch/arm64/boot/dts/qcom/eliza.dtsi +2 -1
index 4a7a0ac40ce62..7267e0ec44b2b 100644
@@ -1880,6 +1880,7 @@ timer {
 		interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 14 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 11 IRQ_TYPE_LEVEL_LOW>,
-			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>;
+			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>,
+			     <GIC_PPI 12 IRQ_TYPE_LEVEL_LOW>;
 	};
 };
arch/arm64/boot/dts/qcom/hamoa.dtsi +2 -1
index 051dee0764167..cc638b9162c25 100644
@@ -8982,7 +8982,8 @@ timer {
 		interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 14 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 11 IRQ_TYPE_LEVEL_LOW>,
-			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>;
+			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>,
+			     <GIC_PPI 12 IRQ_TYPE_LEVEL_LOW>;
 	};
 
 	thermal_zones: thermal-zones {
arch/arm64/boot/dts/qcom/kaanapali.dtsi +2 -1
index 7cc326aa1a1aa..149275828f1bc 100644
@@ -6953,7 +6953,8 @@ timer {
 		interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 14 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 11 IRQ_TYPE_LEVEL_LOW>,
-			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>;
+			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>,
+			     <GIC_PPI 12 IRQ_TYPE_LEVEL_LOW>;
 	};
 
 	tpdm-cdsp-llm {
arch/arm64/boot/dts/qcom/kodiak.dtsi +2 -1
index 988ca5f7c8a0e..8e0a1ca0125d1 100644
@@ -7876,6 +7876,7 @@ timer {
 		interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 14 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 11 IRQ_TYPE_LEVEL_LOW>,
-			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>;
+			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>,
+			     <GIC_PPI 12 IRQ_TYPE_LEVEL_LOW>;
 	};
 };
arch/arm64/boot/dts/qcom/lemans.dtsi +2 -1
index fe6e763518230..cd9c964e884f3 100644
@@ -8585,7 +8585,8 @@ arch_timer: timer {
 		interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 14 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 11 IRQ_TYPE_LEVEL_LOW>,
-			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>;
+			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>,
+			     <GIC_PPI 12 IRQ_TYPE_LEVEL_LOW>;
 	};
 
 	turing-llm-tpdm {
arch/arm64/boot/dts/qcom/milos.dtsi +1 -0
index 4a64a98a434b6..b991124b8ce9f 100644
@@ -3235,6 +3235,7 @@ timer {
 		interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_LOW 0>,
 			     <GIC_PPI 14 IRQ_TYPE_LEVEL_LOW 0>,
 			     <GIC_PPI 11 IRQ_TYPE_LEVEL_LOW 0>,
+			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW 0>,
 			     <GIC_PPI 12 IRQ_TYPE_LEVEL_LOW 0>;
 	};
 };
arch/arm64/boot/dts/qcom/monaco.dtsi +2 -1
index 7b1d57460f1e6..38e54b91f0d81 100644
@@ -8312,6 +8312,7 @@ timer {
 		interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 14 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 11 IRQ_TYPE_LEVEL_LOW>,
-			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>;
+			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>,
+			     <GIC_PPI 12 IRQ_TYPE_LEVEL_LOW>;
 	};
 };
arch/arm64/boot/dts/qcom/sar2130p.dtsi +2 -1
index d65ad0df68652..11ea2330f3ac5 100644
@@ -3165,7 +3165,8 @@ timer {
 		interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 14 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 11 IRQ_TYPE_LEVEL_LOW>,
-			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>;
+			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>,
+			     <GIC_PPI 12 IRQ_TYPE_LEVEL_LOW>;
 	};
 
 	thermal-zones {
arch/arm64/boot/dts/qcom/sc7180.dtsi +2 -1
index a4b17564469ee..25a9235f41b7a 100644
@@ -4861,6 +4861,7 @@ timer {
 		interrupts = <GIC_PPI 1 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 2 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 3 IRQ_TYPE_LEVEL_LOW>,
-			     <GIC_PPI 0 IRQ_TYPE_LEVEL_LOW>;
+			     <GIC_PPI 0 IRQ_TYPE_LEVEL_LOW>,
+			     <GIC_PPI 4 IRQ_TYPE_LEVEL_LOW>;
 	};
 };
arch/arm64/boot/dts/qcom/sc8180x.dtsi +2 -1
index f45deb188c6c0..10344e682495c 100644
@@ -4399,6 +4399,7 @@ timer {
 		interrupts = <GIC_PPI 1 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 2 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 3 IRQ_TYPE_LEVEL_LOW>,
-			     <GIC_PPI 0 IRQ_TYPE_LEVEL_LOW>;
+			     <GIC_PPI 0 IRQ_TYPE_LEVEL_LOW>,
+			     <GIC_PPI 4 IRQ_TYPE_LEVEL_LOW>;
 	};
 };
arch/arm64/boot/dts/qcom/sc8280xp.dtsi +2 -1
index 761f229e8f472..e5fc52e6f613e 100644
@@ -7043,6 +7043,7 @@ timer {
 		interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 14 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 11 IRQ_TYPE_LEVEL_LOW>,
-			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>;
+			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>,
+			     <GIC_PPI 12 IRQ_TYPE_LEVEL_LOW>;
 	};
 };
arch/arm64/boot/dts/qcom/sdm670.dtsi +2 -1
index c195c79c1c85b..f6e6ac4d8abcc 100644
@@ -604,7 +604,8 @@ timer {
 		interrupts = <GIC_PPI 1 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 2 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 3 IRQ_TYPE_LEVEL_LOW>,
-			     <GIC_PPI 0 IRQ_TYPE_LEVEL_LOW>;
+			     <GIC_PPI 0 IRQ_TYPE_LEVEL_LOW>,
+			     <GIC_PPI 4 IRQ_TYPE_LEVEL_LOW>;
 	};
 
 	soc: soc@0 {
arch/arm64/boot/dts/qcom/sdm845.dtsi +2 -1
index 4ae8627d6dbc3..9ad4cd36c8927 100644
@@ -6041,6 +6041,7 @@ timer {
 		interrupts = <GIC_PPI 1 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 2 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 3 IRQ_TYPE_LEVEL_LOW>,
-			     <GIC_PPI 0 IRQ_TYPE_LEVEL_LOW>;
+			     <GIC_PPI 0 IRQ_TYPE_LEVEL_LOW>,
+			     <GIC_PPI 4 IRQ_TYPE_LEVEL_LOW>;
 	};
 };
arch/arm64/boot/dts/qcom/sdx75.dtsi +1 -0
index d1b61530b562f..b6cdf71051026 100644
@@ -1583,6 +1583,7 @@ timer {
 		interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 14 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 11 IRQ_TYPE_LEVEL_LOW>,
+			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 12 IRQ_TYPE_LEVEL_LOW>;
 	};
 };
arch/arm64/boot/dts/qcom/sm4450.dtsi +2 -1
index 696e2e0841ad9..c7890f5ab8f13 100644
@@ -681,6 +681,7 @@ timer {
 		interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 14 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 11 IRQ_TYPE_LEVEL_LOW>,
-			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>;
+			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>,
+			     <GIC_PPI 12 IRQ_TYPE_LEVEL_LOW>;
 	};
 };
arch/arm64/boot/dts/qcom/sm6350.dtsi +2 -1
index 034545d2af2d1..a06c1f54e228d 100644
@@ -3528,6 +3528,7 @@ timer {
 		interrupts = <GIC_PPI 1 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 2 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 3 IRQ_TYPE_LEVEL_LOW>,
-			     <GIC_PPI 0 IRQ_TYPE_LEVEL_LOW>;
+			     <GIC_PPI 0 IRQ_TYPE_LEVEL_LOW>,
+			     <GIC_PPI 4 IRQ_TYPE_LEVEL_LOW>;
 	};
 };
arch/arm64/boot/dts/qcom/sm6375.dtsi +2 -1
index ccf572bb1549b..e89cf4829f10b 100644
@@ -2472,6 +2472,7 @@ timer {
 		interrupts = <GIC_PPI 1 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 2 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 3 IRQ_TYPE_LEVEL_LOW>,
-			     <GIC_PPI 0 IRQ_TYPE_LEVEL_LOW>;
+			     <GIC_PPI 0 IRQ_TYPE_LEVEL_LOW>,
+			     <GIC_PPI 4 IRQ_TYPE_LEVEL_LOW>;
 	};
 };
arch/arm64/boot/dts/qcom/sm8150.dtsi +2 -1
index 0e101096209ab..c77fea73eaeee 100644
@@ -4630,7 +4630,8 @@ timer {
 		interrupts = <GIC_PPI 1 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 2 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 3 IRQ_TYPE_LEVEL_LOW>,
-			     <GIC_PPI 0 IRQ_TYPE_LEVEL_LOW>;
+			     <GIC_PPI 0 IRQ_TYPE_LEVEL_LOW>,
+			     <GIC_PPI 4 IRQ_TYPE_LEVEL_LOW>;
 	};
 
 	thermal-zones {
arch/arm64/boot/dts/qcom/sm8250.dtsi +2 -1
index 7076720413ab2..ad44ab7d89fdb 100644
@@ -6293,7 +6293,8 @@ timer {
 		interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 14 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 11 IRQ_TYPE_LEVEL_LOW>,
-			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>;
+			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>,
+			     <GIC_PPI 12 IRQ_TYPE_LEVEL_LOW>;
 	};
 
 	thermal-zones {
arch/arm64/boot/dts/qcom/sm8350.dtsi +2 -1
index c830953156ec6..63081dcc94aac 100644
@@ -4542,6 +4542,7 @@ timer {
 		interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 14 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 11 IRQ_TYPE_LEVEL_LOW>,
-			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>;
+			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>,
+			     <GIC_PPI 12 IRQ_TYPE_LEVEL_LOW>;
 	};
 };
arch/arm64/boot/dts/qcom/sm8450.dtsi +2 -1
index 03bf30b53f289..e7a890dc2e57f 100644
@@ -6327,7 +6327,8 @@ timer {
 		interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 14 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 11 IRQ_TYPE_LEVEL_LOW>,
-			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>;
+			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>,
+			     <GIC_PPI 12 IRQ_TYPE_LEVEL_LOW>;
 		clock-frequency = <19200000>;
 	};
 };
arch/arm64/boot/dts/qcom/sm8550.dtsi +2 -1
index 912525e9bca6f..4958b653678ae 100644
@@ -6806,6 +6806,7 @@ timer {
 		interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_LOW 0>,
 			     <GIC_PPI 14 IRQ_TYPE_LEVEL_LOW 0>,
 			     <GIC_PPI 11 IRQ_TYPE_LEVEL_LOW 0>,
-			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW 0>;
+			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW 0>,
+			     <GIC_PPI 12 IRQ_TYPE_LEVEL_LOW 0>;
 	};
 };
arch/arm64/boot/dts/qcom/sm8650.dtsi +2 -1
index 1604bc8cff373..24714688b50af 100644
@@ -8599,6 +8599,7 @@ timer {
 		interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_LOW 0>,
 			     <GIC_PPI 14 IRQ_TYPE_LEVEL_LOW 0>,
 			     <GIC_PPI 11 IRQ_TYPE_LEVEL_LOW 0>,
-			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW 0>;
+			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW 0>,
+			     <GIC_PPI 12 IRQ_TYPE_LEVEL_LOW 0>;
 	};
 };
arch/arm64/boot/dts/qcom/sm8750.dtsi +2 -1
index 18fb52c14acd7..e9192b806f9f0 100644
@@ -6796,7 +6796,8 @@ timer {
 		interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 14 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 11 IRQ_TYPE_LEVEL_LOW>,
-			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>;
+			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>,
+			     <GIC_PPI 12 IRQ_TYPE_LEVEL_LOW>;
 	};
 
 	tpdm-cdsp-llm {
arch/arm64/boot/dts/qcom/talos.dtsi +2 -1
index ff5afbfce2a47..9b3172e8c5545 100644
@@ -5153,7 +5153,8 @@ arch_timer: timer {
 		interrupts = <GIC_PPI 1 IRQ_TYPE_LEVEL_LOW 0>,
 			     <GIC_PPI 2 IRQ_TYPE_LEVEL_LOW 0>,
 			     <GIC_PPI 3 IRQ_TYPE_LEVEL_LOW 0>,
-			     <GIC_PPI 0 IRQ_TYPE_LEVEL_LOW 0>;
+			     <GIC_PPI 0 IRQ_TYPE_LEVEL_LOW 0>,
+			     <GIC_PPI 4 IRQ_TYPE_LEVEL_LOW 0>;
 	};
 
 	thermal-zones {
Signature · 1 line
2.47.3
#23 lore raw

Re: [PATCH v2 13/17] arm64: dts: qcom: Add EL2 virtual timer interrupt

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] The commit message claims to add the EL2 virtual timer interrupt, but for `sdx75.dtsi` and…

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The commit message claims to add the EL2 virtual timer interrupt, but for sdx75.dtsi and milos.dtsi it actually adds the EL2 physical timer interrupt (GIC_PPI 10). --

commit 3f4b80b2c0c05477bcee12a9ba5b2e0a5b15a672
Author: Marc Zyngier <[email protected]>

arm64: dts: qcom: Add EL2 virtual timer interrupt

This commit adds the missing EL2 virtual timer interrupt to the timer nodes across multiple Qualcomm SoC device trees.

Quoted 4 lines

arm64: dts: qcom: Add EL2 virtual timer interrupt

The ARMv8.1+ based CPUs used in a number of Qualcomm SoCs are missing the EL2 virtual timer interrupt. Add it.

Is this description entirely accurate?

The commit message explicitly states it adds the missing EL2 virtual timer interrupt, but it appears to also add the EL2 physical timer interrupt in a couple of files where the virtual timer was already present.

[ ... ]

arch/arm64/boot/dts/qcom/milos.dtsi timer { · line 3241

Quoted 12 lines
arch/arm64/boot/dts/qcom/milos.dtsi +1 -0
index 4a64a98a434b6..b991124b8ce9f 100644
@@ -3235,6 +3235,7 @@ timer {
 		interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_LOW 0>,
 			     <GIC_PPI 14 IRQ_TYPE_LEVEL_LOW 0>,
 			     <GIC_PPI 11 IRQ_TYPE_LEVEL_LOW 0>,
+			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW 0>,
 			     <GIC_PPI 12 IRQ_TYPE_LEVEL_LOW 0>;
 	};
 };

Does this inadvertently add the EL2 physical timer instead of the virtual timer?

The virtual timer (GIC_PPI 12) is already present here, and this addition is for GIC_PPI 10.

[ ... ]

arch/arm64/boot/dts/qcom/sdx75.dtsi timer { · line 1589

Quoted 12 lines
arch/arm64/boot/dts/qcom/sdx75.dtsi +1 -0
index d1b61530b562f..b6cdf71051026 100644
@@ -1583,6 +1583,7 @@ timer {
 		interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 14 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 11 IRQ_TYPE_LEVEL_LOW>,
+			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 12 IRQ_TYPE_LEVEL_LOW>;
 	};
 };

Similarly, could the commit message be updated to mention this fix, or should this physical timer addition be split into a separate patch?

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=13
author maintainer
#24 lore raw

Re: [PATCH v2 13/17] arm64: dts: qcom: Add EL2 virtual timer interrupt

Quoted 47 lines · On Fri, 15 May 2026 00:06:26 +0100, [email protected] wrote:

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The commit message claims to add the EL2 virtual timer interrupt, but for sdx75.dtsi and milos.dtsi it actually adds the EL2 physical timer interrupt (GIC_PPI 10). --

commit 3f4b80b2c0c05477bcee12a9ba5b2e0a5b15a672
Author: Marc Zyngier <[email protected]>

arm64: dts: qcom: Add EL2 virtual timer interrupt

This commit adds the missing EL2 virtual timer interrupt to the timer nodes across multiple Qualcomm SoC device trees.

Quoted 4 lines

arm64: dts: qcom: Add EL2 virtual timer interrupt

The ARMv8.1+ based CPUs used in a number of Qualcomm SoCs are missing the EL2 virtual timer interrupt. Add it.

Is this description entirely accurate?

The commit message explicitly states it adds the missing EL2 virtual timer interrupt, but it appears to also add the EL2 physical timer interrupt in a couple of files where the virtual timer was already present.

[ ... ]

arch/arm64/boot/dts/qcom/milos.dtsi timer { · line 3241

Quoted 12 lines
arch/arm64/boot/dts/qcom/milos.dtsi +1 -0
index 4a64a98a434b6..b991124b8ce9f 100644
@@ -3235,6 +3235,7 @@ timer {
 		interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_LOW 0>,
 			     <GIC_PPI 14 IRQ_TYPE_LEVEL_LOW 0>,
 			     <GIC_PPI 11 IRQ_TYPE_LEVEL_LOW 0>,
+			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW 0>,
 			     <GIC_PPI 12 IRQ_TYPE_LEVEL_LOW 0>;
 	};
 };

Does this inadvertently add the EL2 physical timer instead of the virtual timer?

The virtual timer (GIC_PPI 12) is already present here, and this addition is for GIC_PPI 10.

[ ... ]

Quoted 15 lines

arch/arm64/boot/dts/qcom/sdx75.dtsi timer { · line 1589

Quoted 12 lines
arch/arm64/boot/dts/qcom/sdx75.dtsi +1 -0
index d1b61530b562f..b6cdf71051026 100644
@@ -1583,6 +1583,7 @@ timer {
 		interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 14 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 11 IRQ_TYPE_LEVEL_LOW>,
+			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 12 IRQ_TYPE_LEVEL_LOW>;
 	};
 };

Similarly, could the commit message be updated to mention this fix, or should this physical timer addition be split into a separate patch?

These hunks were not supposed to be there, and were intended as a separate fix (though I suspect these machines have never booted Linux at EL2...).

I'll drop that from the next round.

	M.
Signature · 1 line
Jazz isn't dead. It just smells funny.
author maintainer
#25 lore raw

PATCH v2 14/17 arm64: dts: realtek: Add EL2 virtual timer interrupt

In reply to Marc Zyngier

The ARMv8.2 based CPUs used in a number of Realtek SoCs are missing the EL2 virtual timer interrupt. Add it.

---
 arch/arm64/boot/dts/realtek/rtd16xx.dtsi | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/realtek/rtd16xx.dtsi +2 -1
index 3a7f6e35b7f74..43b13d133c324 100644
@@ -105,7 +105,8 @@ timer {
 		interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 14 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 11 IRQ_TYPE_LEVEL_LOW>,
-			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>;
+			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>,
+			     <GIC_PPI 12 IRQ_TYPE_LEVEL_LOW>;
 	};
 
 	arm_pmu: pmu {
Signature · 1 line
2.47.3
#26 lore raw

Re: [PATCH v2 14/17] arm64: dts: realtek: Add EL2 virtual timer interrupt

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [High] Incomplete implementation: missing update for Realtek Kent SoC family which specifies an incorrect…

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Incomplete implementation: missing update for Realtek Kent SoC family which specifies an incorrect EL2 virtual timer interrupt. --

commit 3b73638950a28ecc324e1c28fa4fb9fcb13d5567
Author: Marc Zyngier <[email protected]>

arm64: dts: realtek: Add EL2 virtual timer interrupt

This commit adds the missing EL2 virtual timer interrupt to ARMv8.2-based Realtek SoCs. It updates rtd16xx.dtsi by adding the fifth timer interrupt with GIC_PPI 12.

arch/arm64/boot/dts/realtek/rtd16xx.dtsi timer { · line 110

Quoted 12 lines
arch/arm64/boot/dts/realtek/rtd16xx.dtsi +2 -1
index 3a7f6e35b7f74..43b13d133c324 100644
@@ -105,7 +105,8 @@ timer {
 		interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 14 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 11 IRQ_TYPE_LEVEL_LOW>,
-			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>;
+			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>,
+			     <GIC_PPI 12 IRQ_TYPE_LEVEL_LOW>;
 	};

Does this update miss another Realtek ARMv8.2+ SoC file?

Looking at arch/arm64/boot/dts/realtek/kent.dtsi (used by RTD1501, RTD1861, and RTD1920), the fifth timer interrupt is currently defined as <GIC_PPI 9 IRQ_TYPE_LEVEL_HIGH>.

PPI 9 is the GIC vCPU maintenance interrupt, rather than the EL2 virtual timer interrupt which should be PPI 12:

arch/arm64/boot/dts/realtek/kent.dtsi:

	timer {
		compatible = "arm,armv8-timer";
		interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_LOW>,
			     <GIC_PPI 14 IRQ_TYPE_LEVEL_LOW>,
			     <GIC_PPI 11 IRQ_TYPE_LEVEL_LOW>,
			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>,
			     <GIC_PPI  9 IRQ_TYPE_LEVEL_HIGH>;
	};

Another patch in this series (clocksource/drivers/arm_arch_timer: Default to EL2 virtual timer when running VHE) changes the driver to use the EL2 virtual timer by default on VHE systems.

If the kernel uses the EL2 virtual timer on these Realtek SoCs, could it request the wrong interrupt (PPI 9 instead of PPI 12), causing timer interrupts to not be delivered and resulting in a boot hang regression?

[ ... ]

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=14
author maintainer
#27 lore raw

Re: [PATCH v2 14/17] arm64: dts: realtek: Add EL2 virtual timer interrupt

Quoted 46 lines · On Fri, 15 May 2026 00:18:03 +0100, [email protected] wrote:

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Incomplete implementation: missing update for Realtek Kent SoC family which specifies an incorrect EL2 virtual timer interrupt. --

commit 3b73638950a28ecc324e1c28fa4fb9fcb13d5567
Author: Marc Zyngier <[email protected]>

arm64: dts: realtek: Add EL2 virtual timer interrupt

This commit adds the missing EL2 virtual timer interrupt to ARMv8.2-based Realtek SoCs. It updates rtd16xx.dtsi by adding the fifth timer interrupt with GIC_PPI 12.

arch/arm64/boot/dts/realtek/rtd16xx.dtsi timer { · line 110

Quoted 12 lines
arch/arm64/boot/dts/realtek/rtd16xx.dtsi +2 -1
index 3a7f6e35b7f74..43b13d133c324 100644
@@ -105,7 +105,8 @@ timer {
 		interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 14 IRQ_TYPE_LEVEL_LOW>,
 			     <GIC_PPI 11 IRQ_TYPE_LEVEL_LOW>,
-			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>;
+			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>,
+			     <GIC_PPI 12 IRQ_TYPE_LEVEL_LOW>;
 	};

Does this update miss another Realtek ARMv8.2+ SoC file?

Looking at arch/arm64/boot/dts/realtek/kent.dtsi (used by RTD1501, RTD1861, and RTD1920), the fifth timer interrupt is currently defined as <GIC_PPI 9 IRQ_TYPE_LEVEL_HIGH>.

PPI 9 is the GIC vCPU maintenance interrupt, rather than the EL2 virtual timer interrupt which should be PPI 12:

arch/arm64/boot/dts/realtek/kent.dtsi:

	timer {
		compatible = "arm,armv8-timer";
		interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_LOW>,
			     <GIC_PPI 14 IRQ_TYPE_LEVEL_LOW>,
			     <GIC_PPI 11 IRQ_TYPE_LEVEL_LOW>,
			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>,
			     <GIC_PPI  9 IRQ_TYPE_LEVEL_HIGH>;
	};
Quoted 7 lines

Another patch in this series (clocksource/drivers/arm_arch_timer: Default to EL2 virtual timer when running VHE) changes the driver to use the EL2 virtual timer by default on VHE systems.

If the kernel uses the EL2 virtual timer on these Realtek SoCs, could it request the wrong interrupt (PPI 9 instead of PPI 12), causing timer interrupts to not be delivered and resulting in a boot hang regression?

That's definitely odd, as PPI9 is present in two interrupt specifiers (timer and GIC). Obviously, that's not possible.

I'll add a tentative fix for that in the next round. Maybe Andreas or Yu-Chun can check in the meantime?

	M.
Signature · 1 line
Jazz isn't dead. It just smells funny.
#28 lore raw

RE: [PATCH v2 14/17] arm64: dts: realtek: Add EL2 virtual timer interrupt

Quoted 62 lines
Quoted 2 lines · On Fri, 15 May 2026 00:18:03 +0100, [email protected] wrote:

Thank you for your contribution! Sashiko AI review found 1 potential issue(s)

to consider:

Quoted 1 line

- [High] Incomplete implementation: missing update for Realtek Kent SoC

family which specifies an incorrect EL2 virtual timer interrupt.

Quoted 44 lines

--

commit 3b73638950a28ecc324e1c28fa4fb9fcb13d5567
Author: Marc Zyngier <[email protected]>

arm64: dts: realtek: Add EL2 virtual timer interrupt

This commit adds the missing EL2 virtual timer interrupt to ARMv8.2-based Realtek SoCs. It updates rtd16xx.dtsi by adding the fifth timer interrupt with GIC_PPI 12.

arch/arm64/boot/dts/realtek/rtd16xx.dtsi timer { · line 110

Quoted 13 lines
arch/arm64/boot/dts/realtek/rtd16xx.dtsi +2 -1
index 3a7f6e35b7f74..43b13d133c324 100644
@@ -105,7 +105,8 @@ timer {
            interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_LOW>,
                         <GIC_PPI 14 IRQ_TYPE_LEVEL_LOW>,
                         <GIC_PPI 11 IRQ_TYPE_LEVEL_LOW>,
-                        <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>;
+                        <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>,
+                        <GIC_PPI 12 IRQ_TYPE_LEVEL_LOW>;
    };

Does this update miss another Realtek ARMv8.2+ SoC file?

Looking at arch/arm64/boot/dts/realtek/kent.dtsi (used by RTD1501, RTD1861, and RTD1920), the fifth timer interrupt is currently defined as <GIC_PPI 9 IRQ_TYPE_LEVEL_HIGH>.

PPI 9 is the GIC vCPU maintenance interrupt, rather than the EL2 virtual timer interrupt which should be PPI 12:

arch/arm64/boot/dts/realtek/kent.dtsi:

      timer {
              compatible = "arm,armv8-timer";
              interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_LOW>,
                           <GIC_PPI 14 IRQ_TYPE_LEVEL_LOW>,
                           <GIC_PPI 11 IRQ_TYPE_LEVEL_LOW>,
                           <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>,
                           <GIC_PPI  9 IRQ_TYPE_LEVEL_HIGH>;
      };
Quoted 7 lines

Another patch in this series (clocksource/drivers/arm_arch_timer:
Default to EL2 virtual timer when running VHE) changes the driver to use the EL2 virtual timer by default on VHE systems.

If the kernel uses the EL2 virtual timer on these Realtek SoCs, could it request the wrong interrupt (PPI 9 instead of PPI 12), causing timer interrupts to not be delivered and resulting in a boot hang regression?

That's definitely odd, as PPI9 is present in two interrupt specifiers (timer and GIC). Obviously, that's not possible.

Quoted 7 lines

I'll add a tentative fix for that in the next round. Maybe Andreas or Yu-Chun can check in the meantime?

        M.

--
Jazz isn't dead. It just smells funny.

Hi Marc,

I checked with my colleagues and confirmed that this is indeed a typo in kent.dtsi. The fifth interrupt entry should be corrected to:

<GIC_PPI 12 IRQ_TYPE_LEVEL_LOW>;

It would be great if you could include the fix in your next round. Otherwise, just let me know and I'll send a separate patch.

Thanks,
Yu-Chun

author maintainer
#29 lore raw

PATCH v2 15/17 arm64: dts: rockchip: Add EL2 virtual timer interrupt

In reply to Marc Zyngier

The ARMv8.2 based CPUs used in a number of Rockchip SoCs are missing the EL2 virtual timer interrupt. Add it.

---
 arch/arm64/boot/dts/rockchip/rk356x-base.dtsi | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/rockchip/rk356x-base.dtsi +2 -1
index 64bdd8b7754b5..a5832895bd392 100644
@@ -195,7 +195,8 @@ timer {
 		interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_HIGH>,
 			     <GIC_PPI 14 IRQ_TYPE_LEVEL_HIGH>,
 			     <GIC_PPI 11 IRQ_TYPE_LEVEL_HIGH>,
-			     <GIC_PPI 10 IRQ_TYPE_LEVEL_HIGH>;
+			     <GIC_PPI 10 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_PPI 12 IRQ_TYPE_LEVEL_HIGH>;
 		arm,no-tick-in-suspend;
 	};
 
Signature · 1 line
2.47.3
author maintainer
#30 lore raw

PATCH v2 16/17 arm64: dts: sprd: Add EL2 virtual timer interrupt

In reply to Marc Zyngier

The ARMv8.2 based CPUs used in a number of Unisoc SoCs are missing the EL2 virtual timer interrupt. Add it.

---
 arch/arm64/boot/dts/sprd/sc9863a.dtsi | 3 ++-
 arch/arm64/boot/dts/sprd/ums512.dtsi  | 3 ++-
 arch/arm64/boot/dts/sprd/ums9620.dtsi | 3 ++-
 3 files changed, 6 insertions(+), 3 deletions(-)
arch/arm64/boot/dts/sprd/sc9863a.dtsi +2 -1
index 31799579d7f2e..18e61c25aa36f 100644
@@ -130,7 +130,8 @@ timer {
 		interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_HIGH>, /* Physical Secure PPI */
 			     <GIC_PPI 14 IRQ_TYPE_LEVEL_HIGH>, /* Physical Non-Secure PPI */
 			     <GIC_PPI 11 IRQ_TYPE_LEVEL_HIGH>, /* Virtual PPI */
-			     <GIC_PPI 10 IRQ_TYPE_LEVEL_HIGH>; /* Hipervisor PPI */
+			     <GIC_PPI 10 IRQ_TYPE_LEVEL_HIGH>, /* Hypervisor physical PPI */
+			     <GIC_PPI 12 IRQ_TYPE_LEVEL_HIGH>; /* Hypervisor virtual PPI */
 	};
 
 	pmu {
arch/arm64/boot/dts/sprd/ums512.dtsi +2 -1
index efa14309cc4ef..4105647aabd17 100644
@@ -133,7 +133,8 @@ timer {
 		interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_HIGH>, /* Physical Secure PPI */
 			     <GIC_PPI 14 IRQ_TYPE_LEVEL_HIGH>, /* Physical Non-Secure PPI */
 			     <GIC_PPI 11 IRQ_TYPE_LEVEL_HIGH>, /* Virtual PPI */
-			     <GIC_PPI 10 IRQ_TYPE_LEVEL_HIGH>; /* Hipervisor PPI */
+			     <GIC_PPI 10 IRQ_TYPE_LEVEL_HIGH>, /* Hypervisor physical PPI */
+			     <GIC_PPI 12 IRQ_TYPE_LEVEL_HIGH>; /* Hypervisor virtual PPI */
 	};
 
 	pmu-a55 {
arch/arm64/boot/dts/sprd/ums9620.dtsi +2 -1
index 2458071320c9b..037e3401d4991 100644
@@ -141,7 +141,8 @@ timer {
 		interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_HIGH>, /* Physical Secure PPI */
 			     <GIC_PPI 14 IRQ_TYPE_LEVEL_HIGH>, /* Physical Non-Secure PPI */
 			     <GIC_PPI 11 IRQ_TYPE_LEVEL_HIGH>, /* Virtual PPI */
-			     <GIC_PPI 10 IRQ_TYPE_LEVEL_HIGH>; /* Hipervisor PPI */
+			     <GIC_PPI 10 IRQ_TYPE_LEVEL_HIGH>, /* Hypervisor physical PPI */
+			     <GIC_PPI 12 IRQ_TYPE_LEVEL_HIGH>; /* Hypervisor virtual PPI */
 	};
 
 	pmu-a55 {
Signature · 1 line
2.47.3
author maintainer
#31 lore raw

PATCH v2 17/17 arm64: dts: xilinx: Add EL2 virtual timer interrupt

In reply to Marc Zyngier

The ARMv8.2 based CPUs used in the versal SoC are missing the EL2 virtual timer interrupt. Add it.

---
 arch/arm64/boot/dts/xilinx/versal-net.dtsi | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/xilinx/versal-net.dtsi +2 -1
index 15f767608e67f..0aac93675ad77 100644
@@ -728,7 +728,8 @@ fpga: fpga-region {
 
 	timer: timer {
 		compatible = "arm,armv8-timer";
-		interrupts = <1 13 4>, <1 14 4>, <1 11 4>, <1 10 4>;
+		interrupts = <1 13 4>, <1 14 4>, <1 11 4>, <1 10 4>,
+			     <1 12 4>;
 	};
 
 	versal_fpga: versal-fpga {
Signature · 1 line
2.47.3