On Thu, 7 Nov 2002 10:46:30 -0600, Linas Vepstas <[EMAIL PROTECTED]>
wrote:

>On Wed, Nov 06, 2002 at 10:36:40AM +0800, John Summerfield was heard to remark:
>> On Wed, 6 Nov 2002 05:45, you wrote:
>>
>> >
>> > The core idea is actually so simple, its painful.  Today, most CPU's
>> > define two memory spaces: the one that the kernel lives in, and the
>> > one that the user-space lives in.  When properly designed, there is
>> > nothing a user-space program can do to corrupt kernel memory.  One
>> > 'switches' between these memory spaces by making system calls, i.e.
>> > by the SVC instruction.
>> >
>> > The 390 arch has not two, but 16 memory spaces (a 4-bit key) with
>> > this type of protection.  (When I did the i370 port, I put the
>> > kernel in space 0 or 1 or someething like that, and user space
>> > programs ran in one of the others.)  The partitioning between them
>> > is absolute, and is just like the kernel-space/user-space division
>> > in other archs.  The mechanism is independent/orthogonal to the
>> > VM/TLB subsystem (you can have/use virtual memory in any of the
>> > spaces.)

I'm coming late to the party, but this information should be
corrected. Th 4 bit key is not a "memory space" but an attribute of a
block of memory (4K or 2K) within a continous address space. The PSW
also contains a protect key and the CAW (Channel Address Word) two.
Key zero typically allows access to all memory. When a PSW is set to a
non-zero key, it can typically read any storage but it can only write
to its own key. [The storage key byte has other items like a read-only
bit.]

Thus the storage key allows for memory isolation between programs
running in the same address space, with key zero being used for the
supervisor. That was MVT/MFT days... Nowadays 2K storage keys have
vanished. In MVS, program isolation is by address space. Most of
kernel memory is shared with the application program space. Key 8 is
for programs and key zero is for kernel. Subsystems like VTAM can take
over a storage key. And of course there are all sorts of multi-address
space stuff now - access registers, primary/secondary address space
instructions, etc etc.

But the storage key was originally used for program isolation. It was
a pretty nice advance for its time.

john alvord

Reply via email to