-/* $OpenBSD: locore.s,v 1.197 2023/01/06 19:10:18 miod Exp $ */
+/* $OpenBSD: locore.s,v 1.198 2023/01/11 19:57:17 miod Exp $ */
/* $NetBSD: locore.s,v 1.137 2001/08/13 06:10:10 jdolecek Exp $ */
/*
1:
ldxa [%g6] ASI_PHYS_CACHED, %g4
brgez,pn %g4, data_nfo ! Entry invalid? Punt
- or %g4, SUN4U_TLB_ACCESS, %g7 ! Update the access bit
+ nop
+
+ btst SUN4U_TLB_EXEC_ONLY, %g4 ! no read/write allowed?
+ bne,pn %xcc, data_nfo ! bail
+ nop
btst SUN4U_TLB_ACCESS, %g4 ! Need to update access git?
bne,pt %xcc, 1f
- nop
+ or %g4, SUN4U_TLB_ACCESS, %g7 ! Update the access bit
casxa [%g6] ASI_PHYS_CACHED, %g4, %g7 ! and write it out
cmp %g4, %g7
bne,pn %xcc, 1b
-/* $OpenBSD: pmap.c,v 1.107 2023/01/10 17:38:10 miod Exp $ */
+/* $OpenBSD: pmap.c,v 1.108 2023/01/11 19:57:18 miod Exp $ */
/* $NetBSD: pmap.c,v 1.107 2001/08/31 16:47:41 eeh Exp $ */
/*
*
OF_exit();
}
-
/*
* Now the kernel text segment is in its final location we can try to
* find out how much memory really is free.
tte.data |= SUN4U_TLB_REAL_W|SUN4U_TLB_W;
if (prot & PROT_EXEC)
tte.data |= SUN4U_TLB_EXEC;
+ if (prot == PROT_EXEC)
+ tte.data |= SUN4U_TLB_EXEC_ONLY;
tte.data |= SUN4U_TLB_TSB_LOCK; /* wired */
}
KDASSERT((tte.data & TLB_NFO) == 0);
tte.data |= SUN4U_TLB_REAL_W;
if (prot & PROT_EXEC)
tte.data |= SUN4U_TLB_EXEC;
+ if (prot == PROT_EXEC)
+ tte.data |= SUN4U_TLB_EXEC_ONLY;
if (wired)
tte.data |= SUN4U_TLB_TSB_LOCK;
}
KDASSERT(pm != pmap_kernel() || eva < INTSTACK || sva > EINTSTACK);
KDASSERT(pm != pmap_kernel() || eva < kdata || sva > ekdata);
- if ((prot & (PROT_WRITE | PROT_EXEC)) ==
- (PROT_WRITE | PROT_EXEC))
+ if ((prot & (PROT_WRITE | PROT_EXEC)) == (PROT_WRITE | PROT_EXEC))
return;
if (prot == PROT_NONE) {
if ((prot & PROT_WRITE) == 0)
data &= ~(SUN4U_TLB_W|SUN4U_TLB_REAL_W);
if ((prot & PROT_EXEC) == 0)
- data &= ~(SUN4U_TLB_EXEC);
+ data &= ~(SUN4U_TLB_EXEC | SUN4U_TLB_EXEC_ONLY);
}
KDASSERT((data & TLB_NFO) == 0);
if (pseg_set(pm, sva, data, 0)) {
clear |= SUN4U_TLB_EXEC;
if (PROT_EXEC == prot)
set |= SUN4U_TLB_EXEC_ONLY;
+ else
+ clear |= SUN4U_TLB_EXEC_ONLY;
}
pv = pa_to_pvh(pa);