virtio-fs: wake the VMM when the guest reports an exit code#610
Open
yzewei wants to merge 1 commit intocontainers:mainfrom
Open
virtio-fs: wake the VMM when the guest reports an exit code#610yzewei wants to merge 1 commit intocontainers:mainfrom
yzewei wants to merge 1 commit intocontainers:mainfrom
Conversation
b2be1f2 to
3fa25a3
Compare
When a virtual machine (VM) passes its final exit status via the `KRUN_EXIT_CODE_IOCTL` function on the virtio-fs root filesystem, the host records it in the shared `exit_code` AtomicI32, but does not signal it to the VMM's `EventFd`. The VMM only stops when `exit_evt` becomes readable, so the VM's reported exit status itself does not wake up the `EventManager` and terminate the VM. This is a common bug in virtio-fs/VMM exit interactions, not a code path specific to any particular architecture (but the reset path on x86-64 i8042 is configured as a VMM exit event, masking the problem). User-visible symptoms depend on the architecture/platform: - On platforms without an equivalent rollback mechanism, or where the VM continues to perform reboot/shutdown processing after reporting the exit code, it may continue running even after reporting completion. We observed the latter scenario on LoongArch, where the virtual machine could continue to restart/shut down, eventually leading to a soft lock rather than the VMM exiting immediately. Signed-off-by: Zewei Yang <yangzewei@loongson.cn>
3fa25a3 to
36b3fe3
Compare
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.
When a virtual machine (VM) passes its final exit status via the
KRUN_EXIT_CODE_IOCTLfunction on the virtio-fs root filesystem, the host records it in the sharedexit_codeAtomicI32, but does not signal it to the VMM'sEventFd.The VMM only stops when
exit_evtbecomes readable, so the VM's reported exit status itself does not wake up theEventManagerand terminate the VM.This is a common bug in virtio-fs/VMM exit interactions, not a code path specific to any particular architecture (but the reset path on x86-64 i8042 is configured as a VMM exit event, masking the problem). User-visible symptoms depend on the architecture/platform:
We observed the latter scenario on LoongArch, where the virtual machine could continue to restart/shut down, eventually leading to a soft lock rather than the VMM exiting immediately.