From owner-p4-projects Sun May 19 18:14:23 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 7A9BE37B40C; Sun, 19 May 2002 18:13:51 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id E4FCD37B41B for ; Sun, 19 May 2002 18:13:34 -0700 (PDT) Received: (from perforce@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g4K1DY160929 for perforce@freebsd.org; Sun, 19 May 2002 18:13:34 -0700 (PDT) (envelope-from jake@freebsd.org) Date: Sun, 19 May 2002 18:13:34 -0700 (PDT) Message-Id: <200205200113.g4K1DY160929@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: perforce set sender to jake@freebsd.org using -f From: Jake Burkholder Subject: PERFORCE change 11572 for review To: Perforce Change Reviews Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG http://people.freebsd.org/~peter/p4db/chv.cgi?CH=11572 Change 11572 by jake@jake_sparc64 on 2002/05/19 18:13:24 De-inline the tlb functions. These were so big that gcc3.1 refused to inline them anyway. Affected files ... ... //depot/projects/sparc64/sys/conf/files.sparc64#35 edit ... //depot/projects/sparc64/sys/sparc64/include/tlb.h#35 edit ... //depot/projects/sparc64/sys/sparc64/sparc64/tlb.c#1 add Differences ... ==== //depot/projects/sparc64/sys/conf/files.sparc64#35 (text+ko) ==== @@ -79,6 +79,7 @@ sparc64/sparc64/sys_machdep.c standard sparc64/sparc64/swtch.s standard sparc64/sparc64/tick.c standard +sparc64/sparc64/tlb.c standard sparc64/sparc64/trap.c standard sparc64/sparc64/tsb.c standard sparc64/sparc64/vm_machdep.c standard ==== //depot/projects/sparc64/sys/sparc64/include/tlb.h#35 (text+ko) ==== @@ -83,106 +83,9 @@ extern int kernel_tlb_slots; extern struct tte *kernel_ttes; -/* - * Some tlb operations must be atomic, so no interrupt or trap can be allowed - * while they are in progress. Traps should not happen, but interrupts need to - * be explicitely disabled. critical_enter() cannot be used here, since it only - * disables soft interrupts. - */ - -static __inline void -tlb_context_demap(struct pmap *pm) -{ - void *cookie; - u_long s; - - /* - * It is important that we are not interrupted or preempted while - * doing the IPIs. The interrupted CPU may hold locks, and since - * it will wait for the CPU that sent the IPI, this can lead - * to a deadlock when an interrupt comes in on that CPU and it's - * handler tries to grab one of that locks. This will only happen for - * spin locks, but these IPI types are delivered even if normal - * interrupts are disabled, so the lock critical section will not - * protect the target processor from entering the IPI handler with - * the lock held. - */ - critical_enter(); - cookie = ipi_tlb_context_demap(pm); - if (pm->pm_active & PCPU_GET(cpumask)) { - KASSERT(pm->pm_context[PCPU_GET(cpuid)] != -1, - ("tlb_context_demap: inactive pmap?")); - s = intr_disable(); - stxa(TLB_DEMAP_PRIMARY | TLB_DEMAP_CONTEXT, ASI_DMMU_DEMAP, 0); - stxa(TLB_DEMAP_PRIMARY | TLB_DEMAP_CONTEXT, ASI_IMMU_DEMAP, 0); - membar(Sync); - intr_restore(s); - } - ipi_wait(cookie); - critical_exit(); -} - -static __inline void -tlb_page_demap(u_int tlb, struct pmap *pm, vm_offset_t va) -{ - u_long flags; - void *cookie; - u_long s; - - critical_enter(); - cookie = ipi_tlb_page_demap(tlb, pm, va); - if (pm->pm_active & PCPU_GET(cpumask)) { - KASSERT(pm->pm_context[PCPU_GET(cpuid)] != -1, - ("tlb_page_demap: inactive pmap?")); - if (pm == kernel_pmap) - flags = TLB_DEMAP_NUCLEUS | TLB_DEMAP_PAGE; - else - flags = TLB_DEMAP_PRIMARY | TLB_DEMAP_PAGE; - - s = intr_disable(); - if (tlb & TLB_DTLB) { - stxa(TLB_DEMAP_VA(va) | flags, ASI_DMMU_DEMAP, 0); - membar(Sync); - } - if (tlb & TLB_ITLB) { - stxa(TLB_DEMAP_VA(va) | flags, ASI_IMMU_DEMAP, 0); - membar(Sync); - } - intr_restore(s); - } - ipi_wait(cookie); - critical_exit(); -} - -static __inline void -tlb_range_demap(struct pmap *pm, vm_offset_t start, vm_offset_t end) -{ - vm_offset_t va; - void *cookie; - u_long flags; - u_long s; - - critical_enter(); - cookie = ipi_tlb_range_demap(pm, start, end); - if (pm->pm_active & PCPU_GET(cpumask)) { - KASSERT(pm->pm_context[PCPU_GET(cpuid)] != -1, - ("tlb_range_demap: inactive pmap?")); - if (pm == kernel_pmap) - flags = TLB_DEMAP_NUCLEUS | TLB_DEMAP_PAGE; - else - flags = TLB_DEMAP_PRIMARY | TLB_DEMAP_PAGE; - - s = intr_disable(); - for (va = start; va < end; va += PAGE_SIZE) { - stxa(TLB_DEMAP_VA(va) | flags, ASI_DMMU_DEMAP, 0); - stxa(TLB_DEMAP_VA(va) | flags, ASI_IMMU_DEMAP, 0); - membar(Sync); - } - intr_restore(s); - } - ipi_wait(cookie); - critical_exit(); -} +void tlb_context_demap(struct pmap *pm); +void tlb_page_demap(u_int tlb, struct pmap *pm, vm_offset_t va); +void tlb_range_demap(struct pmap *pm, vm_offset_t start, vm_offset_t end); #define tlb_tte_demap(tte, pm) \ tlb_page_demap(TD_GET_TLB((tte).tte_data), pm, \ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message