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-next>] [day] [month] [year] [list]
Message-Id: <1294327409-19426-1-git-send-email-pierre.tardy@intel.com>
Date:	Thu,  6 Jan 2011 16:23:29 +0100
From:	Pierre Tardy <pierre.tardy@...el.com>
To:	linux-kernel@...r.kernel.org, x86@...nel.org
Cc:	Pierre Tardy <pierre.tardy@...el.com>,
	Arjan van de Ven <arjan@...radead.org>,
	Adrian Bunk <bunk@...sta.de>, Andrew Morton <akpm@...l.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	"H. Peter Anvin" <hpa@...ux.intel.com>,
	Ingo Molnar <mingo@...e.hu>, john stultz <johnstul@...ibm.com>,
	Roman Zippel <zippel@...ux-m68k.org>, Andi Kleen <ak@...e.de>,
	Suresh Siddha <suresh.b.siddha@...el.com>
Subject: [PATCH] lapic-timer: increase the max_delta to 31 bits

Latest atom socs(penwell) does not have hpet timer.

As their local APIC timer is clocked at 400KHZ, and the current code
limit their Initial Counter register to 23 bits, they cannot sleep
more than 1.34 seconds which leads to ~2 spurious wakeup per second (1 per thread)

These SOCs support 32bit timer so we change the max_delta to at least 31bits.
So we can at least sleep for 300 seconds.

We could not find any previous chip errata where lapic would only have 23 bit precision
As powertop is suggesting to activate HPET to "sleep longer", this could mean this problem is
already known.

Problem is here since very first implementation of lapic timer as a clock event
e9e2cdb [PATCH] clockevents: i386 drivers
cc contributors of the first patch and x86 maintainers

CC: Arjan van de Ven <arjan@...radead.org>
CC: Adrian Bunk <bunk@...sta.de>
CC: Andrew Morton <akpm@...l.org>
CC: Thomas Gleixner <tglx@...utronix.de>
CC: H. Peter Anvin <hpa@...ux.intel.com>
CC: Ingo Molnar <mingo@...e.hu>
Cc: john stultz <johnstul@...ibm.com>
Cc: Roman Zippel <zippel@...ux-m68k.org>
Cc: Andi Kleen <ak@...e.de>
TO: Thomas Gleixner <tglx@...utronix.de>
TO: Ingo Molnar <mingo@...hat.com>
TO: "H. Peter Anvin" <hpa@...or.com>
TO: x86@...nel.org
TO: Suresh Siddha <suresh.b.siddha@...el.com>
TO: Yinghai Lu <yinghai@...nel.org>
TO: Robert Richter <robert.richter@....com>

Signed-off-by: Suresh Siddha <suresh.b.siddha@...el.com>
Signed-off-by: Pierre Tardy <pierre.tardy@...el.com>
---
 arch/x86/kernel/apic/apic.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 7821813..c031f1d 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -684,7 +684,7 @@ static int __init calibrate_APIC_clock(void)
 	lapic_clockevent.mult = div_sc(delta, TICK_NSEC * LAPIC_CAL_LOOPS,
 				       lapic_clockevent.shift);
 	lapic_clockevent.max_delta_ns =
-		clockevent_delta2ns(0x7FFFFF, &lapic_clockevent);
+		clockevent_delta2ns(0x7FFFFFFF, &lapic_clockevent);
 	lapic_clockevent.min_delta_ns =
 		clockevent_delta2ns(0xF, &lapic_clockevent);
 
-- 
1.7.0.4

---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris, 
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

--
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