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:	Fri, 14 Jan 2011 13:22:32 -0800
From:	Yinghai Lu <yinghai@...nel.org>
To:	Thomas Gleixner <tglx@...utronix.de>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Ingo Molnar <mingo@...e.hu>, "H. Peter Anvin" <hpa@...or.com>
CC:	Christoph Lameter <cl@...ux.com>, Greg KH <greg@...ah.com>,
	Jason Wessel <jason.wessel@...driver.com>,
	Benjamin Herrenschmidt <benh@...nel.crashing.org>,
	Jesse Barnes <jbarnes@...tuousgeek.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Tejun Heo <tj@...nel.org>
Subject: [PATCH] x86: set percpu cpu0 lpj to default


We need to use udelay() in early stage.

For x86, normally udelay need to use percpu.loops_per_jiffy
will need to wait per_cpu(cpu_info) is allocated and copied
from boot_cpu_data, after it is in smp_prepare_cpus()
boot_cpu_data.loops_per_jiffy get set in identify_boot_cpu from check_bugs.

But cpu_data(0) can be referred early, that is in per cpu load data.

Try to set it with default vaule instead leave it as zero.

BTW: it it is some small...only 4096

Now: only user for udelay is ehci dgp early console.

Signed-off-by: Yinghai Lu <yinghai@...nel.org>

---
 arch/x86/kernel/setup.c |    1 +
 1 file changed, 1 insertion(+)

Index: linux-2.6/arch/x86/kernel/setup.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/setup.c
+++ linux-2.6/arch/x86/kernel/setup.c
@@ -734,6 +734,7 @@ void __init setup_arch(char **cmdline_p)
 
 	early_trap_init();
 	early_cpu_init();
+	cpu_data(0).loops_per_jiffy = loops_per_jiffy;
 	early_ioremap_init();
 
 	setup_olpc_ofw_pgd();
--
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