lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 4 Feb 2015 22:23:49 -0800
From:	Stephen Boyd <sboyd@...eaurora.org>
To:	Steven Rostedt <rostedt@...dmis.org>
Cc:	Daniel Thompson <daniel.thompson@...aro.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	John Stultz <john.stultz@...aro.org>,
	linux-kernel@...r.kernel.org, patches@...aro.org,
	linaro-kernel@...ts.linaro.org,
	Sumit Semwal <sumit.semwal@...aro.org>,
	Russell King <linux@....linux.org.uk>,
	Will Deacon <will.deacon@....com>,
	Catalin Marinas <catalin.marinas@....com>
Subject: Re: [PATCH v3 4/4] sched_clock: Avoid deadlock during read from NMI

On 02/04, Steven Rostedt wrote:
> On Wed, 4 Feb 2015 17:23:51 -0800
> Stephen Boyd <sboyd@...eaurora.org> wrote:
> 
> > On 01/30, Daniel Thompson wrote:
> > > @@ -98,26 +98,50 @@ unsigned long long notrace sched_clock(void)
> > >  }
> > >  
> > >  /*
> > > + * Updating the data required to read the clock.
> > > + *
> > > + * sched_clock will never observe mis-matched data even if called from
> > > + * an NMI. We do this by maintaining an odd/even copy of the data and
> > > + * steering sched_clock to one or the other using a sequence counter.
> > > + * In order to preserve the data cache profile of sched_clock as much
> > > + * as possible the system reverts back to the even copy when the update
> > > + * completes; the odd copy is used *only* during an update.
> > > + */
> > > +static void update_clock_read_data(struct clock_read_data *rd)
> > 
> > notrace?
> 
> Why? Isn't this for update, not for readers?
> 

Good point. I was basing it on the fact that the caller,
update_sched_clock() is marked notrace. It looks like it's always
been that way (see commit 2f0778afac79 "ARM: 7205/2: sched_clock:
allow sched_clock to be selected at runtime" from 2011-12-15
where it was introduced). So the correct thing would be to drop
notrace from update_sched_clock().

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ