]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/5.0.11/powerpc-vdso32-fix-clock_monotonic-on-ppc64.patch
4.14-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 5.0.11 / powerpc-vdso32-fix-clock_monotonic-on-ppc64.patch
1 From 0e20067714cf44e7cdf36ab315b814192e28d9ca Mon Sep 17 00:00:00 2001
2 From: Christophe Leroy <christophe.leroy@c-s.fr>
3 Date: Thu, 4 Apr 2019 12:20:05 +0000
4 Subject: powerpc/vdso32: fix CLOCK_MONOTONIC on PPC64
5
6 [ Upstream commit dd9a994fc68d196a052b73747e3366c57d14a09e ]
7
8 Commit b5b4453e7912 ("powerpc/vdso64: Fix CLOCK_MONOTONIC
9 inconsistencies across Y2038") changed the type of wtom_clock_sec
10 to s64 on PPC64. Therefore, VDSO32 needs to read it with a 4 bytes
11 shift in order to retrieve the lower part of it.
12
13 Fixes: b5b4453e7912 ("powerpc/vdso64: Fix CLOCK_MONOTONIC inconsistencies across Y2038")
14 Reported-by: Christian Zigotzky <chzigotzky@xenosoft.de>
15 Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
16 Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
17 Signed-off-by: Sasha Levin <sashal@kernel.org>
18 ---
19 arch/powerpc/kernel/vdso32/gettimeofday.S | 2 +-
20 1 file changed, 1 insertion(+), 1 deletion(-)
21
22 diff --git a/arch/powerpc/kernel/vdso32/gettimeofday.S b/arch/powerpc/kernel/vdso32/gettimeofday.S
23 index 1e0bc5955a40..afd516b572f8 100644
24 --- a/arch/powerpc/kernel/vdso32/gettimeofday.S
25 +++ b/arch/powerpc/kernel/vdso32/gettimeofday.S
26 @@ -98,7 +98,7 @@ V_FUNCTION_BEGIN(__kernel_clock_gettime)
27 * can be used, r7 contains NSEC_PER_SEC.
28 */
29
30 - lwz r5,WTOM_CLOCK_SEC(r9)
31 + lwz r5,(WTOM_CLOCK_SEC+LOPART)(r9)
32 lwz r6,WTOM_CLOCK_NSEC(r9)
33
34 /* We now have our offset in r5,r6. We create a fake dependency
35 --
36 2.19.1
37