From 02ab915ae014a07da8243120d231919eb5633c95 Mon Sep 17 00:00:00 2001 From: Colin Percival Date: Fri, 12 Aug 2022 16:51:34 -0700 Subject: [PATCH] lapic_init: Reduce LOOPS While I'm here, instrument lapic_init with TSLOG so it shows up (or typically not, after this change) on flamecharts. Reviewed by: kib Sponsored by: https://www.patreon.com/cperciva Differential Revision: https://reviews.freebsd.org/D36186 --- sys/x86/x86/local_apic.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/x86/x86/local_apic.c b/sys/x86/x86/local_apic.c index ec4f821f99ed..42a5a9fd4c8c 100644 --- a/sys/x86/x86/local_apic.c +++ b/sys/x86/x86/local_apic.c @@ -434,6 +434,8 @@ lapic_init(vm_paddr_t addr) int i; bool arat; + TSENTER(); + /* * Enable x2APIC mode if possible. Map the local APIC * registers page. @@ -531,7 +533,7 @@ lapic_init(vm_paddr_t addr) } #ifdef SMP -#define LOOPS 100000 +#define LOOPS 1000 /* * Calibrate the busy loop waiting for IPI ack in xAPIC mode. * lapic_ipi_wait_mult contains the number of iterations which @@ -563,6 +565,8 @@ lapic_init(vm_paddr_t addr) } #undef LOOPS #endif /* SMP */ + + TSEXIT(); } /*