Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[interrupt-handlers] adding exception/interrupt handler support for hyperlight guest #250

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

danbugs
Copy link
Contributor

@danbugs danbugs commented Feb 8, 2025

// TODO: description

closes #228

…rrupt/exception handlers

- interrupt handler entry stubs =
-- global asm definitions for different _do_excp0-20 + _do_excp30 + hwint0-15
(which will prob. be unused for a while) via declarative macros
-- global asm definitions for context_save and context_restore to save registers before interrupt handling
- tmp interrupt/exception handlers that are used by the _do_excp* and hwint* fxns.

Notes:
(1) it's likely we won't use all exceptions/hw interrupts that I am creating externs for, they are all there mostly for completion.
(2) this is asm for 64-bit mode and follows sysv64 calling convention ABI.

Signed-off-by: danbugs <[email protected]>
- added IdtEntry structure (w/ some tmp hardcoded values in its new impl for now),
- created IDT static mut array, and
- made fxns to init_idt and set_idt_entry.

Signed-off-by: danbugs <[email protected]>
- made IDTR structure to house the IDT,
- made load_idt fxn that uses global_asm's lidt to load the IDT, and
- added fxn calls to entrypoint to init_idt and load_idt (location debatable?).

Signed-off-by: danbugs <[email protected]>
Note: temporarily modified hyperlight-host's hello-world example
to call dividebyzero for testing.

Signed-off-by: danbugs <[email protected]>
@danbugs danbugs added the kind/enhancement New feature or request label Feb 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement exception/interrupt handlers in hyperlight-guest
1 participant