From: Alex Bee <knaerzche@gmail.com>
To: linux-arch@vger.kernel.org
Cc: Alex Bee <knaerzche@gmail.com>,
linux-arm-kernel@lists.infradead.org,
Russell King <linux@armlinux.org.uk>,
Daniel Jordan <daniel.m.jordan@oracle.com>,
Florian Fainelli <f.fainelli@gmail.com>,
Vlastimil Babka <vbabka@suse.cz>,
Vincenzo Frascino <vincenzo.frascino@arm.com>
Subject: [PATCH] linux: arm: vdso: nullpatch vdso_clock_gettime64 for non-virtual timers
Date: Thu, 16 Jul 2020 17:07:23 +0200 [thread overview]
Message-ID: <20200716150723.9389-1-knaerzche@gmail.com> (raw)
Along with commit commit 74d06efb9c2f ("ARM: 8932/1: Add clock_gettime64
entry point") clock_gettime64 was added for ARM platform to solve the
y2k38 problem on 32-bit platforms. glibc from version 2.31 onwards
started using this vdso-call on ARM platforms.
However it was (probably) forgotten to "nullpatch" this call, when no
reliable timer source is available, for example when
"arm,cpu-registers-not-fw-configured" is defined in devicetree for
"arm,armv7-timer".
This results in erratic time jumps whenever "gettimeofday" gets called,
since the (non-working) vdso-call will be used instead of a syscall.
This patch adds clock_gettime64 to get nullpatched as well. It has been
verified to work and solve this issue on Rockchip RK322x, RK3288 and
RPi4 (32-bit kernel build) platforms.
Signed-off-by: Alex Bee <knaerzche@gmail.com>
---
arch/arm/kernel/vdso.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/kernel/vdso.c b/arch/arm/kernel/vdso.c
index 6bfdca4769a7..fddd08a6e063 100644
--- a/arch/arm/kernel/vdso.c
+++ b/arch/arm/kernel/vdso.c
@@ -184,6 +184,7 @@ static void __init patch_vdso(void *ehdr)
if (!cntvct_ok) {
vdso_nullpatch_one(&einfo, "__vdso_gettimeofday");
vdso_nullpatch_one(&einfo, "__vdso_clock_gettime");
+ vdso_nullpatch_one(&einfo, "__vdso_clock_gettime64");
}
}
--
2.17.1
WARNING: multiple messages have this Message-ID (diff)
From: Alex Bee <knaerzche@gmail.com>
To: linux-arch@vger.kernel.org
Cc: Florian Fainelli <f.fainelli@gmail.com>,
Alex Bee <knaerzche@gmail.com>,
Daniel Jordan <daniel.m.jordan@oracle.com>,
linux-arm-kernel@lists.infradead.org,
Russell King <linux@armlinux.org.uk>,
Vincenzo Frascino <vincenzo.frascino@arm.com>,
Vlastimil Babka <vbabka@suse.cz>
Subject: [PATCH] linux: arm: vdso: nullpatch vdso_clock_gettime64 for non-virtual timers
Date: Thu, 16 Jul 2020 17:07:23 +0200 [thread overview]
Message-ID: <20200716150723.9389-1-knaerzche@gmail.com> (raw)
Along with commit commit 74d06efb9c2f ("ARM: 8932/1: Add clock_gettime64
entry point") clock_gettime64 was added for ARM platform to solve the
y2k38 problem on 32-bit platforms. glibc from version 2.31 onwards
started using this vdso-call on ARM platforms.
However it was (probably) forgotten to "nullpatch" this call, when no
reliable timer source is available, for example when
"arm,cpu-registers-not-fw-configured" is defined in devicetree for
"arm,armv7-timer".
This results in erratic time jumps whenever "gettimeofday" gets called,
since the (non-working) vdso-call will be used instead of a syscall.
This patch adds clock_gettime64 to get nullpatched as well. It has been
verified to work and solve this issue on Rockchip RK322x, RK3288 and
RPi4 (32-bit kernel build) platforms.
Signed-off-by: Alex Bee <knaerzche@gmail.com>
---
arch/arm/kernel/vdso.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/kernel/vdso.c b/arch/arm/kernel/vdso.c
index 6bfdca4769a7..fddd08a6e063 100644
--- a/arch/arm/kernel/vdso.c
+++ b/arch/arm/kernel/vdso.c
@@ -184,6 +184,7 @@ static void __init patch_vdso(void *ehdr)
if (!cntvct_ok) {
vdso_nullpatch_one(&einfo, "__vdso_gettimeofday");
vdso_nullpatch_one(&einfo, "__vdso_clock_gettime");
+ vdso_nullpatch_one(&einfo, "__vdso_clock_gettime64");
}
}
--
2.17.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next reply other threads:[~2020-07-16 15:07 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-16 15:07 Alex Bee [this message]
2020-07-16 15:07 ` [PATCH] linux: arm: vdso: nullpatch vdso_clock_gettime64 for non-virtual timers Alex Bee
2020-07-16 18:46 ` Robin Murphy
2020-07-16 18:46 ` Robin Murphy
2020-07-16 23:25 ` Alex Bee
2020-07-16 23:25 ` Alex Bee
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200716150723.9389-1-knaerzche@gmail.com \
--to=knaerzche@gmail.com \
--cc=daniel.m.jordan@oracle.com \
--cc=f.fainelli@gmail.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux@armlinux.org.uk \
--cc=vbabka@suse.cz \
--cc=vincenzo.frascino@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.