xen: Move tsc reliability check until after CPUs have booted

AMD CPUs by default enable X86_FEATURE_TSC_RELIABLE, and depend upon a
later check to disable this feature if TSC drift is detected.
Unfortunately, this check is done in time.c:init_xen_time(), which is
done before any secondary CPUs are brought up, and is thus guaranteed
to succed.

This patch moves the check into its own function, and calls it after
cpus are brought up.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
xen-unstable changeset:   23846:bf2aaf21e8e7
xen-unstable date:        Sat Sep 17 16:22:54 2011 +0100
This commit is contained in:
George Dunlap committed 2011-09-17 16:37:56 +01:00
1 parent 0f95c3842c
commit 6e8d37c4fe
3 files changed
+14 -2

No files matched your search

+3
View File
@@ -1266,8 +1266,11 @@ void __init __start_xen(unsigned long mbi_p)
printk("Brought up %ld CPUs\n", (long)num_online_cpus());
smp_cpus_done(max_cpus);
verify_tsc_reliability();
do_initcalls();
if ( opt_watchdog )
watchdog_enable();
+10 -2
View File
@@ -1445,8 +1445,8 @@ static void __init tsc_check_writability(void)
disable_tsc_sync = 1;
}
/* Late init function (after all CPUs are booted). */
int __init init_xen_time(void)
/* Late init function, after all cpus have booted */
void __init verify_tsc_reliability(void)
{
if ( boot_cpu_has(X86_FEATURE_TSC_RELIABLE) )
{
@@ -1458,9 +1458,17 @@ int __init init_xen_time(void)
*/
tsc_check_reliability();
if ( tsc_max_warp )
{
printk("%s: TSC warp detected, disabling TSC_RELIABLE\n",
__func__);
setup_clear_cpu_cap(X86_FEATURE_TSC_RELIABLE);
}
}
}
/* Late init function (after interrupts are enabled). */
int __init init_xen_time(void)
{
tsc_check_writability();
/* If we have constant-rate TSCs then scale factor can be shared. */
+1
View File
@@ -11,6 +11,7 @@
#include <xen/types.h>
#include <public/xen.h>
extern void verify_tsc_reliability(void);
extern int init_xen_time(void);
extern void cstate_restore_tsc(void);
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.