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:	Mon, 14 Sep 2009 19:59:59 +0200
From:	Martin Schwidefsky <schwidefsky@...ibm.com>
To:	Ingo Molnar <mingo@...e.hu>
Cc:	Jens Axboe <jens.axboe@...cle.com>,
	John Stultz <johnstul@...ibm.com>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Mike Galbraith <efault@....de>,
	Con Kolivas <kernel@...ivas.org>, linux-kernel@...r.kernel.org
Subject: Re: [crash, bisected] Re: clocksource: Resolve cpu hotplug dead
 lock with TSC unstable

On Mon, 14 Sep 2009 17:19:58 +0200
Ingo Molnar <mingo@...e.hu> wrote:

> Now another box crashes during bootup. Reverting these two:
> 
>  f79e025: clocksource: Resolve cpu hotplug dead lock with TSC unstable, fix crash
>  7285dd7: clocksource: Resolve cpu hotplug dead lock with TSC unstable
> 
> allows me to boot it.
> 
> plain 32-bit defconfig.

Ok, I forced the situation where the bad thing happens. With the patch below
the crash goes away.

[    0.152056] checking TSC synchronization [CPU#0 -> CPU#1]:
[    0.156001] Measured 0 cycles TSC warp between CPUs, turning off TSC clock.
[    0.156001] Marking TSC unstable due to check_tsc_sync_source failed

Is there a reason why we need the TSC as a clocksource early in the boot
process?

--
Subject: clocksource: delay tsc clocksource registration

From: Martin Schwidefsky <schwidefsky@...ibm.com>

Until the tsc clocksource has been registered it can be
downgraded by setting the CLOCK_SOURCE_UNSTABLE bit and the
rating to zero. Once the tsc clocksource is registered a
work queue is needed to change the rating.

Delay the registration of the tsc clocksource to a point in
the boot process after the work queues have been initialized.

This hopefully finally resolves the boot crash due to the
tsc downgrade.

Signed-off-by: Martin Schwidefsky <schwidefsky@...ibm.com>
Cc: Jens Axboe <jens.axboe@...cle.com>
Cc: John Stultz <johnstul@...ibm.com>
---

Index: linux-2.6-tip/arch/x86/kernel/tsc.c
===================================================================
--- linux-2.6-tip.orig/arch/x86/kernel/tsc.c	2009-09-14 19:25:02.000000000 +0200
+++ linux-2.6-tip/arch/x86/kernel/tsc.c	2009-09-14 19:30:13.000000000 +0200
@@ -853,9 +853,16 @@
 		clocksource_tsc.rating = 0;
 		clocksource_tsc.flags &= ~CLOCK_SOURCE_IS_CONTINUOUS;
 	}
+}
+
+static int __init register_tsc_clocksource(void)
+{
 	clocksource_register(&clocksource_tsc);
+	return 0;
 }
 
+core_initcall(register_tsc_clocksource);
+
 #ifdef CONFIG_X86_64
 /*
  * calibrate_cpu is used on systems with fixed rate TSCs to determine
-- 
blue skies,
   Martin.

"Reality continues to ruin my life." - Calvin.

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