3-12
Software Environment and Extensions
AMD-K5 Processor Technical Reference Manual
18524C/0—Nov1996
3.1.4
Virtual-8086 Mode Extensions (VME)
The Virtual-8086 Mode Extensions (VME) bit in CR4 (bit 0)
enables performance enhancements for 8086 programs run-
ning as protected tasks in Virtual-8086 mode. These extensions
include:
■
Virtualizing maskable external interrupt control and notifi-
cation via the VIF and VIP bits in EFLAGS
■
Selectively intercepting software interrupts (INTn instruc-
tions) via the Interrupt Redirection Bitmap (IRB) in the
Task State Segment (TSS)
Interrupt Redirection
in Virtual-8086 Mode
Without VME
Extensions
8086 programs expect to have full access to the interrupt flag
(IF) in the EFLAGS register, which enables maskable external
interrupts via the INTR signal. When 8086 programs run in Vir-
tual-8086 mode on a 386 or 486 processor, they run as pro-
tected tasks and access to the IF flag must be controlled by the
operating system on a task-by-task basis to prevent corruption
of system resources.
Without the VME extensions available on the AMD-K5 proces-
sor, the operating system controls Virtual-8086 mode access to
the IF flag by trapping instructions that can read or write this
flag. These instructions include STI, CLI, PUSHF, POPF, INTn,
and IRET. This method prevents changes to the real IF when
the I/O privilege level (IOPL) in EFLAGS is less than 3, the
privilege level at which all Virtual-8086 tasks run. The operat-
ing system maintains an image of the IF flag for each Virtual-
8086 program by emulating the instructions that read or write
IF. When an external maskable interrupt occurs, the operating
system checks the state of the IF image for the current Virtual-
8086 program to determine whether the program is allowing
interrupts. If the program has disabled interrupts, the operat-
ing system saves the interrupt information until the program
attempts to re-enable interrupts.
The overhead for trapping and emulating the instructions that
enable and disable interrupts, and the maintenance of virtual
interrupt flags for each Virtual-8086 program, can degrade the
processor’s performance. This performance can be regained by
running Virtual-8086 programs with IOPL set to 3, thus allow-
ing changes to the real IF flag from any privilege level, but
with a loss in protection.
Summary of Contents for AMD-K5
Page 1: ...AMD K5 Processor Technical Reference Manual TM...
Page 10: ...x AMD K5 Processor Technical Reference Manual 18524C 0 Nov1996...
Page 24: ...1 4 Overview AMD K5 Processor Technical Reference Manual 18524C 0 Nov1996...
Page 54: ...2 30 Internal Architecture AMD K5 Processor Technical Reference Manual 18524C 0 Nov1996...
Page 116: ...4 26 Performance AMD K5 Processor Technical Reference Manual 18524C 0 Nov1996...
Page 356: ...6 44 System Design AMD K5 Processor Technical Reference Manual 18524C 0 Nov1996...
Page 380: ...7 24 Test and Debug AMD K5 Processor Technical Reference Manual 18524C 0 Nov1996...
Page 396: ...A 16 AMD K5 Processor Technical Reference Manual 18524C 0 Nov1996...
Page 406: ...I 10 Index AMD K5 Processor Technical Reference Manual 18524C 0 Nov1996...