]> Pileus Git - ~andy/linux/commitdiff
arm64: vdso: fix clocksource mask when extracting bottom 56 bits
authorWill Deacon <will.deacon@arm.com>
Fri, 30 Nov 2012 18:34:25 +0000 (18:34 +0000)
committerCatalin Marinas <catalin.marinas@arm.com>
Wed, 5 Dec 2012 11:20:03 +0000 (11:20 +0000)
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>
arch/arm64/kernel/vdso/gettimeofday.S

index dcb8c203a3b26ee85296be9f5142e7f3fca2629b..05c1229a2874642059e972adeeede300298bb875 100644 (file)
@@ -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