Re: macppc G5 pmap fix

2020-08-05 Thread Olivier Cherrier
On Sun, Jul 12, 2020 at 11:33:33AM +0200, mark.kette...@xs4all.nl wrote:
> 
> 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?
 
Hello Mark,

I'm running with it on my G5 and it seems happy.

$ sysctl hw.{machine,model,vendor,product} 
hw.machine=macppc
hw.model=970FX (Revision 0x300)
hw.vendor=Apple Computer, Inc.
hw.product=PowerMac8,1

Thanks,
Best.

-- 
Olivier Cherrier
Phone: +352691570680
mailto:o...@symacx.com



macppc G5 pmap fix

2020-07-12 Thread Mark Kettenis
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 -  1.172
+++ arch/powerpc/powerpc/pmap.c 12 Jul 2020 09:30:51 -
@@ -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. */