summaryrefslogtreecommitdiffstats
path: root/sys/x86
diff options
context:
space:
mode:
Diffstat (limited to 'sys/x86')
-rw-r--r--sys/x86/x86/local_apic.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/sys/x86/x86/local_apic.c b/sys/x86/x86/local_apic.c
index 0a77679..d8bda77 100644
--- a/sys/x86/x86/local_apic.c
+++ b/sys/x86/x86/local_apic.c
@@ -525,19 +525,21 @@ native_lapic_init(vm_paddr_t addr)
*/
KASSERT((cpu_feature & CPUID_TSC) != 0 && tsc_freq != 0,
("TSC not initialized"));
- r = rdtsc();
- for (rx = 0; rx < LOOPS; rx++) {
- (void)lapic_read_icr_lo();
- ia32_pause();
- }
- r = rdtsc() - r;
- r1 = tsc_freq * LOOPS;
- r2 = r * 1000000;
- lapic_ipi_wait_mult = r1 >= r2 ? r1 / r2 : 1;
- if (bootverbose) {
- printf("LAPIC: ipi_wait() us multiplier %ju (r %ju tsc %ju)\n",
- (uintmax_t)lapic_ipi_wait_mult, (uintmax_t)r,
- (uintmax_t)tsc_freq);
+ if (!x2apic_mode) {
+ r = rdtsc();
+ for (rx = 0; rx < LOOPS; rx++) {
+ (void)lapic_read_icr_lo();
+ ia32_pause();
+ }
+ r = rdtsc() - r;
+ r1 = tsc_freq * LOOPS;
+ r2 = r * 1000000;
+ lapic_ipi_wait_mult = r1 >= r2 ? r1 / r2 : 1;
+ if (bootverbose) {
+ printf("LAPIC: ipi_wait() us multiplier %ju (r %ju "
+ "tsc %ju)\n", (uintmax_t)lapic_ipi_wait_mult,
+ (uintmax_t)r, (uintmax_t)tsc_freq);
+ }
}
#undef LOOPS
#endif /* SMP */
OpenPOWER on IntegriCloud