5-2 Vol. 3A
PROTECTION
5.2
FIELDS AND FLAGS USED FOR SEGMENT-LEVEL AND
PAGE-LEVEL PROTECTION
The processor’s protection mechanism uses the following fields and flags in the system data structures to control
access to segments and pages:
•
Descriptor type (S) flag — (Bit 12 in the second doubleword of a segment descriptor.) Determines if the
segment descriptor is for a system segment or a code or data segment.
•
Type field — (Bits 8 through 11 in the second doubleword of a segment descriptor.) Determines the type of
code, data, or system segment.
•
Limit field — (Bits 0 through 15 of the first doubleword and bits 16 through 19 of the second doubleword of a
segment descriptor.) Determines the size of the segment, along with the G flag and E flag (for data segments).
•
G flag — (Bit 23 in the second doubleword of a segment descriptor.) Determines the size of the segment, along
with the limit field and E flag (for data segments).
•
E flag — (Bit 10 in the second doubleword of a data-segment descriptor.) Determines the size of the segment,
along with the limit field and G flag.
•
Descriptor privilege level (DPL) field — (Bits 13 and 14 in the second doubleword of a segment descriptor.)
Determines the privilege level of the segment.
•
Requested privilege level (RPL) field — (Bits 0 and 1 of any segment selector.) Specifies the requested
privilege level of a segment selector.
•
Current privilege level (CPL) field — (Bits 0 and 1 of the CS segment register.) Indicates the privilege level
of the currently executing program or procedure. The term current privilege level (CPL) refers to the setting of
this field.
•
User/supervisor (U/S) flag — (Bit 2 of paging-structure entries.) Determines the type of page: user or
supervisor.
•
Read/write (R/W) flag — (Bit 1 of paging-structure entries.) Determines the type of access allowed to a
page: read-only or read/write.
•
Execute-disable (XD) flag — (Bit 63 of certain paging-structure entries.) Determines the type of access
allowed to a page: executable or not-executable.
Figure 5-1 shows the location of the various fields and flags in the data-, code-, and system-segment descriptors;
Figure 3-6 shows the location of the RPL (or CPL) field in a segment selector (or the CS register); and Chapter 4
identifies the locations of the U/S, R/W, and XD flags in the paging-structure entries.