本文将介绍Intel的IPIv(IPI Virtualization)硬件技术。

1. Previous software technology

软件方案终究不够完美,还是需要Intel推出硬件方案来解决该问题。

2. Motivation

Currently, issuing an IPI except self-ipi in guest on Intel CPU always causes a VM-exit. It can lead to non-negligible overhead to some workloads involving frequent IPIs when running in VMs.

IPI virtualization is a new VT-x feature, targeting to eliminate VM-exits on source vCPUs when issuing unicast, physical-addressing IPIs. Once it is enabled, the processor virtualizes following kinds of operations that send IPIs without causing VM-exits:

  • Memory-mapped ICR writes
  • MSR-mapped ICR writes
  • SENDUIPI execution

3. Spec

latest Intel Architecture Instruction Set Extensions Programming Reference

Idea:

  • The processor uses a data structure called the PID-pointer table. Each entry in the PID-pointer table contains the 64-bit physical address of a PID.
  • The processor indexes into a PID-pointer table using a virtual APIC ID

不是所有类型的IPI都可以利用IPIv的,只有满足一定条件时,硬件的IPIv才能生效,否则,依然需要发生VM Exit。

这也是为什么 IPI virtualization support for VM的cover letter中有这样的描述:when issuing unicast, physical-addressing IPIs. 像SIPI/NMI/INIT等IPI就不能使用IPIv。

4. Implementation

mailing patch: IPI virtualization support for VM
等以后IPIv feature upstream了再更新吧,说白了,patch的功能就是让硬件happy。