login
Header Space

 
 

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

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Christoph Hellwig <hch@...>
Cc: <linuxppc-dev@...>, <linux-kernel@...>
Date: Tuesday, December 11, 2007 - 5:37 pm

Christoph Hellwig writes:


Sure.  I don't mind allocating a new syscall for this.


Hmmm.  Ultimately I want to make it (the page size) be per-slice,
which shouldn't actually be particularly difficult.


The 32-bit PowerPC ABI explicitly says that the kernel can use any
power-of-2 page size between 4kB and 64kB, so I don't see any need to
do 4k emulation for 32-bit processes.


It would be lovely if the generic VM code could handle multiple page
sizes, but it can't at the moment.  So I assume that you are talking
about intercepting mmap, mprotect, etc. in the powerpc arch code and
emulating 4k-granularity mmap/mprotect/mremap/munmap etc. using 64k
anonymous pages plus some sort of internal subpage protection map.

The difference between that and my scheme is that that puts more of
the logic into the kernel rather than the emulator.  Since it is only
specialized programs (such as x86 emulators) that need to emulate
4k-granularity mappings, I'd rather put most of that logic in
userspace rather than the kernel, and just have the part that only the
kernel can do (the subpage protections) implemented in the kernel.
If there was a more general need for 4k-granularity mappings then I
would agree with you, but I don't see that need at present.


I don't see anything in arch/ia64/ia32/sys_ia32.c that can't be done
in userspace by an emulator.  As far as I can see, with that code, you
end up with the permissions on each ia64 page being the union of the
permissions on the 4k subpages, meaning that the program can access
subpages that it shouldn't really be able to access.  So I don't see
that sys_ia32.c addresses the problem that my patch is designed to
solve, namely, ensuring that an emulated program gets a SIGSEGV if it
tries to access subpages that it shouldn't be able to access.

Paul.
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [RFC][POWERPC] Provide a way to protect 4k subpages when..., Christoph Hellwig, (Tue Dec 11, 11:53 am)
Re: [RFC][POWERPC] Provide a way to protect 4k subpages when..., Benjamin Herrenschmidt, (Tue Dec 11, 7:38 pm)
Re: [RFC][POWERPC] Provide a way to protect 4k subpages when..., Paul Mackerras, (Tue Dec 11, 5:37 pm)
speck-geostationary