Skip to content
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

Support for VMGenID device on x86 microVMs #4487

Merged
merged 8 commits into from
Apr 9, 2024

Commits on Apr 9, 2024

  1. refactor: avoid clones of GuestMemoryMmap when restoring MMIO devices

    Use a reference to the GuestMemoryMmap rather than the object itself
    when restoring MMIO devices. This will avoid us a few clone() operations
    later on when we add support for restoring VMGenID, where we will need
    to pass information about the memory as well.
    
    Signed-off-by: Babis Chalios <[email protected]>
    bchalios committed Apr 9, 2024
    Configuration menu
    Copy the full SHA
    a7fecbb View commit details
    Browse the repository at this point in the history
  2. acpi: add VMGenID support for x86_64

    Add support for the Virtual Machine Generation ID (VMGenID) device that
    allows notifying the guest about snapshot resume events. The device
    itself allocates one page of guest memory and an IRQ line. It stores a
    16 bytes cryptographically random number (generation ID) at the
    beginning of this page. Once the microVM resumes from a snapshot, it
    writes a new 16-byte generation ID and sends an interrupt to the device.
    
    Also add support for the Generic Event Device, an ACPI device which
    handles IRQ lines allocated to ACPI devices and routes them as
    ACPI notifications to the devices the belong to.
    
    VMGenID state is saved in Firecracker snapshots. This renders the
    current snapshot format incompatible with all previous snapshot
    versions. Bump snapshot version to 2.0.0 to reflect that.
    
    Signed-off-by: Babis Chalios <[email protected]>
    bchalios committed Apr 9, 2024
    Configuration menu
    Copy the full SHA
    e0f77d8 View commit details
    Browse the repository at this point in the history
  3. fix(test): set max device to 18 in test_max_devices

    We now reserve one IRQ for the VMGenID device, so we have one less IRQ
    available for VirtIO devices.
    
    Signed-off-by: Babis Chalios <[email protected]>
    bchalios committed Apr 9, 2024
    Configuration menu
    Copy the full SHA
    eaca56e View commit details
    Browse the repository at this point in the history
  4. test: allow using 6.1 kernel in selected tests

    At the moment, we filter out 6.1 guest kernel in all tests apart from
    PTP on Graviton. Add a new filter that allows select any kernel that
    exists in our CI artifacts folder and use it to create a pytest fixture
    for guest kernel 6.1, which works independently of the platform we run
    on.
    
    Signed-off-by: Babis Chalios <[email protected]>
    bchalios committed Apr 9, 2024
    Configuration menu
    Copy the full SHA
    c5a173d View commit details
    Browse the repository at this point in the history
  5. test(vmgenid): integration test for VMGenID kernel notification

    Add an integration test that launches a microVM, snapshots it repeatedly
    and checks for the existence of the message that the kernel emits every
    time it receives the VMGenID notification.
    
    Signed-off-by: Babis Chalios <[email protected]>
    bchalios committed Apr 9, 2024
    Configuration menu
    Copy the full SHA
    3d7d467 View commit details
    Browse the repository at this point in the history
  6. fix(test): wait for microVM to boot before snapshotting

    In test_vulnerabilities.py we have various tests that check whether a
    condition holds after resuming from a snapshot. These checks seem to
    consistently fail if we take a snapshot before letting the guest kernel
    boot.
    
    Introduce an ssh command to ensure that the guest has booted before
    taking the snapshot so that we avoid the issue.
    
    Signed-off-by: Babis Chalios <[email protected]>
    bchalios committed Apr 9, 2024
    Configuration menu
    Copy the full SHA
    81517c9 View commit details
    Browse the repository at this point in the history
  7. acpi: add documentation about VMGenID

    Extend our current documentation for snapshotting and entropy
    recommendations with context about VMGenID. Mention the available
    VMGenID features depending on Linux version and also provide
    recommendations for entropy on VM clones based on VMGenID availability.
    
    Also, add CHANGELOG entry for VMGenID support.
    
    Signed-off-by: Babis Chalios <[email protected]>
    bchalios committed Apr 9, 2024
    Configuration menu
    Copy the full SHA
    9f28ece View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    90db35b View commit details
    Browse the repository at this point in the history