Skip to content

aws-nitro: Separate guest kernel module loading, updates#549

Merged
tylerfanelli merged 4 commits intocontainers:mainfrom
tylerfanelli:awsnitro-init-modules
Feb 25, 2026
Merged

aws-nitro: Separate guest kernel module loading, updates#549
tylerfanelli merged 4 commits intocontainers:mainfrom
tylerfanelli:awsnitro-init-modules

Conversation

@tylerfanelli
Copy link
Member

No description provided.

@tylerfanelli
Copy link
Member Author

cc @jakecorrenti

@slp
Copy link
Collaborator

slp commented Feb 18, 2026

/gemini

@slp
Copy link
Collaborator

slp commented Feb 18, 2026

/gemini review

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

The pull request refactors the kernel module loading mechanism by introducing a new mod.c file and separating debug output handling from application output. The debug flag has been consistently renamed to app_output across the C and Rust codebases, improving clarity. The changes also include an optimization to strip symbols from the aws-nitro init binary and a new feature to stream debug output from the serial console. Overall, the changes enhance modularity, clarify intent, and improve the build process.

Copy link
Collaborator

@mz-pdm mz-pdm left a comment

Choose a reason for hiding this comment

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

The first two commits look fine to me, some comments to the other two.
(BTW I think it would be easier to handle it if different PRs were used for completely unrelated changes.)

Copy link
Member

@jakecorrenti jakecorrenti left a comment

Choose a reason for hiding this comment

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

I find the change from debug -> app_output a little confusing. The output from the application should always be present, and specifying debug was specifically to determine whether we should include the dmesg output. Conditionally, reading it as "if we're not in debug mode, do this..." made more sense to me than "if we want app output (which is functionally always true), do this". If I'm in the minority on that I'm not going to block it from going in as is.

@tylerfanelli
Copy link
Member Author

I find the change from debug -> app_output a little confusing. The output from the application should always be present, and specifying debug was specifically to determine whether we should include the dmesg output. Conditionally, reading it as "if we're not in debug mode, do this..." made more sense to me than "if we want app output (which is functionally always true), do this". If I'm in the minority on that I'm not going to block it from going in as is.

The problem is that debug output needed to be printed earlier, and couldn't be a part of the normal proxy list, as if there's a problem we need to see debug output to find out where. We were unable to do this before because of all other proxies requiring initialization before debug out was viewable.

Nitro enclaves do not allow user input, so it remains unclear if
debugging the init binary would be possible. Strip debug symbols to
shrink the binary size.

Signed-off-by: Tyler Fanelli <tfanelli@redhat.com>
Signed-off-by: Tyler Fanelli <tfanelli@redhat.com>
Start the debug output proxy immediately after the enclave has booted
(if debug mode is enabled).

Change the debug enclave argument to instead represent enabling
application output, as nothing has to be done by the enclave VM if debug
output is enabled. In this case, output will be printed to the console,
which libkrun will already be connected to and forwarding data to/from.

Signed-off-by: Tyler Fanelli <tfanelli@redhat.com>
The krun-nitro-eif-ctl tool allows users to configure the kernel modules
loaded within their enclave. This is done through a directory
`/krun_linux_mods` in the initrd. Read this directory and load each
module into the enclave kernel within the bootstrap process.

Signed-off-by: Tyler Fanelli <tfanelli@redhat.com>
Copy link
Collaborator

@mz-pdm mz-pdm left a comment

Choose a reason for hiding this comment

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

Thank you for the updates, it's good from my side now.

@jakecorrenti
Copy link
Member

I find the change from debug -> app_output a little confusing. The output from the application should always be present, and specifying debug was specifically to determine whether we should include the dmesg output. Conditionally, reading it as "if we're not in debug mode, do this..." made more sense to me than "if we want app output (which is functionally always true), do this". If I'm in the minority on that I'm not going to block it from going in as is.

The problem is that debug output needed to be printed earlier, and couldn't be a part of the normal proxy list, as if there's a problem we need to see debug output to find out where. We were unable to do this before because of all other proxies requiring initialization before debug out was viewable.

The logic behind the change makes sense, I was just commenting on the name change being confusing to me.

@tylerfanelli tylerfanelli merged commit 9b7c6cb into containers:main Feb 25, 2026
11 checks passed
@tylerfanelli tylerfanelli deleted the awsnitro-init-modules branch February 26, 2026 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants