diff options
author | Boris Ostrovsky <boris.ostrovsky@oracle.com> | 2017-09-11 14:51:11 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2017-09-25 09:22:45 -0400 |
commit | ccb64941f375a6eb21b1b20136730eb7d1716068 (patch) | |
tree | 7a2a352e6fb02667f4219438e7ea919a04a521da | |
parent | af5768507c051ceb9fe12bee59202bd83115c073 (diff) |
x86/timers: Move simple_udelay_calibration() past kvmclock_init()
simple_udelay_calibration() relies on x86_platform's calibration ops.
For KVM these ops are set late in setup_arch() and so
simple_udelay_calibration() ends up using native version.
Besides being possibly incorrect, this significantly increases kernel
boot time. For example, on my laptop executing start_kernel() by a guest
takes ~10 times more than when KVM's ops are used.
Since early_xdbc_setup_hardware() relies on calibration having been
performed move it too.
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: baolu.lu@linux.intel.com
Link: https://lkml.kernel.org/r/20170911185111.20636-1-boris.ostrovsky@oracle.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r-- | arch/x86/kernel/setup.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index c63d2b4dd5c8..b40311027c15 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c | |||
@@ -1029,8 +1029,6 @@ void __init setup_arch(char **cmdline_p) | |||
1029 | */ | 1029 | */ |
1030 | init_hypervisor_platform(); | 1030 | init_hypervisor_platform(); |
1031 | 1031 | ||
1032 | tsc_early_delay_calibrate(); | ||
1033 | |||
1034 | x86_init.resources.probe_roms(); | 1032 | x86_init.resources.probe_roms(); |
1035 | 1033 | ||
1036 | /* after parse_early_param, so could debug it */ | 1034 | /* after parse_early_param, so could debug it */ |
@@ -1115,9 +1113,6 @@ void __init setup_arch(char **cmdline_p) | |||
1115 | memblock_set_current_limit(ISA_END_ADDRESS); | 1113 | memblock_set_current_limit(ISA_END_ADDRESS); |
1116 | e820__memblock_setup(); | 1114 | e820__memblock_setup(); |
1117 | 1115 | ||
1118 | if (!early_xdbc_setup_hardware()) | ||
1119 | early_xdbc_register_console(); | ||
1120 | |||
1121 | reserve_bios_regions(); | 1116 | reserve_bios_regions(); |
1122 | 1117 | ||
1123 | if (efi_enabled(EFI_MEMMAP)) { | 1118 | if (efi_enabled(EFI_MEMMAP)) { |
@@ -1223,6 +1218,10 @@ void __init setup_arch(char **cmdline_p) | |||
1223 | kvmclock_init(); | 1218 | kvmclock_init(); |
1224 | #endif | 1219 | #endif |
1225 | 1220 | ||
1221 | tsc_early_delay_calibrate(); | ||
1222 | if (!early_xdbc_setup_hardware()) | ||
1223 | early_xdbc_register_console(); | ||
1224 | |||
1226 | x86_init.paging.pagetable_init(); | 1225 | x86_init.paging.pagetable_init(); |
1227 | 1226 | ||
1228 | kasan_init(); | 1227 | kasan_init(); |