diff options
author | attilio <attilio@FreeBSD.org> | 2009-05-14 17:43:00 +0000 |
---|---|---|
committer | attilio <attilio@FreeBSD.org> | 2009-05-14 17:43:00 +0000 |
commit | 902219327c608b14c9bcbd63038b9842bae52f7b (patch) | |
tree | 22b20a38e37e187948ac0d924a006065dcd27968 /sys/i386/xen | |
parent | b8aa665b4a6150092ef1acac35dac70302c2795d (diff) | |
download | FreeBSD-src-902219327c608b14c9bcbd63038b9842bae52f7b.zip FreeBSD-src-902219327c608b14c9bcbd63038b9842bae52f7b.tar.gz |
FreeBSD right now support 32 CPUs on all the architectures at least.
With the arrival of 128+ cores it is necessary to handle more than that.
One of the first thing to change is the support for cpumask_t that needs
to handle more than 32 bits masking (which happens now). Some places,
however, still assume that cpumask_t is a 32 bits mask.
Fix that situation by using always correctly cpumask_t when needed.
While here, remove the part under STOP_NMI for the Xen support as it
is broken in any case.
Additively make ipi_nmi_pending as static.
Reviewed by: jhb, kmacy
Tested by: Giovanni Trematerra <giovanni dot trematerra at gmail dot com>
Diffstat (limited to 'sys/i386/xen')
-rw-r--r-- | sys/i386/xen/mp_machdep.c | 66 |
1 files changed, 5 insertions, 61 deletions
diff --git a/sys/i386/xen/mp_machdep.c b/sys/i386/xen/mp_machdep.c index 7af4437..d8e1eea 100644 --- a/sys/i386/xen/mp_machdep.c +++ b/sys/i386/xen/mp_machdep.c @@ -993,7 +993,7 @@ smp_tlb_shootdown(u_int vector, vm_offset_t addr1, vm_offset_t addr2) } static void -smp_targeted_tlb_shootdown(u_int mask, u_int vector, vm_offset_t addr1, vm_offset_t addr2) +smp_targeted_tlb_shootdown(cpumask_t mask, u_int vector, vm_offset_t addr1, vm_offset_t addr2) { int ncpu, othercpus; struct _call_data data; @@ -1072,7 +1072,7 @@ smp_invlpg_range(vm_offset_t addr1, vm_offset_t addr2) } void -smp_masked_invltlb(u_int mask) +smp_masked_invltlb(cpumask_t mask) { if (smp_started) { @@ -1081,7 +1081,7 @@ smp_masked_invltlb(u_int mask) } void -smp_masked_invlpg(u_int mask, vm_offset_t addr) +smp_masked_invlpg(cpumask_t mask, vm_offset_t addr) { if (smp_started) { @@ -1090,7 +1090,7 @@ smp_masked_invlpg(u_int mask, vm_offset_t addr) } void -smp_masked_invlpg_range(u_int mask, vm_offset_t addr1, vm_offset_t addr2) +smp_masked_invlpg_range(cpumask_t mask, vm_offset_t addr1, vm_offset_t addr2) { if (smp_started) { @@ -1102,7 +1102,7 @@ smp_masked_invlpg_range(u_int mask, vm_offset_t addr1, vm_offset_t addr2) * send an IPI to a set of cpus. */ void -ipi_selected(uint32_t cpus, u_int ipi) +ipi_selected(cpumask_t cpus, u_int ipi) { int cpu; u_int bitmap = 0; @@ -1114,12 +1114,6 @@ ipi_selected(uint32_t cpus, u_int ipi) ipi = IPI_BITMAP_VECTOR; } -#ifdef STOP_NMI - if (ipi == IPI_STOP && stop_cpus_with_nmi) { - ipi_nmi_selected(cpus); - return; - } -#endif CTR3(KTR_SMP, "%s: cpus: %x ipi: %x", __func__, cpus, ipi); while ((cpu = ffs(cpus)) != 0) { cpu--; @@ -1160,56 +1154,6 @@ ipi_all_but_self(u_int ipi) ipi_selected(PCPU_GET(other_cpus), ipi); } -#ifdef STOP_NMI -/* - * send NMI IPI to selected CPUs - */ - -#define BEFORE_SPIN 1000000 - -void -ipi_nmi_selected(u_int32_t cpus) -{ - int cpu; - register_t icrlo; - - icrlo = APIC_DELMODE_NMI | APIC_DESTMODE_PHY | APIC_LEVEL_ASSERT - | APIC_TRIGMOD_EDGE; - - CTR2(KTR_SMP, "%s: cpus: %x nmi", __func__, cpus); - - atomic_set_int(&ipi_nmi_pending, cpus); - - while ((cpu = ffs(cpus)) != 0) { - cpu--; - cpus &= ~(1 << cpu); - - KASSERT(cpu_apic_ids[cpu] != -1, - ("IPI NMI to non-existent CPU %d", cpu)); - - /* Wait for an earlier IPI to finish. */ - if (!lapic_ipi_wait(BEFORE_SPIN)) - panic("ipi_nmi_selected: previous IPI has not cleared"); - - lapic_ipi_raw(icrlo, cpu_apic_ids[cpu]); - } -} - -int -ipi_nmi_handler(void) -{ - int cpumask = PCPU_GET(cpumask); - - if (!(ipi_nmi_pending & cpumask)) - return 1; - - atomic_clear_int(&ipi_nmi_pending, cpumask); - cpustop_handler(); - return 0; -} - -#endif /* STOP_NMI */ - /* * Handle an IPI_STOP by saving our current context and spinning until we * are resumed. |