From: Christophe Leroy Date: Thu, 4 Apr 2019 12:20:05 +0000 (+0000) Subject: powerpc/vdso32: fix CLOCK_MONOTONIC on PPC64 X-Git-Tag: Ubuntu-5.0.0-21.22~680 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=7aa5c7d8bcb66f4edee4b43b4f4949044d433ed6;p=mirror_ubuntu-disco-kernel.git powerpc/vdso32: fix CLOCK_MONOTONIC on PPC64 BugLink: https://bugs.launchpad.net/bugs/1830929 [ Upstream commit dd9a994fc68d196a052b73747e3366c57d14a09e ] Commit b5b4453e7912 ("powerpc/vdso64: Fix CLOCK_MONOTONIC inconsistencies across Y2038") changed the type of wtom_clock_sec to s64 on PPC64. Therefore, VDSO32 needs to read it with a 4 bytes shift in order to retrieve the lower part of it. Fixes: b5b4453e7912 ("powerpc/vdso64: Fix CLOCK_MONOTONIC inconsistencies across Y2038") Reported-by: Christian Zigotzky Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Signed-off-by: Sasha Levin Signed-off-by: Stefan Bader Signed-off-by: Kleber Sacilotto de Souza --- diff --git a/arch/powerpc/kernel/vdso32/gettimeofday.S b/arch/powerpc/kernel/vdso32/gettimeofday.S index 1e0bc5955a40..afd516b572f8 100644 --- a/arch/powerpc/kernel/vdso32/gettimeofday.S +++ b/arch/powerpc/kernel/vdso32/gettimeofday.S @@ -98,7 +98,7 @@ V_FUNCTION_BEGIN(__kernel_clock_gettime) * can be used, r7 contains NSEC_PER_SEC. */ - lwz r5,WTOM_CLOCK_SEC(r9) + lwz r5,(WTOM_CLOCK_SEC+LOPART)(r9) lwz r6,WTOM_CLOCK_NSEC(r9) /* We now have our offset in r5,r6. We create a fake dependency