Skip to content

Conversation

@dblnz
Copy link
Contributor

@dblnz dblnz commented Jul 30, 2025

Description

When running with tracing enabled, hyperlight returns mem_mgr not initialized error.

This is because to call the initialise API on a Hypervisor, and avoid the borrowing conflicts, we take mem_mgr from an option and put it back after the call finalizes.
However, when the guest exits for a IO/MMIO operation, the handle_io method checks for the mem_mgr before taking it, which will be None in this case and fail.

Fix

Avoid providing a reference to mem_mgr to the handle_mem_access function, and do that through the Hypervisor reference we already have in that place.
Caveat: The takeing and putting back of mem_mgr in handle_io still remains because handle_outb function takes mutable references to both mem_mgr and Hypervisor at the same time

@dblnz dblnz self-assigned this Jul 30, 2025
@dblnz dblnz added the kind/bugfix For PRs that fix bugs label Jul 30, 2025
@dblnz dblnz force-pushed the fix-mem-mgr-not-initialized branch from 06852fa to 03cda9d Compare July 30, 2025 18:22
@dblnz dblnz force-pushed the fix-mem-mgr-not-initialized branch from 03cda9d to a32e8b4 Compare July 30, 2025 18:51
@dblnz dblnz merged commit a32e8b4 into hyperlight-dev:main Jul 30, 2025
33 checks passed
@dblnz dblnz deleted the fix-mem-mgr-not-initialized branch July 30, 2025 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bugfix For PRs that fix bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants