Skip to content

SNP: Secure AVIC support #1172

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 21 commits into
base: main
Choose a base branch
from
Draft

Conversation

romank-msft
Copy link
Contributor

@romank-msft romank-msft commented Apr 10, 2025

Enable secure AVIC support to offload interrupt state computation to the hardware to be fast and secure.

In AMD's own words:

"The Secure AVIC feature provides support for managing guest-owned APIC state for SEV-SNP guests using a private, guest-owned backing page per vCPU."
-- SEV-ES GHCB Standartizarion

"In a virtualized computer system, each guest operating system needs access to an interrupt controller to send and receive device and interprocessor interrupts. When there is no hardware acceleration, it falls to the virtual machine monitor (VMM) to intercept guest-initiated attempts to access the interrupt controller registers and provide direct emulation of the controller system programming interface allowing the guest to initiate and process interrupts. The VMM uses the underlying physical and virtual interrupt delivery mechanisms of the system to deliver interrupts from I/O devices and virtual processors to the target guest virtual processor and to handle any required end of interrupt processing.

Given the high rate of device and interprocessor interrupt generation in certain scenarios, in particular on server-class systems, the emulation of a local APIC can be a significant burden for the VMM. The AVIC architecture addresses the overhead of guest interrupt processing in a virtualized environment by applying hardware acceleration to the following components of interrupt processing:

  • Providing a guest operating system access to performance-critical interrupt controller registers
  • Initiating intra- and inter-processor interrupts (IPIs) in and between virtual processors in a guest"
    -- AMD64 PPR Vol. 3

Laundry list:

  • IGVM parameter for disabling secure AVIC (would someone like that for testing maybe??)
  • Definitions
  • High-level wiring
  • resolve TODOs in the IGVM file generator
  • Auto-enable secure AVIC in the boot shim (from the hw arch pov considered dicey, not doing that)
  • need the secure AVIC kernel patch (comes with kernel 6.12)
  • update the kernel interface to map the AVIC page
  • plumbing for (un)registering the backing page

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants