Intel 64 and IA-32 Architectures Software Developers Manual Volume 3B, System Programming Guide Part 2

Table Of Contents
28-6 Vol. 3
HANDLING BOUNDARY CONDITIONS IN A VIRTUAL MACHINE MONITOR
Interrupt Controllers (APIC), and Message Signaled Interrupts (MSI). The following
sections provide information on the virtualization of each of these mechanisms.
28.3.2.1 PIC Virtualization
Typical PIC-enabled platform implementations support dual 8259 interrupt control-
lers cascaded as master and slave controllers. They supporting up to 15 possible
interrupt inputs. The 8259 controllers are programmed through initialization
command words (ICWx) and operation command words (OCWx) accessed through
specific I/O ports. The various interrupt line states are captured in the PIC through
interrupt requests, interrupt service routines and interrupt mask registers.
Guest access to the PIC I/O ports can be restricted by activating I/O bitmaps in the
guest controlling-VMCS (activate-I/O-bitmap bit in VM-execution control field set
to 1) and pointing the I/O-bitmap physical addresses to valid bitmap regions. Bits
corresponding to the PIC I/O ports can be cleared to cause a VM exit on guest access
to these ports.
If the VMM is not supporting direct access to any I/O ports from a guest, it can set the
unconditional-I/O-exiting in the VM-execution control field instead of activating I/O
bitmaps. The exit-reason field in VM-exit information allows identification of VM exits
due to I/O access and can provide an exit-qualification to identify details about the
guest I/O operation that caused the VM exit.
The VMM PIC virtualization needs to emulate the platform PIC functionality including
interrupt priority, mask, request and service states, and specific guest programmed
modes of PIC operation.
28.3.2.2 xAPIC Virtualization
Most modern Intel 64 and IA-32 platforms include support for an APIC. While the
standard PIC is intended for use on uniprocessor systems, APIC can be used in either
uniprocessor or multi-processor systems.
APIC based interrupt control consists of two physical components: the interrupt
acceptance unit (Local APIC) which is integrated with the processor, and the interrupt
delivery unit (I/O APIC) which is part of the I/O subsystem. APIC virtualization
involves protecting the platform’s local and I/O APICs and emulating them for the
guest.
28.3.2.3 Local APIC Virtualization
The local APIC is responsible for the local interrupt sources, interrupt acceptance,
dispensing interrupts to the logical processor, and generating inter-processor inter-
rupts. Software interacts with the local APIC by reading and writing its memory-
mapped registers residing within a 4-KByte uncached memory region with base
address stored in the IA32_APIC_BASE MSR. Since the local APIC registers are
memory-mapped, the VMM can utilize memory virtualization techniques (such as