Browse Source

arm64: vdso: fix clocksource mask when extracting bottom 56 bits

The generic timer clocksource has 56 bits of precision and as such must
be masked appropriately after we have read it. The current mask
generated by a movn instruction is off by 4 bits, so we accidentally
include the top 4 bits in the final value.

This patch fixes the broken mask.

Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Will Deacon 12 years ago
parent
commit
251db45336
1 changed files with 1 additions and 1 deletions
  1. 1 1
      arch/arm64/kernel/vdso/gettimeofday.S

+ 1 - 1
arch/arm64/kernel/vdso/gettimeofday.S

@@ -223,7 +223,7 @@ ENTRY(__do_get_tspec)
 	/* Calculate cycle delta and convert to ns. */
 	sub	x10, x9, x10
 	/* We can only guarantee 56 bits of precision. */
-	movn	x9, #0xff0, lsl #48
+	movn	x9, #0xff00, lsl #48
 	and	x10, x9, x10
 	mul	x10, x10, x14
 	lsr	x10, x10, x15