Skip to content

Conversation

@syntactically
Copy link
Member

Fixes #666

Usually, an unknown HV message is the result of a double fault or
similar: something going wrong in the guest. This commit ensures that a
core file is generated when this happens and the crashdump feature is
enabled.

Signed-off-by: Lucy Menon <[email protected]>

[hyperlight_host] Expose MemoryRegion structure

It is a convenient tuple of information to use when mapping a new region
into the sandbox.

Signed-off-by: Lucy Menon <[email protected]>
@syntactically syntactically added kind/enhancement For PRs adding features, improving functionality, docs, tests, etc. area/performance Addresses performance labels Jul 8, 2025
@syntactically syntactically force-pushed the map-to-guest branch 4 times, most recently from 9cc2cff to 59b8c0c Compare July 8, 2025 10:53
Copy link
Contributor

@dblnz dblnz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work, @syntactically!
Overall it looks good to me, but I think someone with more expertise on the guest paging setup should have a look.

jprendes
jprendes previously approved these changes Jul 8, 2025
Copy link
Contributor

@jprendes jprendes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
Don't know if you want to wait for more reviews or not.
AFAICT this only adds functionality and doesn't change any existing behaviour, so I'm ok if you want to merge it.
It gives me confidence that all tests are passing :-)

Could you create an issue to add tests for it?

Because we don't presently switch stacks on interrupt entry, we cannot
support a red zone in the ABI. rustc's x86_64-unknown-none target
already does not use a redzone, but clang's x86_64-unknown-none-linux
target, which we use for compiling C code, does use a red zone by
default.  This commit modifies the clang options that we use to remove
uses of a red zone from generated code.

Signed-off-by: Lucy Menon <[email protected]>
Previously, we did remove the error code from the stack before
`iret`'ing, which resulted in the return failing.

Signed-off-by: Lucy Menon <[email protected]>
We unfortunately don't have a good way of making sure that code run in
exception contexts doesn't use floating point and SSE
instructions. This commit simply always saves and restores the
relevant registers as a workaround. We should at some point look into
the alternative of ensuring that simd instructions aren't used in code
reachable from an exception handler, and see if that actually improves
performance.

Signed-off-by: Lucy Menon <[email protected]>
This commit adds a simple mechanism for guests to register exception
handlers. It does not support any kind of chaining, so there can only be
one exception handler per exception per guest, which should probably be
improved in the future. This will be used in hyperlight-wasm shortly.

Signed-off-by: Lucy Menon <[email protected]>
Copy link
Contributor

@jprendes jprendes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@syntactically syntactically merged commit ea6fa8f into main Jul 8, 2025
32 checks passed
@syntactically syntactically deleted the map-to-guest branch July 8, 2025 16:54
Copy link
Contributor

@jsturtevant jsturtevant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to see some tests or examples to verify the use of this new functionality

@syntactically
Copy link
Member Author

syntactically commented Jul 8, 2025

It would be nice to see some tests or examples to verify the use of this new functionality

See #698, #699, and hyperlight-dev/hyperlight-wasm#102

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/performance Addresses performance kind/enhancement For PRs adding features, improving functionality, docs, tests, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for mapping a host memory region into a guest physical memory slot

6 participants