Skip to contentSkip to conversation

ARM: VDSO: Fix incorrect clock_gettime64

PATCH In review Jaedon Shin 3 participants 5 messages Apr 9, 2020 – Jun 18, 2020 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: VDSO: Fix incorrect clock_gettime64

__vdso_*() should be removed and fallback used if CNTCVT is not available by cntvct_functional(). __vdso_clock_gettime64 when added previous commit is using the incorrect CNTCVT value in that state. __vdso_clock_gettime64 is also added to remove it's symbol.

Fixes 74d06efb9c2f ("ARM: 8932/1: Add clock_gettime64 entry point")
---
 arch/arm/kernel/vdso.c | 1 +
 1 file changed, 1 insertion(+)
arch/arm/kernel/vdso.c +1 -0
index e0330a25e1c6..28cfe7bad1bf 100644
@@ -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");
 	}
 }
 
Signature · 7 lines
2.24.1 (Apple Git-126)


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Tested-by on v1 1/1
#1 lore raw
Quoted 4 lines · Jaedon Shin

__vdso_*() should be removed and fallback used if CNTCVT is not available by cntvct_functional(). __vdso_clock_gettime64 when added previous commit is using the incorrect CNTCVT value in that state. __vdso_clock_gettime64 is also added to remove it's symbol.

Turns out this is what was making my RK3288 box virtually unusable since its last couple of updates - it would be nice to get the fix merged and backported ASAP. I suspect it's also the same underlying thing for the Raspberry Pi thread over here:

https://lore.kernel.org/linux-arm-kernel/CAK8P3a2Tw2w73ZkK-W6AA9veMK4-miLUx-TL1EuOdP7EdW-AmQ@mail.gmail.com/

Robin.

Quoted 12 lines
Fixes 74d06efb9c2f ("ARM: 8932/1: Add clock_gettime64 entry point")
---
  arch/arm/kernel/vdso.c | 1 +
  1 file changed, 1 insertion(+)
arch/arm/kernel/vdso.c +0 -0
index e0330a25e1c6..28cfe7bad1bf 100644

arch/arm/kernel/vdso.c static void __init patch_vdso(void *ehdr) · line 190

Quoted 7 lines
arch/arm/kernel/vdso.c +1 -0
@@ -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");
  	}
  }
 

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#2 lore raw
Quoted 6 lines · Robin Murphy
Quoted 4 lines · Jaedon Shin

__vdso_*() should be removed and fallback used if CNTCVT is not available by cntvct_functional(). __vdso_clock_gettime64 when added previous commit is using the incorrect CNTCVT value in that state. __vdso_clock_gettime64 is also added to remove it's symbol.

Quoted 8 lines

Turns out this is what was making my RK3288 box virtually unusable since its last couple of updates - it would be nice to get the fix merged and backported ASAP. I suspect it's also the same underlying thing for the Raspberry Pi thread over here:

https://lore.kernel.org/linux-arm-kernel/CAK8P3a2Tw2w73ZkK-W6AA9veMK4-miLUx-TL1EuOdP7EdW-AmQ@mail.gmail.com/

Does this mean I need to do something with this patch? It's not been put in the patch system, so I'm afraid it's missed the boat for 5.7.

Signature · 7 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTC for 0.8m (est. 1762m) line in suburbia: sync at 13.1Mbps down 424kbps up

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#3 lore raw
Quoted 14 lines · Russell King - ARM Linux admin
Quoted 13 lines · Robin Murphy
Quoted 4 lines · Jaedon Shin

__vdso_*() should be removed and fallback used if CNTCVT is not available by cntvct_functional(). __vdso_clock_gettime64 when added previous commit is using the incorrect CNTCVT value in that state. __vdso_clock_gettime64 is also added to remove it's symbol.

Turns out this is what was making my RK3288 box virtually unusable since its last couple of updates - it would be nice to get the fix merged and backported ASAP. I suspect it's also the same underlying thing for the Raspberry Pi thread over here:

Quoted 4 lines
Quoted 1 line

https://lore.kernel.org/linux-arm-kernel/CAK8P3a2Tw2w73ZkK-W6AA9veMK4-miLUx-TL1EuOdP7EdW-AmQ@mail.gmail.com/

Does this mean I need to do something with this patch? It's not been put in the patch system, so I'm afraid it's missed the boat for 5.7.

Well, there still seems to be a little uncertainty over whether this is the best fix, so I guess we may as well wait until the end of the merge window just in case somebody comes up with something more solid.

In this particular context I'm merely a user who wants my thing to work, but I'll try to keep an eye out and follow up if I don't see any other movement.

Robin.

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#4 lore raw
Quoted 18 lines · Robin Murphy
Quoted 17 lines · Russell King - ARM Linux admin
Quoted 15 lines · Robin Murphy
Quoted 4 lines · Jaedon Shin

__vdso_*() should be removed and fallback used if CNTCVT is not available by cntvct_functional(). __vdso_clock_gettime64 when added previous commit is using the incorrect CNTCVT value in that state. __vdso_clock_gettime64 is also added to remove it's symbol.

Turns out this is what was making my RK3288 box virtually unusable since its last couple of updates - it would be nice to get the fix merged and backported ASAP. I suspect it's also the same underlying thing for the Raspberry Pi thread over here:

https://lore.kernel.org/linux-arm-kernel/CAK8P3a2Tw2w73ZkK-W6AA9veMK4-miLUx-TL1EuOdP7EdW-AmQ@mail.gmail.com/

Quoted 6 lines
Quoted 2 lines

Does this mean I need to do something with this patch? It's not been put in the patch system, so I'm afraid it's missed the boat for 5.7.

Well, there still seems to be a little uncertainty over whether this is the best fix, so I guess we may as well wait until the end of the merge window just in case somebody comes up with something more solid.

In this particular context I'm merely a user who wants my thing to work, but I'll try to keep an eye out and follow up if I don't see any other movement.

Since the discussion about why the expected fallback behaviour didn't happen seems to have died down, and the Raspberry Pi folks have gone down the commendable path of actually fixing their firmware (!), I've taken the liberty of chucking this into the patch system for the sake of the remaining minority of affected machines.

Robin.

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel