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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 13 Feb 2019, Will Deacon wrote:
> On Fri, Feb 08, 2019 at 08:30:25PM +0100, Thomas Gleixner wrote:
> >
> > 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




[Index of Archives]     [Linux Kernel]     [Kernel Newbies]     [x86 Platform Driver]     [Netdev]     [Linux Wireless]     [Netfilter]     [Bugtraq]     [Linux Filesystems]     [Yosemite Discussion]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux