Date: Tue, 25 Apr 2006 07:02:10 GMT From: Kip Macy <kmacy@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 96050 for review Message-ID: <200604250702.k3P72AOE071256@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=96050 Change 96050 by kmacy@kmacy_storage:sun4v_rwbuf on 2006/04/25 07:01:10 add addition pm_active sanity check remove asserts from pmap_ipi that assume that it is only called on curpmap Affected files ... .. //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/pmap.c#37 edit Differences ... ==== //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/pmap.c#37 (text+ko) ==== @@ -174,7 +174,14 @@ #define UNIMPLEMENTED panic("%s not implemented", __FUNCTION__) #define IMPLEMENTME printf("don't forget %s not implemented\n", __FUNCTION__) #ifdef PMAP_DEBUG -#define DPRINTF if (pmap_debug) printf +#define KDPRINTF if (pmap_debug) printf +#define DPRINTF \ + if ((PCPU_GET(cpumask) & PCPU_GET(curpmap)->pm_active) == 0) \ + panic("cpumask(0x%x) & active (0x%x) == 0 pid == %d\n", \ + PCPU_GET(cpumask), PCPU_GET(curpmap)->pm_active, curthread->td_proc->p_pid); \ +if (pmap_debug) printf + + #else #define DPRINTF(...) #endif @@ -356,7 +363,7 @@ pmap_activate(struct thread *td) { pmap_t pmap, oldpmap; - DPRINTF("activating pmap\n"); + DPRINTF("activating pmap for %d\n", td->td_tid); spinlock_enter(); pmap = vmspace_pmap(td->td_proc->p_vmspace); @@ -433,7 +440,7 @@ for (i = 0, j = 0; i < sz; i++, j += 2) { CTR2(KTR_PMAP, "start=%#lx size=%#lx\n", mra[i].mr_start, mra[i].mr_size); - DPRINTF("start=%#lx size=%#lx\n", mra[i].mr_start, + KDPRINTF("start=%#lx size=%#lx\n", mra[i].mr_start, mra[i].mr_size); if (physmem != 0 && btoc(physsz + mra[i].mr_size) >= physmem) { if (btoc(physsz) < physmem) { @@ -465,13 +472,13 @@ qsort(translations, sz, sizeof (*translations), om_cmp); for (i = 0; i < sz; i++) { int j, k; - DPRINTF("om_size=%ld om_start=%lx om_tte=%lx\n", + KDPRINTF("om_size=%ld om_start=%lx om_tte=%lx\n", translations[i].om_size, translations[i].om_start, translations[i].om_tte); if (translations[i].om_size == PAGE_SIZE_4M && (translations[i].om_start == KERNBASE || translations[i].om_start == KERNBASE + PAGE_SIZE_4M)) { - DPRINTF("mapping permanent translation\n"); + KDPRINTF("mapping permanent translation\n"); pa = TTE_GET_PA(translations[i].om_tte); error = hv_mmu_map_perm_addr((char *)translations[i].om_start, KCONTEXT, pa | TTE_KERNEL | VTD_4M, MAP_ITLB | MAP_DTLB); @@ -553,7 +560,7 @@ pa = pmap_bootstrap_alloc(tsb_8k_size); if (pa & PAGE_MASK_4M) panic("pmap_bootstrap: tsb unaligned\n"); - DPRINTF("tsb_8k_size is 0x%lx, tsb_8k_pa is 0x%lx\n", tsb_8k_size, pa); + KDPRINTF("tsb_8k_size is 0x%lx, tsb_8k_pa is 0x%lx\n", tsb_8k_size, pa); kernel_td[TSB8K_INDEX].hvtsb_idxpgsz = TTE8K; kernel_td[TSB8K_INDEX].hvtsb_assoc = 1; kernel_td[TSB8K_INDEX].hvtsb_ntte = (tsb_8k_size >> TTE_SHIFT); @@ -584,7 +591,7 @@ tsb_4m_size = virtsz >> (PAGE_SHIFT_4M - TTE_SHIFT); pa = pmap_bootstrap_alloc(tsb_4m_size); - DPRINTF("tsb_4m_pa is 0x%lx tsb_4m_size is 0x%lx\n", pa, tsb_4m_size); + KDPRINTF("tsb_4m_pa is 0x%lx tsb_4m_size is 0x%lx\n", pa, tsb_4m_size); kernel_td[TSB4M_INDEX].hvtsb_idxpgsz = TTE4M; kernel_td[TSB4M_INDEX].hvtsb_assoc = 1; kernel_td[TSB4M_INDEX].hvtsb_ntte = (tsb_4m_size >> TTE_SHIFT); @@ -629,7 +636,7 @@ * Calculate the last available physical address. */ for (i = 0; phys_avail[i + 2] != 0; i += 2) - DPRINTF("phys_avail[%d]=0x%lx phys_avail[%d]=0x%lx\n", + KDPRINTF("phys_avail[%d]=0x%lx phys_avail[%d]=0x%lx\n", i, phys_avail[i], i+1, phys_avail[i+1]); Maxmem = sparc64_btop(phys_avail[i + 1]); @@ -641,7 +648,7 @@ "translation: start=%#lx size=%#lx tte=%#lx", translations[i].om_start, translations[i].om_size, translations[i].om_tte); - DPRINTF("om_size=%ld om_start=%lx om_tte=%lx\n", + KDPRINTF("om_size=%ld om_start=%lx om_tte=%lx\n", translations[i].om_size, translations[i].om_start, translations[i].om_tte); @@ -707,13 +714,13 @@ pm->pm_hashscratch = tte_hash_set_scratchpad_kernel(pm->pm_hash); for (i = 0; i < translations_size; i++) { - DPRINTF("om_size=%ld om_start=%lx om_tte=%lx\n", + KDPRINTF("om_size=%ld om_start=%lx om_tte=%lx\n", translations[i].om_size, translations[i].om_start, translations[i].om_tte); if (translations[i].om_start < VM_MIN_PROM_ADDRESS || translations[i].om_start > VM_MAX_PROM_ADDRESS) { - DPRINTF("skipping\n"); + KDPRINTF("skipping\n"); continue; } for (off = 0; off < translations[i].om_size; off += PAGE_SIZE) { @@ -1144,18 +1151,6 @@ panic("cpumask(0x%x) != (1 << curcpu) (0x%x)\n", cpumask, (1 << curcpu)); - /* tlbactive should be set if we're using a pmap */ - if ((cpumask & pmap->pm_active) == 0 && curthread->td_proc && curthread->td_proc->p_pid != 1) { - if (curthread->td_proc) - printf("%s not active\n", - curthread->td_proc->p_comm); - printf("td->pcb->pcb_kstack=0x%lx\n", curthread->td_pcb->pcb_kstack); - panic("cpumask(0x%x) & active (0x%x) == 0 pid == %d\n", - cpumask, pmap->pm_active, curthread->td_proc->p_pid); - } - if ((cpumask & pmap->pm_tlbactive) == 0) - panic("cpumask(0x%x) & tlbactive (0x%x) == 0\n", - cpumask, pmap->pm_tlbactive); #endif if (cpumask == pmap->pm_tlbactive)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200604250702.k3P72AOE071256>