From owner-svn-src-all@FreeBSD.ORG Mon Jun 20 21:31:01 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 85BF61065675; Mon, 20 Jun 2011 21:31:01 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6C0188FC21; Mon, 20 Jun 2011 21:31:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5KLV1Sj066511; Mon, 20 Jun 2011 21:31:01 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5KLV1TG066507; Mon, 20 Jun 2011 21:31:01 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201106202131.p5KLV1TG066507@svn.freebsd.org> From: Marius Strobl Date: Mon, 20 Jun 2011 21:31:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223346 - head/sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jun 2011 21:31:01 -0000 Author: marius Date: Mon Jun 20 21:31:01 2011 New Revision: 223346 URL: http://svn.freebsd.org/changeset/base/223346 Log: - Remove MD usage of pc_cpumask and pc_other_cpus. [1] - Remove CTASSERTs which no longer need to hold since r222813. Submitted by: attilio [1] Modified: head/sys/sparc64/sparc64/mp_machdep.c head/sys/sparc64/sparc64/pmap.c head/sys/sparc64/sparc64/tlb.c Modified: head/sys/sparc64/sparc64/mp_machdep.c ============================================================================== --- head/sys/sparc64/sparc64/mp_machdep.c Mon Jun 20 21:28:50 2011 (r223345) +++ head/sys/sparc64/sparc64/mp_machdep.c Mon Jun 20 21:31:01 2011 (r223346) @@ -140,8 +140,6 @@ static cpu_ipi_single_t spitfire_ipi_sin SYSINIT(cpu_mp_unleash, SI_SUB_SMP, SI_ORDER_FIRST, cpu_mp_unleash, NULL); CTASSERT(MAXCPU <= IDR_CHEETAH_MAX_BN_PAIRS); -CTASSERT(MAXCPU <= sizeof(u_int) * NBBY); -CTASSERT(MAXCPU <= sizeof(int) * NBBY); void mp_init(u_int cpu_impl) @@ -491,13 +489,14 @@ cpu_mp_shutdown(void) int i; critical_enter(); - shutdown_cpus = PCPU_GET(other_cpus); + shutdown_cpus = all_cpus; + CPU_CLR(PCPU_GET(cpuid), &shutdown_cpus); cpus = shutdown_cpus; /* XXX: Stop all the CPUs which aren't already. */ if (CPU_CMP(&stopped_cpus, &cpus)) { - /* pc_other_cpus is just a flat "on" mask without curcpu. */ + /* cpus is just a flat "on" mask without curcpu. */ CPU_NAND(&cpus, &stopped_cpus); stop_cpus(cpus); } @@ -520,23 +519,23 @@ cpu_ipi_ast(struct trapframe *tf) static void cpu_ipi_stop(struct trapframe *tf) { - cpuset_t tcmask; + u_int cpuid; CTR2(KTR_SMP, "%s: stopped %d", __func__, curcpu); sched_pin(); savectx(&stoppcbs[curcpu]); - tcmask = PCPU_GET(cpumask); - CPU_OR_ATOMIC(&stopped_cpus, &tcmask); - while (!CPU_OVERLAP(&started_cpus, &tcmask)) { - if (CPU_OVERLAP(&shutdown_cpus, &tcmask)) { - CPU_NAND_ATOMIC(&shutdown_cpus, &tcmask); + cpuid = PCPU_GET(cpuid); + CPU_SET_ATOMIC(cpuid, &stopped_cpus); + while (!CPU_ISSET(cpuid, &started_cpus)) { + if (CPU_ISSET(cpuid, &shutdown_cpus)) { + CPU_CLR_ATOMIC(cpuid, &shutdown_cpus); (void)intr_disable(); for (;;) ; } } - CPU_NAND_ATOMIC(&started_cpus, &tcmask); - CPU_NAND_ATOMIC(&stopped_cpus, &tcmask); + CPU_CLR_ATOMIC(cpuid, &started_cpus); + CPU_CLR_ATOMIC(cpuid, &stopped_cpus); sched_unpin(); CTR2(KTR_SMP, "%s: restarted %d", __func__, curcpu); } Modified: head/sys/sparc64/sparc64/pmap.c ============================================================================== --- head/sys/sparc64/sparc64/pmap.c Mon Jun 20 21:28:50 2011 (r223345) +++ head/sys/sparc64/sparc64/pmap.c Mon Jun 20 21:31:01 2011 (r223346) @@ -2230,7 +2230,7 @@ pmap_activate(struct thread *td) PCPU_SET(tlb_ctx, context + 1); pm->pm_context[curcpu] = context; - CPU_OR(&pm->pm_active, PCPU_PTR(cpumask)); + CPU_SET(PCPU_GET(cpuid), &pm->pm_active); PCPU_SET(pmap, pm); stxa(AA_DMMU_TSB, ASI_DMMU, pm->pm_tsb); Modified: head/sys/sparc64/sparc64/tlb.c ============================================================================== --- head/sys/sparc64/sparc64/tlb.c Mon Jun 20 21:28:50 2011 (r223345) +++ head/sys/sparc64/sparc64/tlb.c Mon Jun 20 21:31:01 2011 (r223346) @@ -80,7 +80,7 @@ tlb_context_demap(struct pmap *pm) PMAP_STATS_INC(tlb_ncontext_demap); cookie = ipi_tlb_context_demap(pm); s = intr_disable(); - if (CPU_OVERLAP(&pm->pm_active, PCPU_PTR(cpumask))) { + if (CPU_ISSET(PCPU_GET(cpuid), &pm->pm_active)) { KASSERT(pm->pm_context[curcpu] != -1, ("tlb_context_demap: inactive pmap?")); stxa(TLB_DEMAP_PRIMARY | TLB_DEMAP_CONTEXT, ASI_DMMU_DEMAP, 0); @@ -101,7 +101,7 @@ tlb_page_demap(struct pmap *pm, vm_offse PMAP_STATS_INC(tlb_npage_demap); cookie = ipi_tlb_page_demap(pm, va); s = intr_disable(); - if (CPU_OVERLAP(&pm->pm_active, PCPU_PTR(cpumask))) { + if (CPU_ISSET(PCPU_GET(cpuid), &pm->pm_active)) { KASSERT(pm->pm_context[curcpu] != -1, ("tlb_page_demap: inactive pmap?")); if (pm == kernel_pmap) @@ -128,7 +128,7 @@ tlb_range_demap(struct pmap *pm, vm_offs PMAP_STATS_INC(tlb_nrange_demap); cookie = ipi_tlb_range_demap(pm, start, end); s = intr_disable(); - if (CPU_OVERLAP(&pm->pm_active, PCPU_PTR(cpumask))) { + if (CPU_ISSET(PCPU_GET(cpuid), &pm->pm_active)) { KASSERT(pm->pm_context[curcpu] != -1, ("tlb_range_demap: inactive pmap?")); if (pm == kernel_pmap)