While working on the OpenBSD/powerpc64 pmap I noticed that the code we
use for the G5 machines has a bug and doesn't remove execute
permission from mappings when it should.
Since I don't have a G5 machine readily available, can somebody test
this diff for me?
Index: arch/powerpc/powerpc/pmap.c
===================================================================
RCS file: /cvs/src/sys/arch/powerpc/powerpc/pmap.c,v
retrieving revision 1.172
diff -u -p -r1.172 pmap.c
--- arch/powerpc/powerpc/pmap.c 15 Apr 2020 08:09:00 -0000 1.172
+++ arch/powerpc/powerpc/pmap.c 12 Jul 2020 09:30:51 -0000
@@ -2005,8 +2005,7 @@ pmap_pted_ro64(struct pte_desc *pted, vm
}
/* Add a Page Table Entry, section 7.6.3.1. */
- ptp64->pte_lo &= ~(PTE_CHG_64|PTE_PP_64);
- ptp64->pte_lo |= PTE_RO_64;
+ ptp64->pte_lo = pted->p.pted_pte64.pte_lo;
eieio(); /* Order 1st PTE update before 2nd. */
ptp64->pte_hi |= PTE_VALID_64;
sync(); /* Ensure updates completed. */