public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] arm64: use readq() instead of readl() to read 64bit entry_point
@ 2017-06-26 13:16 Luc Van Oostenryck
  2017-06-26 13:31 ` Will Deacon
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Luc Van Oostenryck @ 2017-06-26 13:16 UTC (permalink / raw)
  To: linux-arm-kernel

Here the entrypoint, declared as a 64 bit integer, is read from
a pointer to 64bit integer but the read is done via readl_relaxed()
which is for 32bit quantities.

All the high bits will thus be lost which change the meaning
of the test against zero done later.

Fix this by using readq_relaxed() instead as it should be for
64bit quantities.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>

---

!!! Warning !!!
   I don't have the HW to test this, nor have I read the ACPI specs.
   This is only compile tested.
---
 arch/arm64/kernel/acpi_parking_protocol.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/kernel/acpi_parking_protocol.c b/arch/arm64/kernel/acpi_parking_protocol.c
index 1f5655cd9..f35e80aad 100644
--- a/arch/arm64/kernel/acpi_parking_protocol.c
+++ b/arch/arm64/kernel/acpi_parking_protocol.c
@@ -125,7 +125,7 @@ static void acpi_parking_protocol_cpu_postboot(void)
 	struct parking_protocol_mailbox __iomem *mailbox = cpu_entry->mailbox;
 	__le64 entry_point;
 
-	entry_point = readl_relaxed(&mailbox->entry_point);
+	entry_point = readq_relaxed(&mailbox->entry_point);
 	/*
 	 * Check if firmware has cleared the entry_point as expected
 	 * by the protocol specification.
-- 
2.13.0

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

end of thread, other threads:[~2017-07-04  0:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-26 13:16 [PATCH] arm64: use readq() instead of readl() to read 64bit entry_point Luc Van Oostenryck
2017-06-26 13:31 ` Will Deacon
2017-06-26 13:31 ` Mark Rutland
2017-07-03  9:44 ` Lorenzo Pieralisi
2017-07-03 23:46 ` No subject Khuong Dinh
2017-07-04  0:07 ` [PATCH] arm64: use readq() instead of readl() to read 64bit entry_point Khuong Dinh

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