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]
Message-ID: <20130531053247.GX5037@tarshish>
Date:	Fri, 31 May 2013 08:32:47 +0300
From:	Baruch Siach <baruch@...s.co.il>
To:	John Stultz <john.stultz@...aro.org>
Cc:	Peter Zijlstra <peterz@...radead.org>,
	linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...hat.com>,
	Dinh Nguyen <dinguyen@...era.com>,
	Jamie Iles <jamie@...ieiles.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	linux-arm-kernel@...ts.infradead.org
Subject: Re: [RFC PATCH 2/2] clocksource: dw_apb: allow build for
 architectures other than arm

Hi John,

On Thu, May 30, 2013 at 09:11:17AM -0700, John Stultz wrote:
> On 05/29/2013 10:32 PM, Baruch Siach wrote:
> >On Tue, May 28, 2013 at 01:24:17PM -0700, John Stultz wrote:
> >>On 05/26/2013 05:12 AM, Baruch Siach wrote:
> >>>  static const struct of_device_id osctimer_ids[] __initconst = {
> >>>@@ -124,3 +135,10 @@ void __init dw_apb_timer_init(void)
> >>>  	init_sched_clock();
> >>>  }
> >>>+
> >>>+#ifndef CONFIG_HAVE_SETUP_SCHED_CLOCK
> >>>+unsigned long long notrace sched_clock()
> >>>+{
> >>>+	return read_sched_clock() * sched_clock_mult;
> >>>+}
> >>>+#endif
> >>Also, can you try to condense the number of #ifndef
> >>CONFIG_HAVE_SETUP_SCHED_CLOCK checks to one, and consolidate the
> >>needed functions all in that one conditional?
> >Thanks for your comments. I'll rework the patch and resubmit.
> >
> >I've just noticed that I have a bigger problem. read_sched_clock() returns
> >u32, not u64. This means that in a rate of, say, 100MHz it will wrap around
> >after a little more than 40 seconds. Would it make sense to put ARM's 32 bin
> >sched_clock extension code (arch/arm/kernel/sched_clock.c) is a common place
> >(maybe drivers/clocksource), and use that? There seems to be nothing ARM
> >specific in this code, after all.
> 
> Yea, working out an actual generic sched_clock implementation is
> something I'd like to see done.
> 
> Though I'd really rather we not toss yet another chunk of
> infrastructure in the drivers/clocksource directory. Instead we
> should probably have a kernel/time/sched_clock.c.
> 
> Then its just the issue of tying that and the clocksource code
> together so you just register existing capable clocksources with a
> SCHED_CLOCK flag or via a different registration hook.
> 
> I don't think it will be an easy job, but if you want to give it a
> shot, I'd be quite interested in reviewing the patches!

Although I'd very much like to contribute in this area, I'm afraid I don't 
have time for this now. My problem is much narrower in scope, though, and I 
think it can be solved without a generic sched_clock implementation at first 
step. All I want is to use a 32 bit counter for sched_clock. The code enabling 
this is currently only available for ARM (arch/arm/kernel/sched_clock.c). 
Should this part of the code move to kernel/time/sched_clock.c?

baruch

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch@...s.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
--
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