Re: i486 emu in mainline?

Helge Hafting
2004-05-23T11:47:29Z

On Sun, May 23, 2004 at 11:48:53AM +0200, Willy Tarreau wrote:
>
> You mean like when a user does a malloc() and the memory is not physically
> allocated because not used yet ? or even in case memory has been swapped
> out ? I believe I begin to understand, but the corner case is not really
> clear to me. It yet seems strange to me that the user can reference memory
> areas that the kernel cannot access.

The user referencing non-present memory is not a problem, because:
1. It is always pssoible to block the user process and let it wait
(a long time) for swapping to happen. That might not be an
option for the kernel - it can't wait while holding a
spinlock, for example.
2. It is always ok to kill the user process if it uses memory it
doesn't have. It is not ok to "kill" the kernel. The indirect ways
of using user memory from the kernel side ensures that the
normal mechanisms (swap-wait or kill) applies to the process owning
the memory. Direct reference from kernel does not invoke normal page
fault mechanisms when memory goes wrong.

Helge Hafting