Skip to content

feat(vmm-tests): add per-test Linux kernel version selection#3586

Open
moor-coding wants to merge 1 commit into
microsoft:mainfrom
moor-coding:per-test-kernel-version
Open

feat(vmm-tests): add per-test Linux kernel version selection#3586
moor-coding wants to merge 1 commit into
microsoft:mainfrom
moor-coding:per-test-kernel-version

Conversation

@moor-coding
Copy link
Copy Markdown
Contributor

Add infrastructure for tests to specify which Linux kernel version to use, enabling per-test kernel version pinning.

Changes

  • Add LinuxDirectKernelVersion enum to petri_artifacts_vmm_test with V6_1 and V6_18 variants
  • Add version-specific artifact IDs for kernel and vmlinux (LINUX_DIRECT_TEST_KERNEL_X64_6_1, etc.)
  • Add linux_direct_with_version() and linux_direct_bzimage_with_version() methods to petri VM builder
  • Extend #[vmm_test] macro to accept parenthesized kernel version syntax: linux_direct_x64(kernel_6_1)
  • Update flowey to download all registered kernel versions and place them at versioned paths
  • Add Linux6_18 variant to LinuxTestKernelVersion in flowey resolver

Motivation

The upcoming openvmm-deps 0.3.0-33 release adds Linux 6.18 kernel support. Some tests (e.g., pcie_devices) cannot run on 6.18 due to a known kernel bug in mana_gd_probe. This PR adds the ability to pin individual tests to a specific kernel version, so the default can be upgraded to 6.18 while problematic tests remain on 6.1.

A follow-up PR will flip the default kernel to 6.18 and pin pcie_devices to 6.1.

Usage

Tests can now specify a kernel version in the #[vmm_test] attribute:

#[vmm_test(linux_direct_x64(kernel_6_1))]
async fn my_test(config: PetriVmBuilder<PetriVmmHvLite>) -> anyhow::Result<()> {
    // runs with 6.1 kernel specifically
}

Unversioned linux_direct_x64 continues to use the default kernel version (currently 6.1).

Add infrastructure for individual VMM tests to specify which Linux
kernel version to use via the test macro syntax:

  #[openvmm_test(linux_direct_x64)]             // default kernel
  #[openvmm_test(linux_direct_x64(kernel_6_1))] // explicit 6.1
  #[openvmm_test(linux_direct_x64(kernel_6_18))]// explicit 6.18

Changes across all layers:

- petri_artifacts_vmm_test: Add LinuxDirectKernelVersion enum and
  version-specific artifact IDs (LINUX_DIRECT_TEST_KERNEL_X64_6_1,
  _6_18, etc.) with IsLoadable impls

- petri_artifact_resolver_openvmm_known_paths: Map versioned artifact
  IDs to versioned paths (e.g. x64/6.1/vmlinux, x64/6.18/vmlinux)

- petri (Firmware): Add linux_direct_with_version() and
  linux_direct_bzimage_with_version() constructors that select
  version-specific kernel artifacts

- vmm_test_macros: Parse optional (kernel_6_1)/(kernel_6_18) after
  linux_direct_x64, linux_direct_aarch64, linux_direct_bzimage_x64,
  and openhcl_linux_direct_x64 tokens. Generate appropriate
  Firmware constructor calls in codegen.

- flowey (init_vmm_tests_env): Download all supported kernel versions
  and place them at both legacy paths and versioned subdirectories

- flowey (resolve_openvmm_test_linux_kernel): Add Linux6_18 variant
  to LinuxTestKernelVersion with ALL constant for iteration

Existing tests without a kernel version specifier continue to use the
default (unversioned) artifact IDs, preserving full backward
compatibility.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 28, 2026 18:33
@moor-coding moor-coding requested a review from a team as a code owner May 28, 2026 18:33
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@smalis-msft
Copy link
Copy Markdown
Contributor

This may be a maintainer question, but do we really want this functionality? Do we foresee a need to support more than one test kernel? I'd rather just do something like mark the one test unstable in order to update the test kernel to 6.18 everywhere, and then re stable it when a kernel fix is available.

@moor-coding
Copy link
Copy Markdown
Contributor Author

This may be a maintainer question, but do we really want this functionality? Do we foresee a need to support more than one test kernel? I'd rather just do something like mark the one test unstable in order to update the test kernel to 6.18 everywhere, and then re stable it when a kernel fix is available.

This change is coming from a discussion with @benhillis, I'm not sure of what the long-term outlook for the testing approach is at this moment so would love to get input from him

@benhillis
Copy link
Copy Markdown
Member

This may be a maintainer question, but do we really want this functionality? Do we foresee a need to support more than one test kernel? I'd rather just do something like mark the one test unstable in order to update the test kernel to 6.18 everywhere, and then re stable it when a kernel fix is available.

I wanted to discuss this yesterday in the maintainers sync but we didn't really have quorum. I don't think it would be a bad idea to have a number of different guest OS kernels, we do in Azure right?

@smalis-msft
Copy link
Copy Markdown
Contributor

I mean we do, but we probably get better coverage of those by including full linux distros, since distros may include their own patches or build configs different from ours. Linux direct testing is meant for simple quick validation.

@github-actions
Copy link
Copy Markdown

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.

4 participants