> From: Miod Vallat <m...@online.fr> > Date: Fri, 28 Mar 2025 19:53:23 +0000 > > > If this code has never been tested on pmap_kernel() then it is dead code > > and I'd rather remove it. Whoever wants to reduce the permission of the > > mapping will have to check on all architectures that this is supported. > > Well it is obvious that, because of the incorrect end address argument, > this call to uvm_map_protect() has never done anything, but it would be > nice to have the fixed call anyway. > > How about keeping it within > > /* pmap_write_protect() needs fixing to cope with pmap_kernel() on x86*/ > #if !defined(__amd64__) && !defined(__i386__) > the uvm_map_protect() call > #endif > > so that other platforms, where quick inspection of their pmap code shows > they ought to behave correctly, can benefit from the sigcode page being > made read-only?
Yes, that's what I'm thinking as well. With the intent to fix those pmaps eventually. But are you sure i386 is broken as well? The "&= PG_FRAME" there doesn't do any damage on i386 and i386 doesn't have the VA space hole that cause more grief on amd64 beyond that.