Skip to contentSkip to conversation

timekeeping: Another fix to the VSYSCALL_OLD update_vsyscall

PATCH In review John Stultz 2 participants 2 messages Aug 12, 2014 – Aug 13, 2014 Timekeeping, clocksource core, NTP, alarmtimer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 timekeeping: Another fix to the VSYSCALL_OLD update_vsyscall

Benjamin Herrenschmidt pointed out that I firuther missed modifying update_vsyscall after the wall_to_mono value was changed to a timespec64. This causes issues on powerpc32, which expects a 32bit timespec.

This patch fixes the problem my properly converting from a timespec64 to a timespec before passing the value on to the arch-specific vsyscall logic.

Cc Thomas Gleixner <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Benjamin Herrenschmidt <[email protected]>
---
 kernel/time/timekeeping.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
kernel/time/timekeeping.c +3 -2
index f36b028..fb4a9c2 100644
@@ -338,10 +338,11 @@ EXPORT_SYMBOL_GPL(ktime_get_mono_fast_ns);
 
 static inline void update_vsyscall(struct timekeeper *tk)
 {
-	struct timespec xt;
+	struct timespec xt, wm;
 
 	xt = timespec64_to_timespec(tk_xtime(tk));
-	update_vsyscall_old(&xt, &tk->wall_to_monotonic, tk->tkr.clock, tk->tkr.mult,
+	wm = timespec64_to_timespec(tk->wall_to_monotonic);
+	update_vsyscall_old(&xt, &wm, tk->tkr.clock, tk->tkr.mult,
 			    tk->tkr.cycle_last);
 }
 
Signature · 1 line
1.9.1
#1 lore raw
Quoted 1 line · John Stultz

Benjamin Herrenschmidt pointed out that I firuther missed

s/firuther/further ?

Quoted 5 lines

modifying update_vsyscall after the wall_to_mono value was changed to a timespec64. This causes issues on powerpc32, which expects a 32bit timespec.

This patch fixes the problem my properly converting from

s/my/by/

Quoted 2 lines

a timespec64 to a timespec before passing the value on to the arch-specific vsyscall logic.

Other than that, please add my Reviewed-by, and send it to Linus either as patch or pull request as I'm really in vacation mode NOW.

Quoted 31 lines
Cc Thomas Gleixner <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Benjamin Herrenschmidt <[email protected]>
---
 kernel/time/timekeeping.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
kernel/time/timekeeping.c +3 -2
index f36b028..fb4a9c2 100644
@@ -338,10 +338,11 @@ EXPORT_SYMBOL_GPL(ktime_get_mono_fast_ns);
 
 static inline void update_vsyscall(struct timekeeper *tk)
 {
-	struct timespec xt;
+	struct timespec xt, wm;
 
 	xt = timespec64_to_timespec(tk_xtime(tk));
-	update_vsyscall_old(&xt, &tk->wall_to_monotonic, tk->tkr.clock, tk->tkr.mult,
+	wm = timespec64_to_timespec(tk->wall_to_monotonic);
+	update_vsyscall_old(&xt, &wm, tk->tkr.clock, tk->tkr.mult,
 			    tk->tkr.cycle_last);
 }
 
Signature · 1 line
1.9.1