-
Notifications
You must be signed in to change notification settings - Fork 120
firmware_uefi: add diagnostics service for uefi logs #1209
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
base: main
Are you sure you want to change the base?
firmware_uefi: add diagnostics service for uefi logs #1209
Conversation
} | ||
|
||
/// Process the diagnostics buffer into friendly logs | ||
pub fn process_diagnostics( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to add a vmm_tests test for this, where we just see that uefi logged something? |
(GitHub is misbehaving, so I can't attach this to the I am violently against "validate" methods that check things and don't return a value.
In this case, I would suggest just getting rid of these validation functions and just putting the checks inline, next to the code that relies on the validation having been performed. |
Utf8Error(#[from] std::str::Utf8Error), | ||
|
||
#[error("Encountered arithmetic overflow: {0}")] | ||
Overflow(String), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No arbitrary strings in error types. Again, either use anyhow
or enumerate your error conditions.
vm/devices/firmware/firmware_uefi/src/service/nvram/spec_services/mod.rs
Outdated
Show resolved
Hide resolved
…on function for tracing
…improve errors v3 w/ anyhow
That's a good idea. I think these would be part of
|
…y exit if used_log_buffer_size is 0
use zerocopy::Immutable; | ||
use zerocopy::KnownLayout; | ||
|
||
// Advanced Logger Info signature |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use ///
doc comments here, please. Also, can we require doc comments?
This PR focuses on a new diagnostics service for firmware_uefi.
UEFI will write the GPA of the advanced logger buffer (which we formally call EFI Diagnostics here) to an Io port intercept called
SET_EFI_DIAGNOSTICS_GPA
.UEFI will also write to a different Io port intercept called
PROCESS_EFI_DIAGNOSTICS
, which signals us to process the EFI Diagnostics buffer.The diagnostics subsystem's role is to read into guest memory from the specified GPA, collect advanced logger entries and log them to our tracing facilities. This will get triggered by the following conditions:
PROCESS_EFI_DIAGNOSTICS
)PROCESS_EFI_DIAGNOSTICS
)