Date: Tue, 21 Jun 2011 09:19:38 +0000 (UTC) From: Attilio Rao <attilio@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r223363 - in projects/largeSMP/sys/amd64: acpica amd64 Message-ID: <201106210919.p5L9JcXC089626@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: attilio Date: Tue Jun 21 09:19:38 2011 New Revision: 223363 URL: http://svn.freebsd.org/changeset/base/223363 Log: Remove the usage of pc_other_cpus from amd64. Tested by: pluknet Modified: projects/largeSMP/sys/amd64/acpica/acpi_wakeup.c projects/largeSMP/sys/amd64/amd64/mp_machdep.c projects/largeSMP/sys/amd64/amd64/pmap.c projects/largeSMP/sys/amd64/amd64/vm_machdep.c Modified: projects/largeSMP/sys/amd64/acpica/acpi_wakeup.c ============================================================================== --- projects/largeSMP/sys/amd64/acpica/acpi_wakeup.c Tue Jun 21 09:09:53 2011 (r223362) +++ projects/largeSMP/sys/amd64/acpica/acpi_wakeup.c Tue Jun 21 09:19:38 2011 (r223363) @@ -226,7 +226,8 @@ acpi_sleep_machdep(struct acpi_softc *sc return (ret); #ifdef SMP - wakeup_cpus = PCPU_GET(other_cpus); + wakeup_cpus = all_cpus; + CPU_CLR(PCPU_GET(cpuid), &wakeup_cpus); #endif AcpiSetFirmwareWakingVector(WAKECODE_PADDR(sc)); Modified: projects/largeSMP/sys/amd64/amd64/mp_machdep.c ============================================================================== --- projects/largeSMP/sys/amd64/amd64/mp_machdep.c Tue Jun 21 09:09:53 2011 (r223362) +++ projects/largeSMP/sys/amd64/amd64/mp_machdep.c Tue Jun 21 09:19:38 2011 (r223363) @@ -604,7 +604,7 @@ cpu_mp_announce(void) void init_secondary(void) { - cpuset_t tcpuset, tallcpus; + cpuset_t tcpuset; struct pcpu *pc; struct nmi_pcpu *np; u_int64_t msr, cr0; @@ -743,11 +743,6 @@ init_secondary(void) if (cpu_logical > 1 && PCPU_GET(apic_id) % cpu_logical != 0) CPU_OR(&logical_cpus_mask, &tcpuset); - /* Build our map of 'other' CPUs. */ - tallcpus = all_cpus; - CPU_NAND(&tallcpus, &tcpuset); - PCPU_SET(other_cpus, tallcpus); - if (bootverbose) lapic_dump("AP"); @@ -893,7 +888,6 @@ assign_cpu_ids(void) static int start_all_aps(void) { - cpuset_t tallcpus, tcpuset; vm_offset_t va = boot_address + KERNBASE; u_int64_t *pt4, *pt3, *pt2; u_int32_t mpbioswarmvec; @@ -961,12 +955,6 @@ start_all_aps(void) CPU_SET(cpu, &all_cpus); /* record AP in CPU map */ } - /* build our map of 'other' CPUs */ - tallcpus = all_cpus; - tcpuset = PCPU_GET(cpumask); - CPU_NAND(&tallcpus, &tcpuset); - PCPU_SET(other_cpus, tallcpus); - /* restore the warmstart vector */ *(u_int32_t *) WARMBOOT_OFF = mpbioswarmvec; @@ -1349,11 +1337,13 @@ ipi_cpu(int cpu, u_int ipi) void ipi_all_but_self(u_int ipi) { + cpuset_t other_cpus; + + other_cpus = all_cpus; + CPU_CLR(PCPU_GET(cpuid), &other_cpus); - sched_pin(); if (IPI_IS_BITMAPED(ipi)) { - ipi_selected(PCPU_GET(other_cpus), ipi); - sched_unpin(); + ipi_selected(other_cpus, ipi); return; } @@ -1363,8 +1353,7 @@ ipi_all_but_self(u_int ipi) * Set the mask of receiving CPUs for this purpose. */ if (ipi == IPI_STOP_HARD) - CPU_OR_ATOMIC(&ipi_nmi_pending, PCPU_PTR(other_cpus)); - sched_unpin(); + CPU_OR_ATOMIC(&ipi_nmi_pending, &other_cpus); CTR2(KTR_SMP, "%s: ipi: %x", __func__, ipi); lapic_ipi_vectored(ipi, APIC_IPI_DEST_OTHERS); Modified: projects/largeSMP/sys/amd64/amd64/pmap.c ============================================================================== --- projects/largeSMP/sys/amd64/amd64/pmap.c Tue Jun 21 09:09:53 2011 (r223362) +++ projects/largeSMP/sys/amd64/amd64/pmap.c Tue Jun 21 09:19:38 2011 (r223363) @@ -933,7 +933,8 @@ pmap_invalidate_page(pmap_t pmap, vm_off smp_invlpg(va); } else { cpumask = PCPU_GET(cpumask); - other_cpus = PCPU_GET(other_cpus); + other_cpus = all_cpus; + CPU_CLR(PCPU_GET(cpuid), &other_cpus); if (CPU_OVERLAP(&pmap->pm_active, &cpumask)) invlpg(va); CPU_AND(&other_cpus, &pmap->pm_active); @@ -956,7 +957,8 @@ pmap_invalidate_range(pmap_t pmap, vm_of smp_invlpg_range(sva, eva); } else { cpumask = PCPU_GET(cpumask); - other_cpus = PCPU_GET(other_cpus); + other_cpus = all_cpus; + CPU_CLR(PCPU_GET(cpuid), &other_cpus); if (CPU_OVERLAP(&pmap->pm_active, &cpumask)) for (addr = sva; addr < eva; addr += PAGE_SIZE) invlpg(addr); @@ -978,7 +980,8 @@ pmap_invalidate_all(pmap_t pmap) smp_invltlb(); } else { cpumask = PCPU_GET(cpumask); - other_cpus = PCPU_GET(other_cpus); + other_cpus = all_cpus; + CPU_CLR(PCPU_GET(cpuid), &other_cpus); if (CPU_OVERLAP(&pmap->pm_active, &cpumask)) invltlb(); CPU_AND(&other_cpus, &pmap->pm_active); @@ -1048,7 +1051,8 @@ pmap_update_pde(pmap_t pmap, vm_offset_t sched_pin(); cpumask = PCPU_GET(cpumask); - other_cpus = PCPU_GET(other_cpus); + other_cpus = all_cpus; + CPU_CLR(PCPU_GET(cpuid), &other_cpus); if (pmap == kernel_pmap) active = all_cpus; else Modified: projects/largeSMP/sys/amd64/amd64/vm_machdep.c ============================================================================== --- projects/largeSMP/sys/amd64/amd64/vm_machdep.c Tue Jun 21 09:09:53 2011 (r223362) +++ projects/largeSMP/sys/amd64/amd64/vm_machdep.c Tue Jun 21 09:19:38 2011 (r223363) @@ -59,7 +59,6 @@ __FBSDID("$FreeBSD$"); #include <sys/mutex.h> #include <sys/pioctl.h> #include <sys/proc.h> -#include <sys/sched.h> #include <sys/sf_buf.h> #include <sys/smp.h> #include <sys/sysctl.h> @@ -535,8 +534,8 @@ cpu_reset() u_int cnt; if (smp_active) { - sched_pin(); - map = PCPU_GET(other_cpus); + map = all_cpus; + CPU_CLR(PCPU_GET(cpuid), &map); CPU_NAND(&map, &stopped_cpus); if (!CPU_EMPTY(&map)) { printf("cpu_reset: Stopping other CPUs\n"); @@ -545,7 +544,6 @@ cpu_reset() if (PCPU_GET(cpuid) != 0) { cpu_reset_proxyid = PCPU_GET(cpuid); - sched_unpin(); cpustop_restartfunc = cpu_reset_proxy; cpu_reset_proxy_active = 0; printf("cpu_reset: Restarting BSP\n"); @@ -564,8 +562,7 @@ cpu_reset() while (1); /* NOTREACHED */ - } else - sched_unpin(); + } DELAY(1000000); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201106210919.p5L9JcXC089626>