Subject: port-sparc/3602: pmap.c diagnostic strings update
To: None <gnats-bugs@gnats.netbsd.org>
From: Erik E. Fair <fair@atomic.clock.org>
List: netbsd-bugs
Date: 05/10/1997 16:30:34
>Number: 3602
>Category: port-sparc
>Synopsis: routines in pmap.c have inaccurate panic & printf strings
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: gnats-admin (GNATS administrator)
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat May 10 16:35:00 1997
>Last-Modified:
>Originator: Erik E. Fair
>Organization:
International Organization of Internet Clock Watchers
>Release: NetBSD-current, May 10, 1997
>Environment:
System: NetBSD atomic.clock.org 1.2D NetBSD 1.2D (GENERIC) #42: Wed Apr 23 08:06:27 PDT 1997 root@atomic.clock.org:/usr/src/sys/arch/sparc/compile/GENERIC sparc
>Description:
Apparently with the addition of the sun4m pmap support, various
routines were cloned and changed as necessary for distinct sun4m
support, but various debug printf's and panic's have not been
updated to reflect the new names of various functions in pmap.c
that resulted from this code reorganization.
>How-To-Repeat:
code inspection
>Fix:
*** pmap.c.orig Sat Apr 12 04:41:00 1997
--- pmap.c Sat May 10 15:59:12 1997
***************
*** 908,914 ****
#if defined(SUN4M)
if (CPU_ISSUN4M) {
! panic("mmu_reservemon called on Sun4M machine");
return;
}
#endif
--- 908,914 ----
#if defined(SUN4M)
if (CPU_ISSUN4M) {
! panic("mmu_reservemon4_4c called on Sun4M machine");
return;
}
#endif
***************
*** 1089,1095 ****
case SRMMU_TEPTE:
#ifdef DEBUG
! printf("mmu_reservemon4m: "
"converting region 0x%x from L1->L3\n", i);
#endif
/*
--- 1089,1095 ----
case SRMMU_TEPTE:
#ifdef DEBUG
! printf("mmu_setup4m_L1: "
"converting region 0x%x from L1->L3\n", i);
#endif
/*
***************
*** 1147,1153 ****
case SRMMU_TEPTE:
#ifdef DEBUG
! printf("mmu_reservemon4m: converting L2 entry at segment 0x%x to L3\n",i);
#endif
/*
* This segment entry covers 256KB of memory -- or
--- 1147,1153 ----
case SRMMU_TEPTE:
#ifdef DEBUG
! printf("mmu_setup4m_L2: converting L2 entry at segment 0x%x to L3\n",i);
#endif
/*
* This segment entry covers 256KB of memory -- or
***************
*** 1934,1946 ****
flags = pv0->pv_flags;
for (pv = pv0; pv != NULL; pv = pv->pv_next) {
pm = pv->pv_pmap;
! if(pm==NULL)panic("pv_changepte 1");
va = pv->pv_va;
vr = VA_VREG(va);
vs = VA_VSEG(va);
rp = &pm->pm_regmap[vr];
if (rp->rg_segmap == NULL)
! panic("pv_changepte: no segments");
sp = &rp->rg_segmap[vs];
pte = sp->sg_pte;
--- 1934,1946 ----
flags = pv0->pv_flags;
for (pv = pv0; pv != NULL; pv = pv->pv_next) {
pm = pv->pv_pmap;
! if(pm==NULL)panic("pv_changepte4_4c: pm == NULL");
va = pv->pv_va;
vr = VA_VREG(va);
vs = VA_VSEG(va);
rp = &pm->pm_regmap[vr];
if (rp->rg_segmap == NULL)
! panic("pv_changepte4_4c: no segments");
sp = &rp->rg_segmap[vs];
pte = sp->sg_pte;
***************
*** 1948,1954 ****
if (sp->sg_pmeg == seginval) {
/* not in hardware: just fix software copy */
if (pte == NULL)
! panic("pv_changepte 2");
pte += VA_VPG(va);
*pte = (*pte | bis) & ~bic;
} else {
--- 1948,1954 ----
if (sp->sg_pmeg == seginval) {
/* not in hardware: just fix software copy */
if (pte == NULL)
! panic("pv_changepte4_4c: pte == NULL");
pte += VA_VPG(va);
*pte = (*pte | bis) & ~bic;
} else {
***************
*** 2029,2035 ****
vs = VA_VSEG(va);
rp = &pm->pm_regmap[vr];
if (rp->rg_segmap == NULL)
! panic("pv_syncflags: no segments");
sp = &rp->rg_segmap[vs];
if ((pmeg = sp->sg_pmeg) == seginval)
--- 2029,2035 ----
vs = VA_VSEG(va);
rp = &pm->pm_regmap[vr];
if (rp->rg_segmap == NULL)
! panic("pv_syncflags4_4c: no segments");
sp = &rp->rg_segmap[vs];
if ((pmeg = sp->sg_pmeg) == seginval)
***************
*** 2084,2090 ****
#ifdef DIAGNOSTIC
if (pv->pv_pmap == NULL)
! panic("pv_unlink0");
#endif
/*
* First entry is special (sigh).
--- 2084,2090 ----
#ifdef DIAGNOSTIC
if (pv->pv_pmap == NULL)
! panic("pv_unlink4_4c: pv_pmap == NULL");
#endif
/*
* First entry is special (sigh).
***************
*** 2105,2111 ****
for (prev = pv;; prev = npv, npv = npv->pv_next) {
pmap_stats.ps_unlink_pvsearch++;
if (npv == NULL)
! panic("pv_unlink");
if (npv->pv_pmap == pm && npv->pv_va == va)
break;
}
--- 2105,2111 ----
for (prev = pv;; prev = npv, npv = npv->pv_next) {
pmap_stats.ps_unlink_pvsearch++;
if (npv == NULL)
! panic("pv_unlink4_4c: npv == NULL");
if (npv->pv_pmap == pm && npv->pv_va == va)
break;
}
***************
*** 2163,2169 ****
if (BADALIAS(va, npv->pv_va)) {
#ifdef DEBUG
if (pmapdebug) printf(
! "pv_link: badalias: pid %d, %lx<=>%x, pa %lx\n",
curproc?curproc->p_pid:-1, va, npv->pv_va,
vm_first_phys + (pv-pv_table)*NBPG);
#endif
--- 2163,2169 ----
if (BADALIAS(va, npv->pv_va)) {
#ifdef DEBUG
if (pmapdebug) printf(
! "pv_link4_4c: badalias: pid %d, %lx<=>%x, pa %lx\n",
curproc?curproc->p_pid:-1, va, npv->pv_va,
vm_first_phys + (pv-pv_table)*NBPG);
#endif
***************
*** 2222,2233 ****
register int tpte;
pm = pv->pv_pmap;
if (pm == NULL)
! panic("pv_changepte 1");
va = pv->pv_va;
vr = VA_VREG(va);
rp = &pm->pm_regmap[vr];
if (rp->rg_segmap == NULL)
! panic("pv_changepte: no segments");
sp = &rp->rg_segmap[VA_VSEG(va)];
--- 2222,2233 ----
register int tpte;
pm = pv->pv_pmap;
if (pm == NULL)
! panic("pv_changepte4m: pm == NULL");
va = pv->pv_va;
vr = VA_VREG(va);
rp = &pm->pm_regmap[vr];
if (rp->rg_segmap == NULL)
! panic("pv_changepte4m: no segments");
sp = &rp->rg_segmap[VA_VSEG(va)];
***************
*** 2252,2258 ****
tpte = sp->sg_pte[VA_SUN4M_VPG(va)];
if ((tpte & SRMMU_TETYPE) != SRMMU_TEPTE) {
! printf("pv_changepte: invalid PTE for 0x%x\n", va);
continue;
}
--- 2252,2258 ----
tpte = sp->sg_pte[VA_SUN4M_VPG(va)];
if ((tpte & SRMMU_TETYPE) != SRMMU_TEPTE) {
! printf("pv_changepte4m: invalid PTE for 0x%x\n", va);
continue;
}
***************
*** 2305,2311 ****
vs = VA_VSEG(va);
rp = &pm->pm_regmap[vr];
if (rp->rg_segmap == NULL)
! panic("pv_syncflags: no segments");
sp = &rp->rg_segmap[vs];
if (sp->sg_pte == NULL) /* invalid */
--- 2305,2311 ----
vs = VA_VSEG(va);
rp = &pm->pm_regmap[vr];
if (rp->rg_segmap == NULL)
! panic("pv_syncflags4m: no segments");
sp = &rp->rg_segmap[vs];
if (sp->sg_pte == NULL) /* invalid */
***************
*** 2353,2359 ****
#ifdef DIAGNOSTIC
if (pv->pv_pmap == NULL)
! panic("pv_unlink0");
#endif
/*
* First entry is special (sigh).
--- 2353,2359 ----
#ifdef DIAGNOSTIC
if (pv->pv_pmap == NULL)
! panic("pv_unlink4m: pv_map == NULL");
#endif
/*
* First entry is special (sigh).
***************
*** 2374,2380 ****
for (prev = pv;; prev = npv, npv = npv->pv_next) {
pmap_stats.ps_unlink_pvsearch++;
if (npv == NULL)
! panic("pv_unlink");
if (npv->pv_pmap == pm && npv->pv_va == va)
break;
}
--- 2374,2380 ----
for (prev = pv;; prev = npv, npv = npv->pv_next) {
pmap_stats.ps_unlink_pvsearch++;
if (npv == NULL)
! panic("pv_unlink4m: npv == NULL");
if (npv->pv_pmap == pm && npv->pv_va == va)
break;
}
***************
*** 2432,2438 ****
if (BADALIAS(va, npv->pv_va)) {
#ifdef DEBUG
if (pmapdebug & PDB_CACHESTUFF) printf(
! "pv_link: badalias: pid %d, %lx<=>%x, pa %lx\n",
curproc?curproc->p_pid:-1, va, npv->pv_va,
vm_first_phys + (pv-pv_table)*NBPG);
#endif
--- 2432,2438 ----
if (BADALIAS(va, npv->pv_va)) {
#ifdef DEBUG
if (pmapdebug & PDB_CACHESTUFF) printf(
! "pv_link4m: badalias: pid %d, %lx<=>%x, pa %lx\n",
curproc?curproc->p_pid:-1, va, npv->pv_va,
vm_first_phys + (pv-pv_table)*NBPG);
#endif
***************
*** 2583,2589 ****
segfixmask = nsegment - 1; /* assume nsegment is a power of 2 */
#ifdef DIAGNOSTIC
if (((nsegment & segfixmask) | (nsegment & ~segfixmask)) != nsegment) {
! printf("pmap_bootstrap: unsuitable number of segments (%d)\n",
nsegment);
callrom();
}
--- 2583,2589 ----
segfixmask = nsegment - 1; /* assume nsegment is a power of 2 */
#ifdef DIAGNOSTIC
if (((nsegment & segfixmask) | (nsegment & ~segfixmask)) != nsegment) {
! printf("pmap_bootstrap4_4c: unsuitable number of segments (%d)\n",
nsegment);
callrom();
}
***************
*** 2701,2707 ****
npmemarr = makememarr(pmemarr, MA_SIZE, MEMARR_AVAILPHYS);
sortm(pmemarr, npmemarr);
if (pmemarr[0].addr != 0) {
! printf("pmap_bootstrap: no kernel memory?!\n");
callrom();
}
avail_end = pmemarr[npmemarr-1].addr + pmemarr[npmemarr-1].len;
--- 2701,2707 ----
npmemarr = makememarr(pmemarr, MA_SIZE, MEMARR_AVAILPHYS);
sortm(pmemarr, npmemarr);
if (pmemarr[0].addr != 0) {
! printf("pmap_bootstrap4_4c: no kernel memory?!\n");
callrom();
}
avail_end = pmemarr[npmemarr-1].addr + pmemarr[npmemarr-1].len;
***************
*** 2780,2786 ****
/* Entering a new region */
if (VA_VREG(p) > vr) {
#ifdef DEBUG
! printf("note: giant kernel!\n");
#endif
vr++, rp++;
}
--- 2780,2786 ----
/* Entering a new region */
if (VA_VREG(p) > vr) {
#ifdef DEBUG
! printf("pmap_bootstrap4_4c: giant kernel!\n");
#endif
vr++, rp++;
}
***************
*** 3000,3006 ****
npmemarr = makememarr(pmemarr, MA_SIZE, MEMARR_AVAILPHYS);
sortm(pmemarr, npmemarr);
if (pmemarr[0].addr != 0) {
! printf("pmap_bootstrap: no kernel memory?!\n");
callrom();
}
avail_end = pmemarr[npmemarr-1].addr + pmemarr[npmemarr-1].len;
--- 3000,3006 ----
npmemarr = makememarr(pmemarr, MA_SIZE, MEMARR_AVAILPHYS);
sortm(pmemarr, npmemarr);
if (pmemarr[0].addr != 0) {
! printf("pmap_bootstrap4m: no kernel memory?!\n");
callrom();
}
avail_end = pmemarr[npmemarr-1].addr + pmemarr[npmemarr-1].len;
***************
*** 3119,3125 ****
rp->rg_seg_ptps = (int *)kphyssegtbl;
if (rp->rg_segmap == NULL) {
! printf("rp->rg_segmap == NULL!\n");
rp->rg_segmap = &kernel_segmap_store[kregnum * NSEGRG];
}
--- 3119,3125 ----
rp->rg_seg_ptps = (int *)kphyssegtbl;
if (rp->rg_segmap == NULL) {
! printf("pmap_bootstrap4m: rp->rg_segmap == NULL!\n");
rp->rg_segmap = &kernel_segmap_store[kregnum * NSEGRG];
}
***************
*** 3254,3260 ****
{
#ifdef DEBUG
! printf("pmap_bootstrap: installing kernel page tables...");
#endif
setcontext4m(0); /* paranoia? %%%: Make 0x3 a define! below */
--- 3254,3260 ----
{
#ifdef DEBUG
! printf("mmu_install_tables: installing kernel page tables...");
#endif
setcontext4m(0); /* paranoia? %%%: Make 0x3 a define! below */
***************
*** 3745,3751 ****
#ifdef DEBUG
if (rp->rg_segmap == NULL)
! panic("pmap_rmk: no segments");
#endif
if ((nleft = sp->sg_npte) == 0)
--- 3745,3751 ----
#ifdef DEBUG
if (rp->rg_segmap == NULL)
! panic("pmap_rmk4_4c: no segments");
#endif
if ((nleft = sp->sg_npte) == 0)
***************
*** 3755,3763 ****
#ifdef DEBUG
if (pmeg == seginval)
! panic("pmap_rmk: not loaded");
if (pm->pm_ctx == NULL)
! panic("pmap_rmk: lost context");
#endif
setcontext4(0);
--- 3755,3763 ----
#ifdef DEBUG
if (pmeg == seginval)
! panic("pmap_rmk4_4c: not loaded");
if (pm->pm_ctx == NULL)
! panic("pmap_rmk4_4c: lost context");
#endif
setcontext4(0);
***************
*** 3848,3854 ****
#ifdef DEBUG
if (rp->rg_segmap == NULL)
! panic("pmap_rmk: no segments");
#endif
if ((nleft = sp->sg_npte) == 0)
--- 3848,3854 ----
#ifdef DEBUG
if (rp->rg_segmap == NULL)
! panic("pmap_rmk4m: no segments");
#endif
if ((nleft = sp->sg_npte) == 0)
***************
*** 3856,3864 ****
#ifdef DEBUG
if (sp->sg_pte == NULL || rp->rg_seg_ptps == NULL)
! panic("pmap_rmk: segment/region does not exist");
if (pm->pm_ctx == NULL)
! panic("pmap_rmk: lost context");
#endif
setcontext4m(0);
--- 3856,3864 ----
#ifdef DEBUG
if (sp->sg_pte == NULL || rp->rg_seg_ptps == NULL)
! panic("pmap_rmk4m: segment/region does not exist");
if (pm->pm_ctx == NULL)
! panic("pmap_rmk4m: lost context");
#endif
setcontext4m(0);
***************
*** 3879,3885 ****
#ifdef DEBUG
if ((pmapdebug & PDB_SANITYCHK) &&
(getpte4m(va) & SRMMU_TETYPE) == SRMMU_TEPTE)
! panic("Spurious kTLB entry for %lx", va);
#endif
va += NBPG;
continue;
--- 3879,3885 ----
#ifdef DEBUG
if ((pmapdebug & PDB_SANITYCHK) &&
(getpte4m(va) & SRMMU_TETYPE) == SRMMU_TEPTE)
! panic("pmap_rmk4m: spurious kTLB entry for %lx", va);
#endif
va += NBPG;
continue;
***************
*** 3958,3970 ****
if (rp->rg_nsegmap == 0)
return;
if (rp->rg_segmap == NULL)
! panic("pmap_rmu: no segments");
sp = &rp->rg_segmap[vs];
if ((nleft = sp->sg_npte) == 0)
return;
if (sp->sg_pte == NULL)
! panic("pmap_rmu: no pages");
pmeg = sp->sg_pmeg;
--- 3958,3970 ----
if (rp->rg_nsegmap == 0)
return;
if (rp->rg_segmap == NULL)
! panic("pmap_rmu4_4c: no segments");
sp = &rp->rg_segmap[vs];
if ((nleft = sp->sg_npte) == 0)
return;
if (sp->sg_pte == NULL)
! panic("pmap_rmu4_4c: no pages");
pmeg = sp->sg_pmeg;
***************
*** 4065,4071 ****
if ((sp->sg_npte = nleft) == 0 /* ??? && pm->pm_ctx != NULL*/) {
#ifdef DEBUG
if (pm->pm_ctx == NULL) {
! printf("pmap_rmu: no context here...");
}
#endif
va = VSTOVA(vr,vs); /* retract */
--- 4065,4071 ----
if ((sp->sg_npte = nleft) == 0 /* ??? && pm->pm_ctx != NULL*/) {
#ifdef DEBUG
if (pm->pm_ctx == NULL) {
! printf("pmap_rmu4_4c: no context here...");
}
#endif
va = VSTOVA(vr,vs); /* retract */
***************
*** 4118,4131 ****
if (rp->rg_nsegmap == 0)
return;
if (rp->rg_segmap == NULL)
! panic("pmap_rmu: no segments");
sp = &rp->rg_segmap[vs];
if ((nleft = sp->sg_npte) == 0)
return;
if (sp->sg_pte == NULL)
! panic("pmap_rmu: no pages");
pte0 = sp->sg_pte;
--- 4118,4131 ----
if (rp->rg_nsegmap == 0)
return;
if (rp->rg_segmap == NULL)
! panic("pmap_rmu4m: no segments");
sp = &rp->rg_segmap[vs];
if ((nleft = sp->sg_npte) == 0)
return;
if (sp->sg_pte == NULL)
! panic("pmap_rmu4m: no pages");
pte0 = sp->sg_pte;
***************
*** 4157,4163 ****
if ((pmapdebug & PDB_SANITYCHK) &&
pm->pm_ctx &&
(getpte4m(va) & SRMMU_TEPTE) == SRMMU_TEPTE)
! panic("Spurious uTLB entry for %lx", va);
#endif
continue;
}
--- 4157,4163 ----
if ((pmapdebug & PDB_SANITYCHK) &&
pm->pm_ctx &&
(getpte4m(va) & SRMMU_TEPTE) == SRMMU_TEPTE)
! panic("pmap_rmu4m: spurious uTLB entry for %lx", va);
#endif
continue;
}
***************
*** 4186,4192 ****
if ((sp->sg_npte = nleft) == 0) {
#ifdef DEBUG
if (pm->pm_ctx == NULL) {
! printf("pmap_rmu: no context here...");
}
#endif
va = VSTOVA(vr,vs); /* retract */
--- 4186,4192 ----
if ((sp->sg_npte = nleft) == 0) {
#ifdef DEBUG
if (pm->pm_ctx == NULL) {
! printf("pmap_rmu4m: no context here...");
}
#endif
va = VSTOVA(vr,vs); /* retract */
***************
*** 4230,4239 ****
#ifdef DEBUG
if (!pmap_pa_exists(pa))
! panic("pmap_page_protect: no such address: %lx", pa);
if ((pmapdebug & PDB_CHANGEPROT) ||
(pmapdebug & PDB_REMOVE && prot == VM_PROT_NONE))
! printf("pmap_page_protect(%lx, %x)\n", pa, prot);
#endif
/*
* Skip unmanaged pages, or operations that do not take
--- 4230,4239 ----
#ifdef DEBUG
if (!pmap_pa_exists(pa))
! panic("pmap_page_protect4_4c: no such address: %lx", pa);
if ((pmapdebug & PDB_CHANGEPROT) ||
(pmapdebug & PDB_REMOVE && prot == VM_PROT_NONE))
! printf("pmap_page_protect4_4c(%lx, %x)\n", pa, prot);
#endif
/*
* Skip unmanaged pages, or operations that do not take
***************
*** 4269,4278 ****
vs = VA_VSEG(va);
rp = &pm->pm_regmap[vr];
if (rp->rg_nsegmap == 0)
! panic("pmap_remove_all: empty vreg");
sp = &rp->rg_segmap[vs];
if ((nleft = sp->sg_npte) == 0)
! panic("pmap_remove_all: empty vseg");
nleft--;
sp->sg_npte = nleft;
--- 4269,4278 ----
vs = VA_VSEG(va);
rp = &pm->pm_regmap[vr];
if (rp->rg_nsegmap == 0)
! panic("pmap_page_protect4_4c: empty vreg");
sp = &rp->rg_segmap[vs];
if ((nleft = sp->sg_npte) == 0)
! panic("pmap_page_protect4_4c: empty vseg");
nleft--;
sp->sg_npte = nleft;
***************
*** 4316,4322 ****
tpte = getpte4(pteva);
if ((tpte & PG_V) == 0)
! panic("pmap_page_protect !PG_V");
flags |= MR4_4C(tpte);
if (nleft) {
--- 4316,4322 ----
tpte = getpte4(pteva);
if ((tpte & PG_V) == 0)
! panic("pmap_page_protect4_4c !PG_V");
flags |= MR4_4C(tpte);
if (nleft) {
***************
*** 4429,4435 ****
vs = VA_VSEG(va);
rp = &pm->pm_regmap[vr];
nva = VSTOVA(vr,vs + 1);
! if (nva == 0) panic("pmap_protect: last segment"); /* cannot happen */
if (nva > eva)
nva = eva;
if (rp->rg_nsegmap == 0) {
--- 4429,4435 ----
vs = VA_VSEG(va);
rp = &pm->pm_regmap[vr];
nva = VSTOVA(vr,vs + 1);
! if (nva == 0) panic("pmap_protect4_4c: last segment"); /* cannot happen */
if (nva > eva)
nva = eva;
if (rp->rg_nsegmap == 0) {
***************
*** 4438,4444 ****
}
#ifdef DEBUG
if (rp->rg_segmap == NULL)
! panic("pmap_protect: no segments");
#endif
sp = &rp->rg_segmap[vs];
if (sp->sg_npte == 0) {
--- 4438,4444 ----
}
#ifdef DEBUG
if (rp->rg_segmap == NULL)
! panic("pmap_protect4_4c: no segments");
#endif
sp = &rp->rg_segmap[vs];
if (sp->sg_npte == 0) {
***************
*** 4447,4453 ****
}
#ifdef DEBUG
if (pm != pmap_kernel() && sp->sg_pte == NULL)
! panic("pmap_protect: no pages");
#endif
if (sp->sg_pmeg == seginval) {
register int *pte = &sp->sg_pte[VA_VPG(va)];
--- 4447,4453 ----
}
#ifdef DEBUG
if (pm != pmap_kernel() && sp->sg_pte == NULL)
! panic("pmap_protect4_4c: no pages");
#endif
if (sp->sg_pmeg == seginval) {
register int *pte = &sp->sg_pte[VA_VPG(va)];
***************
*** 4517,4523 ****
#ifdef DEBUG
if (pmapdebug & PDB_CHANGEPROT)
! printf("pmap_changeprot(%p, %lx, %x, %x)\n",
pm, va, prot, wired);
#endif
--- 4517,4523 ----
#ifdef DEBUG
if (pmapdebug & PDB_CHANGEPROT)
! printf("pmap_changeprot4_4c(%p, %lx, %x, %x)\n",
pm, va, prot, wired);
#endif
***************
*** 4533,4543 ****
s = splpmap(); /* conservative */
rp = &pm->pm_regmap[vr];
if (rp->rg_nsegmap == 0) {
! printf("pmap_changeprot: no segments in %d\n", vr);
return;
}
if (rp->rg_segmap == NULL) {
! printf("pmap_changeprot: no segments in %d!\n", vr);
return;
}
sp = &rp->rg_segmap[vs];
--- 4533,4543 ----
s = splpmap(); /* conservative */
rp = &pm->pm_regmap[vr];
if (rp->rg_nsegmap == 0) {
! printf("pmap_changeprot4_4c: no segments in %d\n", vr);
return;
}
if (rp->rg_segmap == NULL) {
! printf("pmap_changeprot4_4c: no segments in %d!\n", vr);
return;
}
sp = &rp->rg_segmap[vs];
***************
*** 4546,4552 ****
#ifdef DEBUG
if (pm != pmap_kernel() && sp->sg_pte == NULL)
! panic("pmap_changeprot: no pages");
#endif
/* update PTEs in software or hardware */
--- 4546,4552 ----
#ifdef DEBUG
if (pm != pmap_kernel() && sp->sg_pte == NULL)
! panic("pmap_changeprot4_4c: no pages");
#endif
/* update PTEs in software or hardware */
***************
*** 4622,4631 ****
#ifdef DEBUG
if (!pmap_pa_exists(pa))
! panic("pmap_page_protect: no such address: 0x%lx", pa);
if ((pmapdebug & PDB_CHANGEPROT) ||
(pmapdebug & PDB_REMOVE && prot == VM_PROT_NONE))
! printf("pmap_page_protect(%lx, %x)\n", pa, prot);
#endif
/*
* Skip unmanaged pages, or operations that do not take
--- 4622,4631 ----
#ifdef DEBUG
if (!pmap_pa_exists(pa))
! panic("pmap_page_protect4m: no such address: 0x%lx", pa);
if ((pmapdebug & PDB_CHANGEPROT) ||
(pmapdebug & PDB_REMOVE && prot == VM_PROT_NONE))
! printf("pmap_page_protect4m(%lx, %x)\n", pa, prot);
#endif
/*
* Skip unmanaged pages, or operations that do not take
***************
*** 4660,4669 ****
vs = VA_VSEG(va);
rp = &pm->pm_regmap[vr];
if (rp->rg_nsegmap == 0)
! panic("pmap_remove_all: empty vreg");
sp = &rp->rg_segmap[vs];
if ((nleft = sp->sg_npte) == 0)
! panic("pmap_remove_all: empty vseg");
nleft--;
sp->sg_npte = nleft;
--- 4660,4669 ----
vs = VA_VSEG(va);
rp = &pm->pm_regmap[vr];
if (rp->rg_nsegmap == 0)
! panic("pmap_page_protect4m: empty vreg");
sp = &rp->rg_segmap[vs];
if ((nleft = sp->sg_npte) == 0)
! panic("pmap_page_protect4m: empty vseg");
nleft--;
sp->sg_npte = nleft;
***************
*** 4677,4683 ****
tpte = sp->sg_pte[VA_SUN4M_VPG(va)];
if ((tpte & SRMMU_TETYPE) != SRMMU_TEPTE)
! panic("pmap_page_protect !PG_V");
flags |= MR4M(tpte);
--- 4677,4683 ----
tpte = sp->sg_pte[VA_SUN4M_VPG(va)];
if ((tpte & SRMMU_TETYPE) != SRMMU_TEPTE)
! panic("pmap_page_protect4m !PG_V");
flags |= MR4M(tpte);
***************
*** 4688,4694 ****
tlb_flush_segment(vr, vs); /* Paranoid? */
if (va < virtual_avail) {
#ifdef DEBUG
! printf("pmap_rmk4m: attempt to free "
"base kernel allocation\n");
#endif
goto nextpv;
--- 4688,4694 ----
tlb_flush_segment(vr, vs); /* Paranoid? */
if (va < virtual_avail) {
#ifdef DEBUG
! printf("pmap_page_protect4m: attempt to free "
"base kernel allocation\n");
#endif
goto nextpv;
***************
*** 4769,4775 ****
rp = &pm->pm_regmap[vr];
nva = VSTOVA(vr,vs + 1);
if (nva == 0) /* XXX */
! panic("pmap_protect: last segment"); /* cannot happen(why?)*/
if (nva > eva)
nva = eva;
if (rp->rg_nsegmap == 0) {
--- 4769,4775 ----
rp = &pm->pm_regmap[vr];
nva = VSTOVA(vr,vs + 1);
if (nva == 0) /* XXX */
! panic("pmap_protect4m: last segment"); /* cannot happen(why?)*/
if (nva > eva)
nva = eva;
if (rp->rg_nsegmap == 0) {
***************
*** 4778,4784 ****
}
#ifdef DEBUG
if (rp->rg_segmap == NULL)
! panic("pmap_protect: no segments");
#endif
sp = &rp->rg_segmap[vs];
if (sp->sg_npte == 0) {
--- 4778,4784 ----
}
#ifdef DEBUG
if (rp->rg_segmap == NULL)
! panic("pmap_protect4m: no segments");
#endif
sp = &rp->rg_segmap[vs];
if (sp->sg_npte == 0) {
***************
*** 4787,4793 ****
}
#ifdef DEBUG
if (sp->sg_pte == NULL)
! panic("pmap_protect: no pages");
#endif
/* pages loaded: take away write bits from MMU PTEs */
if (pm->pm_ctx)
--- 4787,4793 ----
}
#ifdef DEBUG
if (sp->sg_pte == NULL)
! panic("pmap_protect4m: no pages");
#endif
/* pages loaded: take away write bits from MMU PTEs */
if (pm->pm_ctx)
***************
*** 4835,4841 ****
#ifdef DEBUG
if (pmapdebug & PDB_CHANGEPROT)
! printf("pmap_changeprot(%p, %lx, %x, %x)\n",
pm, va, prot, wired);
#endif
--- 4835,4841 ----
#ifdef DEBUG
if (pmapdebug & PDB_CHANGEPROT)
! printf("pmap_changeprot4m(%p, %lx, %x, %x)\n",
pm, va, prot, wired);
#endif
***************
*** 4906,4912 ****
if (VA_INHOLE(va)) {
#ifdef DEBUG
! printf("pmap_enter: pm %p, va %lx, pa %lx: in MMU hole\n",
pm, va, pa);
#endif
return;
--- 4906,4912 ----
if (VA_INHOLE(va)) {
#ifdef DEBUG
! printf("pmap_enter4_4c: pm %p, va %lx, pa %lx: in MMU hole\n",
pm, va, pa);
#endif
return;
***************
*** 4914,4920 ****
#ifdef DEBUG
if (pmapdebug & PDB_ENTER)
! printf("pmap_enter(%p, %lx, %lx, %x, %x)\n",
pm, va, pa, prot, wired);
#endif
--- 4914,4920 ----
#ifdef DEBUG
if (pmapdebug & PDB_ENTER)
! printf("pmap_enter4_4c(%p, %lx, %lx, %x, %x)\n",
pm, va, pa, prot, wired);
#endif
***************
*** 4928,4934 ****
if ((pteproto & PG_TYPE) == PG_OBMEM && managed(pa)) {
#ifdef DIAGNOSTIC
if (!pmap_pa_exists(pa))
! panic("pmap_enter: no such address: %lx", pa);
#endif
pv = pvhead(pa);
} else {
--- 4928,4934 ----
if ((pteproto & PG_TYPE) == PG_OBMEM && managed(pa)) {
#ifdef DIAGNOSTIC
if (!pmap_pa_exists(pa))
! panic("pmap_enter4_4c: no such address: %lx", pa);
#endif
pv = pvhead(pa);
} else {
***************
*** 4998,5004 ****
if ((tpte & PG_TYPE) == PG_OBMEM) {
#ifdef DEBUG
! printf("pmap_enk: changing existing va=>pa entry: va %lx, pteproto %x\n",
va, pteproto);
#endif
/*
--- 4998,5004 ----
if ((tpte & PG_TYPE) == PG_OBMEM) {
#ifdef DEBUG
! printf("pmap_enk4_4c: changing existing va=>pa entry: va %lx, pteproto %x\n",
va, pteproto);
#endif
/*
***************
*** 5038,5044 ****
*/
#ifdef DEBUG
if (pm->pm_ctx == NULL || pm->pm_ctxnum != 0)
! panic("pmap_enk: kern seg but no kern ctx");
#endif
sp->sg_pmeg = me_alloc(&segm_locked, pm, vr, vs)->me_cookie;
rp->rg_nsegmap++;
--- 5038,5044 ----
*/
#ifdef DEBUG
if (pm->pm_ctx == NULL || pm->pm_ctxnum != 0)
! panic("pmap_enk4_4c: kern seg but no kern ctx");
#endif
sp->sg_pmeg = me_alloc(&segm_locked, pm, vr, vs)->me_cookie;
rp->rg_nsegmap++;
***************
*** 5103,5111 ****
#ifdef DEBUG
if (pm->pm_gap_end < pm->pm_gap_start) {
! printf("pmap_enu: gap_start %x, gap_end %x",
pm->pm_gap_start, pm->pm_gap_end);
! panic("pmap_enu: gap botch");
}
#endif
--- 5103,5111 ----
#ifdef DEBUG
if (pm->pm_gap_end < pm->pm_gap_start) {
! printf("pmap_enu4_4c: gap_start %x, gap_end %x",
pm->pm_gap_start, pm->pm_gap_end);
! panic("pmap_enu4_4c: gap botch");
}
#endif
***************
*** 5117,5123 ****
sp = (struct segmap *)malloc((u_long)size, M_VMPMAP, M_WAITOK);
if (rp->rg_segmap != NULL) {
! printf("pmap_enter: segment filled during sleep\n"); /* can this happen? */
free(sp, M_VMPMAP);
goto rretry;
}
--- 5117,5123 ----
sp = (struct segmap *)malloc((u_long)size, M_VMPMAP, M_WAITOK);
if (rp->rg_segmap != NULL) {
! printf("pmap_enu4_4c: segment filled during sleep\n"); /* can this happen? */
free(sp, M_VMPMAP);
goto rretry;
}
***************
*** 5137,5149 ****
pte = (int *)malloc((u_long)size, M_VMPMAP, M_WAITOK);
if (sp->sg_pte != NULL) {
! printf("pmap_enter: pte filled during sleep\n"); /* can this happen? */
free(pte, M_VMPMAP);
goto sretry;
}
#ifdef DEBUG
if (sp->sg_pmeg != seginval)
! panic("pmap_enter: new ptes, but not seginval");
#endif
qzero((caddr_t)pte, size);
sp->sg_pte = pte;
--- 5137,5149 ----
pte = (int *)malloc((u_long)size, M_VMPMAP, M_WAITOK);
if (sp->sg_pte != NULL) {
! printf("pmap_enu4_4c: pte filled during sleep\n"); /* can this happen? */
free(pte, M_VMPMAP);
goto sretry;
}
#ifdef DEBUG
if (sp->sg_pmeg != seginval)
! panic("pmap_enu4_4c: new ptes, but not seginval");
#endif
qzero((caddr_t)pte, size);
sp->sg_pte = pte;
***************
*** 5192,5198 ****
* If old page was cached, flush cache.
*/
#if 0
! printf("%s[%d]: pmap_enu: changing existing va(%x)=>pa entry\n",
curproc->p_comm, curproc->p_pid, va);
#endif
if ((tpte & PG_TYPE) == PG_OBMEM) {
--- 5192,5198 ----
* If old page was cached, flush cache.
*/
#if 0
! printf("%s[%d]: pmap_enu4_4c: changing existing va(%x)=>pa entry\n",
curproc->p_comm, curproc->p_pid, va);
#endif
if ((tpte & PG_TYPE) == PG_OBMEM) {
***************
*** 5272,5278 ****
#ifdef DEBUG
if (pmapdebug & PDB_ENTER)
! printf("pmap_enter(%p, %lx, %lx, %x, %x)\n",
pm, va, pa, prot, wired);
#endif
--- 5272,5278 ----
#ifdef DEBUG
if (pmapdebug & PDB_ENTER)
! printf("pmap_enter4m(%p, %lx, %lx, %x, %x)\n",
pm, va, pa, prot, wired);
#endif
***************
*** 5298,5304 ****
if ((pteproto & SRMMU_PGTYPE) == PG_SUN4M_OBMEM && managed(pa)) {
#ifdef DIAGNOSTIC
if (!pmap_pa_exists(pa))
! panic("pmap_enter: no such address: %lx", pa);
#endif
pv = pvhead(pa);
} else {
--- 5298,5304 ----
if ((pteproto & SRMMU_PGTYPE) == PG_SUN4M_OBMEM && managed(pa)) {
#ifdef DIAGNOSTIC
if (!pmap_pa_exists(pa))
! panic("pmap_enter4m: no such address: %lx", pa);
#endif
pv = pvhead(pa);
} else {
***************
*** 5480,5486 ****
pte = (int *)malloc((u_long)size, M_VMPMAP, M_WAITOK);
if (sp->sg_pte != NULL) {
! printf("pmap_enter: pte filled during sleep\n"); /* can this happen? */
free(pte, M_VMPMAP);
goto sretry;
}
--- 5480,5486 ----
pte = (int *)malloc((u_long)size, M_VMPMAP, M_WAITOK);
if (sp->sg_pte != NULL) {
! printf("pmap_enu4m: pte filled during sleep\n"); /* can this happen? */
free(pte, M_VMPMAP);
goto sretry;
}
***************
*** 5527,5533 ****
*/
#ifdef DEBUG
if (pmapdebug & PDB_SWITCHMAP)
! printf("%s[%d]: pmap_enu: changing existing va(%x)=>pa(pte=%x) entry\n",
curproc->p_comm, curproc->p_pid, (int)va, (int)pte);
#endif
if ((tpte & SRMMU_PGTYPE) == PG_SUN4M_OBMEM) {
--- 5527,5533 ----
*/
#ifdef DEBUG
if (pmapdebug & PDB_SWITCHMAP)
! printf("%s[%d]: pmap_enu4m: changing existing va(%x)=>pa(pte=%x) entry\n",
curproc->p_comm, curproc->p_pid, (int)va, (int)pte);
#endif
if ((tpte & SRMMU_PGTYPE) == PG_SUN4M_OBMEM) {
***************
*** 5597,5610 ****
struct segmap *sp;
if (pm == NULL) {
! printf("pmap_extract: null pmap\n");
return (0);
}
vr = VA_VREG(va);
vs = VA_VSEG(va);
rp = &pm->pm_regmap[vr];
if (rp->rg_segmap == NULL) {
! printf("pmap_extract: invalid segment (%d)\n", vr);
return (0);
}
sp = &rp->rg_segmap[vs];
--- 5597,5610 ----
struct segmap *sp;
if (pm == NULL) {
! printf("pmap_extract4_4c: null pmap\n");
return (0);
}
vr = VA_VREG(va);
vs = VA_VSEG(va);
rp = &pm->pm_regmap[vr];
if (rp->rg_segmap == NULL) {
! printf("pmap_extract4_4c: invalid segment (%d)\n", vr);
return (0);
}
sp = &rp->rg_segmap[vs];
***************
*** 5627,5639 ****
register int *pte = sp->sg_pte;
if (pte == NULL) {
! printf("pmap_extract: invalid segment\n");
return (0);
}
tpte = pte[VA_VPG(va)];
}
if ((tpte & PG_V) == 0) {
! printf("pmap_extract: invalid pte\n");
return (0);
}
tpte &= PG_PFNUM;
--- 5627,5639 ----
register int *pte = sp->sg_pte;
if (pte == NULL) {
! printf("pmap_extract4_4c: invalid segment\n");
return (0);
}
tpte = pte[VA_VPG(va)];
}
if ((tpte & PG_V) == 0) {
! printf("pmap_extract4_4c: invalid pte\n");
return (0);
}
tpte &= PG_PFNUM;
***************
*** 5656,5662 ****
register int pte;
if (pm == NULL) {
! printf("pmap_extract: null pmap\n");
return (0);
}
--- 5656,5662 ----
register int pte;
if (pm == NULL) {
! printf("pmap_extract4m: null pmap\n");
return (0);
}
***************
*** 5664,5670 ****
#ifdef DEBUG
if ((pte & SRMMU_TETYPE) != SRMMU_TEPTE) {
! printf("pmap_extract: invalid pte of type %d\n",
pte & SRMMU_TETYPE);
return (0);
}
--- 5664,5670 ----
#ifdef DEBUG
if ((pte & SRMMU_TETYPE) != SRMMU_TEPTE) {
! printf("pmap_extract4m: invalid pte of type %d\n",
pte & SRMMU_TETYPE);
return (0);
}
>Audit-Trail:
>Unformatted: