Chapter 29 APIC virtualization and virtual interrupts

Source: Internet
Author: User
Document directory
  • 33.3.1 Virtualization of interrupt vector space
  • 33.3.3 examples of handling of external interrupts
Chapter 29 APIC virtualization and virtual interrupts

Object:
The vmcs provided des controls that enable the virtualization of interrupts and the advanced programmable interrupt controller (APIC ).

Usage/means:
When these controls are used, the processor will emulate your accesses to the APIC, track the state of the virtual APIC, and deliver virtual interrupts-all in vmx non-root operation with out a VM exit.

Implementation:
The processor tracks the state of the virtual APIC using a virtual-APIC page identified by the virtual-Machine monitor (vmm ).

29.1 virtual APIC state

The Virtual-APIC page is a 4-kbyte region of memory that the processor uses the virtual-APIC page to virtualize certain accesses to APIC registers and to manage virtual interrupts. the physical address of the virtual-APIC page is the virtual-APIC address,
64-bit VM-execution control field in the vmcs

Virtualized APIC registers
 

Chapter 32 implements alization of system resources 32.3.1 processor operating modes & memory implements alization

To support guest real-mode execution, the vmm may establish a simple flat page table for guest linear to host physical address mapping.

Chapter 33 handling boundary conditions in a Virtual Machine monitor

 
Event injection. vmx operation allows injecting interruptions to a guest virtual machine through the use
VM-entry interrupt-Information Field in vmcs. injectable interruptions include external interrupts, NMI,
Processor exceptions, software generated interrupts, and software traps. If the interrupt-Information Field
Indicates a valid interrupt, exception or trap event upon the next VM entry; the processor will use
Information in the field to vector a virtual interruption through the guest IDT after all guest state and MSRs are
Loaded. delivery through the guest IDT emulates vectoring in non-vmx operation by doing the normal privilege
Checks and pushing appropriate entries to the guest stack (entries may include rflags, EIP and exception
Error Code). A vmm with Host Control of NMI and external interrupts can use the event-Injection Facility
Forward Virtual interruptions to various guest virtual machines.

33.2 interrupt handling in vmx operation

Control of external interrupts.
Vmx allows both host and guest control of external interrupts through
"External-interrupt exiting" VM execution control. If the control is 0, external-interrupts do not cause VM exits
And the interrupt delivery is masked by the guest programmed rflags. If value.
If the control is 1, external-interrupts causes VM exits and are not masked by rflags. If. The vmm can identify VM exits due to external
Interrupts by checking the exit reason for an "external interrupt" (value = 1 ).

33.3 External Interrupt implements alization

Vmx operation allows both host and guest control of external interrupts. While guest control of external interrupts
Might be suitable for partitioned usages (different CPU cores/threads and I/O devices partitioned to independent
Virtual machines), most vmms built upon vmx are expected to utilize Host Control of external interrupts.

With host control of external interrupts, The vmm (or the host OS in a hosted vmm model) manages the physical
Interrupt controllers in the platform and the interrupts generated through them. The vmm exposes software-
Emulated virtual interrupt controller devices (such as PIC and APIC) to each guest virtual machine instance.
Software Simulation pic, APIC

33.3.1 Virtualization of interrupt vector space

Interrupts from assigned physical devices: hardware support for I/O device assignment allows physical I/O
Devices in the host platform to be assigned (direct-mapped) to VMS. Guest vectors for interrupts from direct-
Mapped physical devices take up equivalent space from the host vector space, and require the vmm to perform
Host-vector to guest-vector mapping for interrupts.

33.3.3 examples of handling of external interrupts

The following sections strate interrupt processing in a vmm (when used to support the External Interrupt virtu-
Alization requirements ).

33.3.3.1 guest setup

The vmm sets up the guest to cause a VM exit to the vmm on external interrupts. This is done by setting
"External-interrupt exiting" VM-execution control in the guest controlling-vmcs.

33.3.3.2 processor treatment of External Interrupt

Interrupts are automatically masked by hardware in the processor on VM exit by clearing rflags. If.
The exit-reason field in vmcs is set to 1 to indicate an External Interrupt as the exit reason.

33.3.3.3 processing of external interrupts by vmm

Host owned I/O devices
Guest assigned I/O devices

33.3.3.4 generation of virtual interrupt events by vmm

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.