fix(x86_64): serialize full KVM custom MSR range for snapshot#5738
fix(x86_64): serialize full KVM custom MSR range for snapshot#5738joy-allen wants to merge 1 commit intofirecracker-microvm:mainfrom
Conversation
42703eb to
73b5e34
Compare
|
Hi @Manciukic @zulinx86 , |
|
Hey @joy-allen, thanks for the contribution! We will take a deeper look in the next days. In the meantime, it would be helpful if you could provide some additional information. |
KVM reserves the range 0x4b564d00-0x4b564dff for custom MSRs. The current snapshot implementation only serializes a small subset of these MSRs, which risks missing newly introduced KVM features. Some MSRs are already absent from the list (e.g. MSR_KVM_ASYNC_PF_INT and MSR_KVM_ASYNC_PF_ACK). Replace the individual MSR entries with a single range covering the full KVM custom MSR space so that all KVM-defined MSRs are included during snapshot serialization. Signed-off-by: Zhiheng Tao <junchuan.tzh@antgroup.com>
73b5e34 to
a2fb3b3
Compare
Hi @Manciukic , thanks for taking a look and for the questions. This PR is motivated by two concrete issues I encountered with Dragonball/Firecracker save/restore:
While these two cases could be fixed by explicitly adding only the APF and PVM MSRs, this PR takes a slightly more general approach by serializing the MSRs exposed by KVM to the guest. The intention is to avoid similar issues when new virtualization features introduce additional MSRs. More generally, the goal is to keep snapshot/restore aligned with the principle that guest-visible CPU state should be preserved across save/restore. Regarding MSRs such as APF INT/ACK: these are part of the vCPU state exposed by KVM, and KVM allows reading and writing them through the existing MSR APIs. In testing on Linux 5.10, restoring these values worked correctly and allowed the guest to resume. Please let me know if more details or testing results would be helpful. |
Changes
Replace the individual MSR entries with a single range covering the full KVM custom MSR space so that all KVM-defined MSRs are included during snapshot serialization.
Reason
KVM reserves the range 0x4b564d00-0x4b564dff for custom MSRs. The current snapshot implementation only serializes a small subset of these MSRs, which risks missing newly introduced KVM features. Some MSRs are already absent from the list (e.g. MSR_KVM_ASYNC_PF_INT and MSR_KVM_ASYNC_PF_ACK).
License Acceptance
By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license. For more information on following Developer
Certificate of Origin and signing off your commits, please check
CONTRIBUTING.md.PR Checklist
tools/devtool checkbuild --allto verify that the PR passesbuild checks on all supported architectures.
tools/devtool checkstyleto verify that the PR passes theautomated style checks.
how they are solving the problem in a clear and encompassing way.
in the PR.
CHANGELOG.md.Runbook for Firecracker API changes.
integration tests.
TODO.rust-vmm.