Repository navigation
kvm: mshv: Add vmm test cases to validate reset and fix for KVM on nested - #5085
Conversation
|
This PR modifies files containing For more on why we check whole files, instead of just diffs, check out the Rustonomicon |
c20a693 to
ff69425
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The test’s nested-virtualization requirement selects MSHV hosts without scrub support, causing reset failures unless selection is gated on nested-reset support or restricted to KVM.
1 open issue
What changed in this PR
Adds regression coverage for rebooting nested-enabled Linux guests and fixes KVM’s handling of nested virtualization state during reset.
Changes:
- Reset inactive VMX or SVM state through
KVM_SET_NESTED_STATE, with unit tests for the reset headers. - Add a two-CPU guest test that reboots three times and verifies connectivity, boot identity, and virtualization flags.
- Document how to run the test and the KVM/MSHV prerequisites.
| File | Description |
|---|---|
vmm_tests/vmm_tests/tests/tests/nested.rs |
Adds repeated reboot coverage for nested-enabled Linux guests. |
vmm_core/virt_kvm/src/arch/x86_64/vp_state.rs |
Handles empty nested state as a KVM reset request. |
vm/kvm/src/lib.rs |
Adds the nested-state reset ioctl wrapper, reset headers, and unit tests. |
Guide/src/dev_guide/tests/vmm.md |
Documents test execution, backend requirements, and coverage limits. |
Review effort: Balanced
5680d28 to
edfba77
Compare
There was a problem hiding this comment.
🔵 Needs a closer look
Vendor-specific KVM reset semantics and the new MSHV scrub probe require hardware-backed reboot and compatibility validation that was unavailable in this review.
No open issues 🎉
1 resolved since last review
Review effort: Balanced
| /// Reboot a two-VP Linux L1 three times with nesting enabled and VMBus disabled. | ||
| /// Check changed boot IDs, connectivity, and VMX/SVM exposure on both VPs. | ||
| /// This does not launch an L2; `reboot_l2` separately exercises an L2 reboot. | ||
| #[cfg(target_os = "linux")] |
There was a problem hiding this comment.
Why is this limited to Linux?
753b40a to
94cfd06
Compare
94cfd06 to
f074ec9
Compare
| } | ||
|
|
||
| /// Run the L2 test before and after an L1 reboot to exercise used nested state. | ||
| #[cfg(target_os = "linux")] |
There was a problem hiding this comment.
Still waiting for the Linux host cfgs to go away and for WHP to be tagged as supporting the new required feature.
27370c1 to
b29d023
Compare
|
The Linux host restrictions haven't been fully removed yet:
Could you finish removing these host restrictions and report nested-reset support appropriately for WHP? The Linux guest configurations and |
6440465 to
77e4116
Compare
Reset empty nested state with KVM_SET_NESTED_STATE for VMX and SVM. Keep nested save/restore unsupported. Add reset-header unit tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Muminul Islam <muminul.islam@microsoft.com>
Reboot a two-VP guest three times with nesting enabled. Check boot IDs, agent connectivity, and VMX/SVM flags. Document KVM/MSHV prerequisites. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Muminul Islam <muminul.islam@microsoft.com>
Probe MSHV partition scrub support and require nested_reset. Skip unsupported hosts while surfacing unexpected probe errors. Validated capability tests and KVM/MSHV guest reboots. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Muminul Islam <muminul.islam@microsoft.com>
Require KVM_CAP_NESTED_STATE before advertising nested_reset. Cover unsupported KVM hosts and preserve MSHV scrub gating. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Muminul Islam <muminul.islam@microsoft.com>
Simplify nested-reset discovery and keep backend probes infallible. Clarify reset-only state handling and trim redundant tests and docs. Add separate L2 reboot coverage using the nested test infrastructure. Validated all three reboot tests on KVM and MSHV. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Muminul Islam <muminul.islam@microsoft.com>
Run an L2 before and after rebooting L1 to exercise used nested state. Gate the L1 wrapper on nested-reset support and keep per-run logs. Validated all three nested reboot tests on KVM and MSHV. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Muminul Islam <muminul.islam@microsoft.com>
Remove the Linux-only guard from the nested-enabled reboot test. Note when the MSHV scrub capability probe can be removed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Muminul Islam <muminul.islam@microsoft.com>
Detect WHP nested reset support using WHvResetPartition availability. Make the reboot test platform independent. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Muminul Islam <muminul.islam@microsoft.com>
77e4116 to
6411587
Compare
bf35346
into
microsoft:main

Add a VMM test case for verifying reboot on Linux nested scenario and fix the reboot for KVM case.