Re: [RFC][POWERPC] Provide a way to protect 4k subpages when using 64k pages

2007-12-11 Thread Benjamin Herrenschmidt
On Tue, 2007-12-11 at 16:53 +0100, Christoph Hellwig wrote: > All these process would use plain mmap/ > mprotect to deal with the subpage protections. That seems very hard to do ... all of the generic code here only knows about the base page size, so except if we're going to fully re-implement

Re: [RFC][POWERPC] Provide a way to protect 4k subpages when using 64k pages

2007-12-11 Thread Paul Mackerras
Christoph Hellwig writes: > As Arnd said reusing an old system call slot seems rather dangerous, > I'd rather avoid it. Sure. I don't mind allocating a new syscall for this. > But I wonder whether we really need a new > syscall. Using 4k pages should basically be a pre-process flag > (which

Re: [RFC][POWERPC] Provide a way to protect 4k subpages when using 64k pages

2007-12-11 Thread Arnd Bergmann
On Tuesday 11 December 2007, Christoph Hellwig wrote: > Using 4k pages should basically be a pre-process flag > (which it already is as an implementation detail in your patch), and > thus the proper way to mark it should be a personality flag.  This > also means it could be implied by certain

Re: [RFC][POWERPC] Provide a way to protect 4k subpages when using 64k pages

2007-12-11 Thread Christoph Hellwig
On Fri, Dec 07, 2007 at 05:09:27PM +1100, Paul Mackerras wrote: > Implicit in this is that the regions of the address space that are > protected are switched to use 4k hardware pages rather than 64k > hardware pages (on machines with hardware 64k page support). In fact > the whole process is

Re: [RFC][POWERPC] Provide a way to protect 4k subpages when using 64k pages

2007-12-11 Thread Christoph Hellwig
On Fri, Dec 07, 2007 at 05:09:27PM +1100, Paul Mackerras wrote: Implicit in this is that the regions of the address space that are protected are switched to use 4k hardware pages rather than 64k hardware pages (on machines with hardware 64k page support). In fact the whole process is switched

Re: [RFC][POWERPC] Provide a way to protect 4k subpages when using 64k pages

2007-12-11 Thread Arnd Bergmann
On Tuesday 11 December 2007, Christoph Hellwig wrote: Using 4k pages should basically be a pre-process flag (which it already is as an implementation detail in your patch), and thus the proper way to mark it should be a personality flag.  This also means it could be implied by certain

Re: [RFC][POWERPC] Provide a way to protect 4k subpages when using 64k pages

2007-12-11 Thread Paul Mackerras
Christoph Hellwig writes: As Arnd said reusing an old system call slot seems rather dangerous, I'd rather avoid it. Sure. I don't mind allocating a new syscall for this. But I wonder whether we really need a new syscall. Using 4k pages should basically be a pre-process flag (which it

Re: [RFC][POWERPC] Provide a way to protect 4k subpages when using 64k pages

2007-12-11 Thread Benjamin Herrenschmidt
On Tue, 2007-12-11 at 16:53 +0100, Christoph Hellwig wrote: All these process would use plain mmap/ mprotect to deal with the subpage protections. That seems very hard to do ... all of the generic code here only knows about the base page size, so except if we're going to fully re-implement the

Re: [RFC][POWERPC] Provide a way to protect 4k subpages when using 64k pages

2007-12-07 Thread Arnd Bergmann
On Friday 07 December 2007, Paul Mackerras wrote: > I have re-purposed the ioperm system call for this.  The old ioperm > system call never did anything (except return an ENOSYS error) and in > fact never could have actually been useful for anything on the PowerPC > architecture, so nothing ever

Re: [RFC][POWERPC] Provide a way to protect 4k subpages when using 64k pages

2007-12-07 Thread Arnd Bergmann
On Friday 07 December 2007, Paul Mackerras wrote: I have re-purposed the ioperm system call for this.  The old ioperm system call never did anything (except return an ENOSYS error) and in fact never could have actually been useful for anything on the PowerPC architecture, so nothing ever used

[RFC][POWERPC] Provide a way to protect 4k subpages when using 64k pages

2007-12-06 Thread Paul Mackerras
Using 64k pages on 64-bit PowerPC systems makes life difficult for emulators that are trying to emulate an ISA, such as x86, which use a smaller page size, since the emulator can no longer use the MMU and the normal system calls for controlling page protections. Of course, the emulator can

[RFC][POWERPC] Provide a way to protect 4k subpages when using 64k pages

2007-12-06 Thread Paul Mackerras
Using 64k pages on 64-bit PowerPC systems makes life difficult for emulators that are trying to emulate an ISA, such as x86, which use a smaller page size, since the emulator can no longer use the MMU and the normal system calls for controlling page protections. Of course, the emulator can