Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workaround OS X ACPI crash on suspend/resume #7

Merged
merged 1 commit into from
May 3, 2016
Merged

Workaround OS X ACPI crash on suspend/resume #7

merged 1 commit into from
May 3, 2016

Conversation

ijc
Copy link
Collaborator

@ijc ijc commented May 3, 2016

This may fix/avoid the OSX ACPI/Hypervisor framework crash issue without
rebooting the VM. I've run it overnight on two laptops with 10.11.2 and 10.11.3
without any crashes and tested it 10+ times with short hibernation timeouts and
sleep/wakeup. However, since we don't have a test that can reproduce this issue
all the time it needs testing on more systems to be sure that it actually
works.

Freeze is implemented by adding a condition variable in the hv_vcpu_run
interrupt loop, which each vcpu thread will wait on if SIGUSR1 has been
received. Before waiting the vcpu is set to a frozen state and memory is
protected by setting it -rwx. The memory protection may not be necessary, but
I'm hoping it will give us a better error message if the crash happens again.
The theads are resumed on SIGUSR2.

This currently requires an external agent to send the SIGUSR{1,2} upon
{suspend,resume}. Perhaps an event listening for power events should be used
instead.

Signed-off-by: Magnus Skjegstad magnus@skjegstad.com

This may fix/avoid the OSX ACPI/Hypervisor framework crash issue without
rebooting the VM. I've run it overnight on two laptops with 10.11.2 and 10.11.3
without any crashes and tested it 10+ times with short hibernation timeouts and
sleep/wakeup. However, since we don't have a test that can reproduce this issue
all the time it needs testing on more systems to be sure that it actually
works.

Freeze is implemented by adding a condition variable in the hv_vcpu_run
interrupt loop, which each vcpu thread will wait on if SIGUSR1 has been
received. Before waiting the vcpu is set to a frozen state and memory is
protected by setting it -rwx. The memory protection may not be necessary, but
I'm hoping it will give us a better error message if the crash happens again.
The theads are resumed on SIGUSR2.

This currently requires an external agent to send the SIGUSR{1,2} upon
{suspend,resume}. Perhaps an event listening for power events should be used
instead.

Signed-off-by: Magnus Skjegstad <magnus@skjegstad.com>
@ijc ijc merged commit 608198e into moby:master May 3, 2016
@ijc ijc deleted the suspend-acpi-bug branch May 3, 2016 09:57
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.

None yet

2 participants