efi: Implement reset_system for Cloud Hypervisor#423
Closed
CMGS wants to merge 1 commit intocloud-hypervisor:mainfrom
Closed
efi: Implement reset_system for Cloud Hypervisor#423CMGS wants to merge 1 commit intocloud-hypervisor:mainfrom
CMGS wants to merge 1 commit intocloud-hypervisor:mainfrom
Conversation
Contributor
|
Thank you for the finding and the fix! It would be nice if the build passes on other architectures. |
The ResetSystem runtime service was intentionally left as a no-op to force Linux to use ACPI for shutdown. However, Windows calls ResetSystem(EfiResetShutdown) as its final shutdown step and does not fall back to ACPI when the call returns. This causes the Cloud Hypervisor process to hang indefinitely after Windows shuts down. Write the appropriate value to Cloud Hypervisor's shutdown I/O port (0x600) based on the reset type: - EfiResetShutdown: SLP_TYP=5 + SLP_EN (triggers VM exit) - EfiResetCold/Warm: reboot value (triggers VM reset) Linux guests are unaffected as they use ACPI directly. Fixes: cloud-hypervisor#422 Signed-off-by: CMGS <ilskdw@gmail.com>
Author
|
sorry, move proj from my personal repo to org cuz head ref missing, i got to close this PR and open new one for CI testing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implement the EFI
ResetSystemruntime service to write to Cloud Hypervisor'sAcpiShutdownDeviceI/O port (0x600).The function was intentionally left as a no-op to force Linux to use ACPI for shutdown. Linux does fall back correctly, but Windows calls
ResetSystem(EfiResetShutdown)as its final shutdown step and does not fall back to ACPI. This causes the Cloud Hypervisor process to hang indefinitely after a Windows guest shuts down.Changes
EfiResetShutdown: write0x34(SLP_TYP=5, SLP_EN=1) to port0x600, triggering a clean VM exit
EfiResetCold/EfiResetWarm: write0x01to port 0x600,triggering a VM reset
Test results
shutdown /s /t 0Linux guests are unaffected as they use ACPI directly for shutdown.
Fixes: #422
Signed-off-by: CMGS ilskdw@gmail.com