Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arm64: smccc: adjust quirk id to 32-bits
@ 2026-11-26  9:01 Vincent Stehlé
  2026-12-04 16:56 ` Catalin Marinas
  0 siblings, 1 reply; 2+ messages in thread
From: Vincent Stehlé @ 2026-11-26  9:01 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon, Mark Rutland
  Cc: linux-arm-kernel, Vincent Stehlé

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@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@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@arm.com>



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

* Re: [PATCH] arm64: smccc: adjust quirk id to 32-bits
  2026-11-26  9:01 [PATCH] arm64: smccc: adjust quirk id to 32-bits Vincent Stehlé
@ 2026-12-04 16:56 ` Catalin Marinas
  0 siblings, 0 replies; 2+ messages in thread
From: Catalin Marinas @ 2026-12-04 16:56 UTC (permalink / raw)
  To: Vincent Stehlé; +Cc: Will Deacon, Mark Rutland, linux-arm-kernel

On Thu, Nov 26, 2026 at 10:01:00AM +0100, Vincent Stehlé wrote:
> 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@arm.com>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will@kernel.org>

Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>


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

end of thread, other threads:[~2026-12-04 16:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-26  9:01 [PATCH] arm64: smccc: adjust quirk id to 32-bits Vincent Stehlé
2026-12-04 16:56 ` Catalin Marinas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox