vmm: Testing a vmm patch to support suspend/resume without kldunload #108
MegaManSec
started this conversation in
General
Replies: 2 comments
-
Nice! I cannot find your patch though. Could you please help me finding it? |
Beta Was this translation helpful? Give feedback.
0 replies
-
Attached. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all,
I have been debugging the issue related to vmm needing to be unloaded in order to suspend some systems.
I believe I've found the issue. When the system is resumed, vmm will use the vmxon instruction for any CPUs which have previously had vmx enabled: https://github.com/freebsd/freebsd-src/blob/abdc7bb79635d1d680053bb2bc73128e15cbb14a/sys/amd64/vmm/intel/vmx.c#L651
The problem is that the vmxoff instruction is never called on a suspension, meaning vmxon is called on already-on regions. This double-vmxon leads to undefined behavior (total system freeze in my case).
I have written a small patch to call vmx_disable() on suspension, which ensures that the vmxoff instruction has been called. vmx_enable() is then called on resume.
On my system, this patch works completely: i can suspend/resume with vmm loaded, and I can even suspend/resume with wifibox running.
However, I can't test it it all works while the wifi device is in use. Due to #60 (comment) before I suspend, I need to remove the device from the VM.
I would like to ask if others can test whether this patch:
Based on #2, I would like to know if the wifi continues to work on resume.
Note: I am using
RECOVERY_METHOD=
aka NONE.Attached is the kernel patch. I have only tested it with an Intel system. YMMV.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions