diff mbox series

ARM: VDSO: Fix incorrect clock_gettime64

Message ID 20200409050508.96753-1-jaedon.shin@gmail.com (mailing list archive)
State Mainlined
Commit 4405bdf3c57ec28d606bdf5325f1167505bfdcd4
Headers show
Series ARM: VDSO: Fix incorrect clock_gettime64 | expand

Commit Message

Jaedon Shin April 9, 2020, 5:05 a.m. UTC
__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")
Signed-off-by: Jaedon Shin <jaedon.shin@gmail.com>
---
 arch/arm/kernel/vdso.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Robin Murphy May 30, 2020, 2:51 p.m. UTC | #1
On 2020-04-09 06:05, Jaedon Shin wrote:
> __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.

Tested-by: Robin Murphy <robin.murphy@arm.com>

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.

> Fixes: 74d06efb9c2f ("ARM: 8932/1: Add clock_gettime64 entry point")
> Signed-off-by: Jaedon Shin <jaedon.shin@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 e0330a25e1c6..28cfe7bad1bf 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");
>   	}
>   }
>   
>
Russell King (Oracle) May 30, 2020, 2:59 p.m. UTC | #2
On Sat, May 30, 2020 at 03:51:35PM +0100, Robin Murphy wrote:
> On 2020-04-09 06:05, Jaedon Shin wrote:
> > __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.
> 
> Tested-by: Robin Murphy <robin.murphy@arm.com>
> 
> 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.
Robin Murphy June 8, 2020, 1:54 p.m. UTC | #3
On 2020-05-30 15:59, Russell King - ARM Linux admin wrote:
> On Sat, May 30, 2020 at 03:51:35PM +0100, Robin Murphy wrote:
>> On 2020-04-09 06:05, Jaedon Shin wrote:
>>> __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.
>>
>> Tested-by: Robin Murphy <robin.murphy@arm.com>
>>
>> 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.

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.
Robin Murphy June 18, 2020, 5:30 p.m. UTC | #4
On 2020-06-08 14:54, Robin Murphy wrote:
> On 2020-05-30 15:59, Russell King - ARM Linux admin wrote:
>> On Sat, May 30, 2020 at 03:51:35PM +0100, Robin Murphy wrote:
>>> On 2020-04-09 06:05, Jaedon Shin wrote:
>>>> __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.
>>>
>>> Tested-by: Robin Murphy <robin.murphy@arm.com>
>>>
>>> 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.
> 
> 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.
diff mbox series

Patch

diff --git a/arch/arm/kernel/vdso.c b/arch/arm/kernel/vdso.c
index e0330a25e1c6..28cfe7bad1bf 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");
 	}
 }