Thread (50 messages) 50 messages, 5 authors, 2019-02-13

Re: [PATCH v2 06/28] kernel: Define gettimeofday vdso common code

From: Thomas Gleixner <hidden>
Date: 2019-02-13 19:35:47
Also in: linux-arch

On Wed, 13 Feb 2019, Will Deacon wrote:
On Fri, Feb 08, 2019 at 08:30:25PM +0100, Thomas Gleixner wrote:
quoted
How is the in kernel ktime_get() correctness guaranteed then?
Luck.

I think we'll have to introduce a dummy dependent stack read into our
counter accessor so that it's ordered by the smp_rmb(). Example diff
below, which I'll roll into a proper patch series later on.
Yikes.
 static inline u64 arch_counter_get_cntpct(void)
 {
+	u64 cnt, tmp;
+
 	isb();
-	return arch_timer_reg_read_stable(cntpct_el0);
+	cnt = arch_timer_reg_read_stable(cntpct_el0);
+
+	/*
+	 * This insanity brought to you by speculative, out-of-order system
+	 * register reads, sequence locks and Thomas Gleixner.
ROTFL


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help