On Wed, 20 May 2015, Borislav Petkov wrote: > On Wed, May 20, 2015 at 04:55:58PM +0100, One Thousand Gnomes wrote: > > > That's not what appears to be happening here though: the MWAITX will > > > return after the timeout. > > > > > > Which isn't really useful unless we use it to drive timers. > > > > What about things like mdelay() ? > > It has an upper limit on the max timeout though: u32 TSC cycles.
Which would be good enough for mdelay/udelay I think, but we'd need to measure the time spend in MWAITT so we wont return early. Something like this: delay = usec_to_tsc(delay); end = rdtsc() + delay; while (1) { MWAITT(delay); now = rdtsc(); if (end <= now) break; delay = end - now; } Now we'd need to add alternatives or some other mechanism to it to make this conditionally for those machines. Not sure if it's worth the trouble. Thanks, tglx -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/