background image

33-4 Vol. 3C

HANDLING BOUNDARY CONDITIONS IN A VIRTUAL MACHINE MONITOR

33.3.2 

Control of Platform Interrupts

To meet the interrupt virtualization requirements, the VMM needs to take ownership of the physical interrupts and 
the various interrupt controllers in the platform. VMM control of physical interrupts may be enabled through the 
host-control settings of the “external-interrupt exiting” VM-execution control. To take ownership of the platform 
interrupt controllers, the VMM needs to expose the virtual interrupt controller devices to the virtual machines and 
restrict guest access to the platform interrupt controllers. 
Intel 64 and IA-32 platforms can support three types of external interrupt control mechanisms: Programmable 
Interrupt Controllers (PIC), Advanced Programmable Interrupt Controllers (APIC), and Message Signaled Inter-
rupts (MSI). The following sections provide information on the virtualization of each of these mechanisms.

33.3.2.1   PIC Virtualization

Typical PIC-enabled platform implementations support dual 8259 interrupt controllers 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 (acti-
vate-I/O-bitmap bit in VM-execution control field set to 1) and pointing the I/O-bitmap physical addresses to valid 

Figure 33-1.  Host External Interrupts and Guest Virtual Interrupts

Device Driver B

Device Driver C

Virtual Device C

Emulation

Device Driver A

Monitor Handler

Host IDTR

Device A

Device B

Hardware

Platform  Interrupt

Platform  Interrupt

Virtual Machine Monitor (VMM)

Host IDT

Host

Hos

t

Ve

c

to

r X

Ve

c

to

r Y

Guest IDTR

Guest IDT

Guest

Vector P

VM

Virtual  Interrupt

Virtual  Interrupt

Guest

Vector Q

OM19041