Page MenuHomeFreeBSD

D41351.1788579204.diff
No OneTemporary

Size
4 KB
Referenced Files
None
Subscribers
None

D41351.1788579204.diff

Index: sys/x86/isa/clock.c
===================================================================
--- sys/x86/isa/clock.c
+++ sys/x86/isa/clock.c
@@ -413,7 +413,6 @@
void
cpu_initclocks(void)
{
-#ifdef EARLY_AP_STARTUP
struct thread *td;
int i;
@@ -436,13 +435,6 @@
if (sched_is_bound(td))
sched_unbind(td);
thread_unlock(td);
-#else
- tsc_calibrate();
-#ifdef DEV_APIC
- lapic_calibrate_timer();
-#endif
- cpu_initclocks_bsp();
-#endif
}
static int
Index: sys/x86/x86/intr_machdep.c
===================================================================
--- sys/x86/x86/intr_machdep.c
+++ sys/x86/x86/intr_machdep.c
@@ -94,7 +94,7 @@
u_int num_io_irqs;
#if defined(SMP) && !defined(EARLY_AP_STARTUP)
-static int assign_cpu;
+#error EARLY_AP_STARTUP required on x86
#endif
u_long *intrcnt;
@@ -402,18 +402,10 @@
struct intsrc *isrc;
int error;
-#ifdef EARLY_AP_STARTUP
MPASS(mp_ncpus == 1 || smp_started);
/* Nothing to do if there is only a single CPU. */
if (mp_ncpus > 1 && cpu != NOCPU) {
-#else
- /*
- * Don't do anything during early boot. We will pick up the
- * assignment once the APs are started.
- */
- if (assign_cpu && cpu != NOCPU) {
-#endif
isrc = arg;
sx_xlock(&intrsrc_lock);
error = isrc->is_pic->pic_assign_cpu(isrc, cpu_apic_ids[cpu]);
@@ -608,15 +600,9 @@
{
u_int apic_id;
-#ifdef EARLY_AP_STARTUP
MPASS(mp_ncpus == 1 || smp_started);
if (mp_ncpus == 1)
return (PCPU_GET(apic_id));
-#else
- /* Leave all interrupts on the BSP during boot. */
- if (!assign_cpu)
- return (PCPU_GET(apic_id));
-#endif
mtx_lock_spin(&icu_lock);
apic_id = cpu_apic_ids[current_cpu[domain]];
@@ -647,7 +633,6 @@
CPU_SET(cpu, &intr_cpus);
}
-#ifdef EARLY_AP_STARTUP
static void
intr_smp_startup(void *arg __unused)
{
@@ -658,52 +643,6 @@
SYSINIT(intr_smp_startup, SI_SUB_SMP, SI_ORDER_SECOND, intr_smp_startup,
NULL);
-#else
-/*
- * Distribute all the interrupt sources among the available CPUs once the
- * AP's have been launched.
- */
-static void
-intr_shuffle_irqs(void *arg __unused)
-{
- struct intsrc *isrc;
- u_int cpu, i;
-
- intr_init_cpus();
- /* Don't bother on UP. */
- if (mp_ncpus == 1)
- return;
-
- /* Round-robin assign a CPU to each enabled source. */
- sx_xlock(&intrsrc_lock);
- assign_cpu = 1;
- for (i = 0; i < num_io_irqs; i++) {
- isrc = interrupt_sources[i];
- if (isrc != NULL && isrc->is_handlers > 0) {
- /*
- * If this event is already bound to a CPU,
- * then assign the source to that CPU instead
- * of picking one via round-robin. Note that
- * this is careful to only advance the
- * round-robin if the CPU assignment succeeds.
- */
- cpu = isrc->is_event->ie_cpu;
- if (cpu == NOCPU)
- cpu = current_cpu[isrc->is_domain];
- if (isrc->is_pic->pic_assign_cpu(isrc,
- cpu_apic_ids[cpu]) == 0) {
- isrc->is_cpu = cpu;
- if (isrc->is_event->ie_cpu == NOCPU)
- intr_next_cpu(isrc->is_domain);
- }
- }
- }
- sx_xunlock(&intrsrc_lock);
-}
-SYSINIT(intr_shuffle_irqs, SI_SUB_SMP, SI_ORDER_SECOND, intr_shuffle_irqs,
- NULL);
-#endif
-
/*
* TODO: Export this information in a non-MD fashion, integrate with vmstat -i.
*/
Index: sys/x86/x86/local_apic.c
===================================================================
--- sys/x86/x86/local_apic.c
+++ sys/x86/x86/local_apic.c
@@ -878,22 +878,8 @@
lvts[APIC_LVT_PMC].lvt_masked = 0;
-#ifdef EARLY_AP_STARTUP
MPASS(mp_ncpus == 1 || smp_started);
smp_rendezvous(NULL, lapic_update_pmc, NULL, NULL);
-#else
-#ifdef SMP
- /*
- * If hwpmc was loaded at boot time then the APs may not be
- * started yet. In that case, don't forward the request to
- * them as they will program the lvt when they start.
- */
- if (smp_started)
- smp_rendezvous(NULL, lapic_update_pmc, NULL, NULL);
- else
-#endif
- lapic_update_pmc(NULL);
-#endif
return (1);
#else
return (0);
Index: sys/x86/x86/mca.c
===================================================================
--- sys/x86/x86/mca.c
+++ sys/x86/x86/mca.c
@@ -1079,11 +1079,7 @@
taskqueue_enqueue_timeout_sbt(mca_tq, &mca_scan_task,
mca_ticks * SBT_1S, 0, C_PREL(1));
}
-#ifdef EARLY_AP_STARTUP
SYSINIT(mca_startup, SI_SUB_KICK_SCHEDULER, SI_ORDER_ANY, mca_startup, NULL);
-#else
-SYSINIT(mca_startup, SI_SUB_SMP, SI_ORDER_ANY, mca_startup, NULL);
-#endif
#ifdef DEV_APIC
static void
Index: sys/x86/x86/mp_x86.c
===================================================================
--- sys/x86/x86/mp_x86.c
+++ sys/x86/x86/mp_x86.c
@@ -1114,11 +1114,6 @@
while (atomic_load_acq_int(&smp_started) == 0)
ia32_pause();
-#ifndef EARLY_AP_STARTUP
- /* Start per-CPU event timers. */
- cpu_initclocks_ap();
-#endif
-
kcsan_cpu_init(cpuid);
sched_ap_entry();

File Metadata

Mime Type
text/plain
Expires
Sat, Sep 5, 3:33 AM (1 h, 39 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29510375
Default Alt Text
D41351.1788579204.diff (4 KB)

Event Timeline