Add translated embedder syscall hook#69
Open
doanbaotrung wants to merge 1 commit into
Open
Conversation
8d14f8a to
388b41f
Compare
Author
|
Hi @Max042004 |
jserv
reviewed
Jun 5, 2026
ba57d4e to
a9ff5d7
Compare
jserv
requested changes
Jun 5, 2026
Contributor
jserv
left a comment
There was a problem hiding this comment.
Check https://cbea.ms/git-commit/ carefully and enforce the rules for informative git commit messages.
You MUST address the motivations and considerations.
a9ff5d7 to
645a6e4
Compare
645a6e4 to
18ae471
Compare
jserv
reviewed
Jun 5, 2026
Translated x86_64 guests cannot issue the AArch64 HVC instruction used by the existing embedder extension ABI. This prevents those guests from using embedder-provided services such as the graphics bridge. Add a private elfuse pseudo-syscall as the translated guest counterpart to HVC 6. The syscall keeps the existing hvc6_handler ABI instead of adding a second embedder callback path, so native and translated guests can share the same dispatch logic. Use syscall number 999 as an internal ABI value between the translated guest shim and elfuse. This is not a Linux syscall number. It is chosen outside the current generic Linux syscall range to avoid colliding with normal guest syscalls, but it is not reserved by Linux and must remain private to elfuse. If no embedder handler is registered, dispatch falls back to normal syscall handling.
18ae471 to
262954b
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.
Translated x86_64 guests cannot issue the AArch64 HVC instruction used by the existing embedder extension ABI. This prevents those guests from using embedder-provided services such as the graphics bridge.
Add a private elfuse pseudo-syscall as the translated guest counterpart to HVC 6. The syscall keeps the existing hvc6_handler ABI instead of adding a second embedder callback path, so native and translated guests can share the same dispatch logic.
Use syscall number 999 as an internal ABI value between the translated guest shim and elfuse. This is not a Linux syscall number. It is chosen outside the current generic Linux syscall range to avoid colliding with normal guest syscalls, but it is not reserved by Linux and must remain private to elfuse.
If no embedder handler is registered, dispatch falls back to normal syscall handling.
Summary by cubic
Adds a private elfuse pseudo-syscall so translated x86_64 guests can call the embedder ABI equivalent to AArch64 HVC 6, enabling features like the graphics bridge. Reuses the existing hvc6_handler so native and translated guests share the same dispatch.
ELFUSE_NR_EMBEDDER_HVC6(999) as a private pseudo-syscall; not a Linux syscall.mk/config.mkand passes-DELFUSE_NR_EMBEDDER_HVC6=$(ELFUSE_NR_EMBEDDER_HVC6), allowing overrides.hvc6_handler. If no handler, falls back to normal syscall handling.Written for commit 262954b. Summary will update on new commits.