Page MenuHomeFreeBSD

bhyve: Resume is broken after 39ec056e6dbd 'vmm: Rework snapshotting ...'
ClosedPublic

Authored by gusev.vitaliy_gmail.com on Feb 9 2023, 11:21 PM.
Tags
Referenced Files
Unknown Object (File)
Oct 3 2024, 12:37 AM
Unknown Object (File)
Sep 27 2024, 1:10 AM
Unknown Object (File)
Sep 26 2024, 3:32 PM
Unknown Object (File)
Sep 25 2024, 5:18 PM
Unknown Object (File)
Sep 25 2024, 5:18 PM
Unknown Object (File)
Sep 25 2024, 5:18 PM
Unknown Object (File)
Sep 25 2024, 5:17 PM
Unknown Object (File)
Sep 25 2024, 5:17 PM

Details

Summary

vmx_snapshot() and svm_snapshot() do not save any data and error occurs at resume:

Restoring kernel structs...
vm_restore_kern_struct: Kernel struct size was 0 for: vmx
Failed to restore kernel structs.

Sponsored by: vStack

Test Plan

Perform Suspend/Resume, Resume previously saved snapshots. VM Ubuntu 22.04.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Feb 10 2023, 6:32 AM

The commit hash in the review title doesn't match anything in the src repo.

sys/amd64/vmm/amd/svm.c
2421

You still need this though don't you? This is why I didn't just remove the hook entirely.

gusev.vitaliy_gmail.com added inline comments.
sys/amd64/vmm/amd/svm.c
2421

This is no-op operation and I think added by mistake.

static __inline int
flush_by_asid(void)
{

        return (svm_feature & AMD_CPUID_SVM_FLUSH_BY_ASID);
}
sys/amd64/vmm/amd/svm.c
2421

Ah, ok. In that case, you should probably remove the vmx_snapshot and svm_snapshot methods and the slot for them in struct vmm_ops, etc. as well.

gusev.vitaliy_gmail.com marked an inline comment as done.
gusev.vitaliy_gmail.com retitled this revision from bhyve: Resume is broken after 9ec056e6dbd 'vmm: Rework snapshotting ...' to bhyve: Resume is broken after 39ec056e6dbd 'vmm: Rework snapshotting ...'.
This revision now requires review to proceed.Feb 10 2023, 6:37 PM

The commit hash in the review title doesn't match anything in the src repo.

Thanks, corrected.

sys/amd64/vmm/amd/svm.c
2421

I thought about it, but it will produce a lot of code that could add slowdown of a review process and to do more testing. But if you want I can do it.

sys/amd64/vmm/amd/svm.c
2421

@jhb Follow up nvlist changes for suspend/resume should clean it anyway.

@jhb Current things are good enough to proceed?

Removed "vmmops_snapshot" and related code.

@jhb Updated diff accordingly with your note.

This revision is now accepted and ready to land.Feb 17 2023, 6:16 AM
This revision was automatically updated to reflect the committed changes.