In the original and still most common usage, a virtual address is a number that a machine language program computes and uses to refer to memory. Unless the program is trusted or has been examined it must be assumed that the program might use any such number. A particular CPU in a computer system, at a particular instant, uses a memory map or address space that determines the real memory locations that a given virtual address refers to. Most address spaces exclude parts of real memory and such programs cannot read or write those parts. With conventional address map hardware the kernel defines the meaning of a suspect program’s address space so as to exclude storage of innocent bystanders. Typically all programs but the kernel are suspect. Programs and kernels are protected from other programs by arranging that protectees do not appear in the address space of untrusted programs. Each protection entity gets its own address space. The kernel is in charge of this arrangement and employs special memory map hardware that began to appear in computers first in about 1967.

“Virtual address” sometimes applies to another concept as well. In these contexts the program can generate arbitrary addresses but the use of certain such addresses is denied to some programs and not others. The IBM 360, without virtual storage and the 370 with, used storage protection keys which attached a 4 bit number to each real memory page. Extra memory hardware held these 4 bit keys. A 4 bit number was also attached to the process which limited which pages a process could write. Later modifications limited processes from even reading some pages. Some modern processors mark some virtual pages as supervisory and limit access thereto, to programs running in supervisor state.

Yet another usage of “virtual address” refers to the concatenation of some high order bits, called an ASID (Address Space ID) to the number computed by the user mode machine language program. The ASID is taken from a privileged register. This manner of speaking confuses some discussions but suggests profitable hardware and software ideas. Among these is hardware TLB tags that include the ASID. With this extra TLB cost it is usually unnecessary to purge the TLB upon switching address spaces (context switches). The idea of the TLB spanning the space of more than one program arose in the “STO STACK” of early 370’s but the new terminology suggested new tricks, I think. This terminology is only a manner of speaking—a particular use of the term virtual address.

Yet other systems allow user programs to generate arbitrary ASIDs, but include mechanisms to allow use of of such addresses depending on the user and the generated ASID. This is then similar to the 360s with their protection keys, but more general in that access permissions can be many (subjects) to many (objects).

I think the important distinction between the uses of “virtual address space” are whether:

These two ways of speaking may both be used to describe any of the modern commercial systems, except perhaps the AS-400.
Here is how most machines have defined virtual addresses.

In summary we record three notions of ‘virtual address’:

  1. With the help of hardware the kernel defines a different address space for each protection entity. A particular address, say 0x5000, refers to different real memory locations in different protection domains. Each such domain has its own virtual address space.
  2. A particular address always refers to the same location in RAM. Most protection domains find most addresses denied to them. Virtual addresses are said to be ‘global’ in such systems.
  3. The virtual address is a value (integer) whose high order bits are not produced by user program logic, but are instead found in a bank of kernel controlled registers which the kernel changes upon switches between protection domains.
There are two architectural schemes here and three notions of ‘virtual address’. Notions 1 and 3 may exist in the same machine and such architecture descriptions must find suitable distinct names for these two constructs. Any of these schemes allow for shared memory between protection domains. Here is another important distinction between mapping schemes.