[PATCH] arm64: smccc: adjust quirk id to 32-bits

Vincent Stehlé vincent.stehle at arm.com
Thu Nov 26 01:01:00 PST 2026


The id member of the arm_smccc_quirk structure is declared as a 32-bits
int, but it is loaded as 64-bits. This will load the alignment bytes
present in the structure after id into the high part of the x9 register.

This has no effect in practice, as the alignment bytes are probably zeros,
but fix the load and compare instructions for consistency.

Signed-off-by: Vincent Stehlé <vincent.stehle at arm.com>
Cc: Catalin Marinas <catalin.marinas at arm.com>
Cc: Will Deacon <will at kernel.org>
---
This was tested manually under gdb.
---
 arch/arm64/kernel/smccc-call.S | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/kernel/smccc-call.S b/arch/arm64/kernel/smccc-call.S
index 2def9d0dd3ddb..63ec546722599 100644
--- a/arch/arm64/kernel/smccc-call.S
+++ b/arch/arm64/kernel/smccc-call.S
@@ -15,8 +15,8 @@
 	stp	x2, x3, [x4, #ARM_SMCCC_RES_X2_OFFS]
 	ldr	x4, [sp, #8]
 	cbz	x4, 1f /* no quirk structure */
-	ldr	x9, [x4, #ARM_SMCCC_QUIRK_ID_OFFS]
-	cmp	x9, #ARM_SMCCC_QUIRK_QCOM_A6
+	ldr	w9, [x4, #ARM_SMCCC_QUIRK_ID_OFFS]
+	cmp	w9, #ARM_SMCCC_QUIRK_QCOM_A6
 	b.ne	1f
 	str	x6, [x4, ARM_SMCCC_QUIRK_STATE_OFFS]
 1:	ret

---
base-commit: 25faec9ce61c01fb45abf812a222c5b43c3cd5c5
change-id: 20261126-w9-6cb1b6325f0d

Best regards,
--  
Vincent Stehlé <vincent.stehle at arm.com>




More information about the linux-arm-kernel mailing list