Message ID | 20200116235731.22395-1-f.fainelli@gmail.com (mailing list archive) |
---|---|
State | Mainlined |
Commit | 45939ce292b4b11159719faaf60aba7d58d5fe33 |
Headers | show |
Series | ARM: VDSO: Match ARMv8 timer in cntvct_functional() | expand |
On 1/16/2020 3:57 PM, Florian Fainelli wrote: > It is possible for a system with an ARMv8 timer to run a 32-bit kernel. > When this happens we will unconditionally have the vDSO code remove the > __vdso_gettimeofday and __vdso_clock_gettime symbols because > cntvct_functional() returns false since it does not match that > compatibility string. > > Fixes: ecf99a439105 ("ARM: 8331/1: VDSO initialization, mapping, and synchronization") > Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Submitted: https://www.armlinux.org.uk/developer/patches/viewpatch.php?id=8957/1
diff --git a/arch/arm/kernel/vdso.c b/arch/arm/kernel/vdso.c index c89ac1b9d28b..e0330a25e1c6 100644 --- a/arch/arm/kernel/vdso.c +++ b/arch/arm/kernel/vdso.c @@ -94,6 +94,8 @@ static bool __init cntvct_functional(void) * this. */ np = of_find_compatible_node(NULL, NULL, "arm,armv7-timer"); + if (!np) + np = of_find_compatible_node(NULL, NULL, "arm,armv8-timer"); if (!np) goto out_put;
It is possible for a system with an ARMv8 timer to run a 32-bit kernel. When this happens we will unconditionally have the vDSO code remove the __vdso_gettimeofday and __vdso_clock_gettime symbols because cntvct_functional() returns false since it does not match that compatibility string. Fixes: ecf99a439105 ("ARM: 8331/1: VDSO initialization, mapping, and synchronization") Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> --- Hi all, This was found by one of our customers and the following test program below can be used to find whether the "bug" is fixed or not. The Fixes tag is much after the arm_arch_timer.c gained support for the ARMv8 timers, which is why it is being referenced. #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <dlfcn.h> #define ARM_LDSO_NAME "linux-vdso.so.1" int main(int argc, char **argv) { void *h, *sym[2]; h = dlopen(ARM_LDSO_NAME, RTLD_NOW); if (!h) { fprintf(stderr, "failed top dlopen\n"); return 1; } sym[0] = dlsym(h, "__vdso_gettimeofday"); sym[1] = dlsym(h, "__vdso_clock_gettime"); if (!sym[0] && !sym[1]) { fprintf(stderr, "Kernel does not provide symbols, check DT!\n"); } else { fprintf(stdout, "Kernel provides vDSO symbols!\n"); } out: return dlclose(h); } arch/arm/kernel/vdso.c | 2 ++ 1 file changed, 2 insertions(+)