-
Notifications
You must be signed in to change notification settings - Fork 34
fixes to run on spike #335
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
Conversation
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.
Pull Request Overview
This PR makes modifications to enable salus to run on spike in addition to qemu by adjusting error handling and validation logic in several components.
- In src/main.rs, the UART probe now logs errors instead of propagating them, potentially affecting console initialization.
- In page-tracking, error variants are updated to include additional contextual information.
- In IMSIC-related code, new error variants are added and the MMIO region validations are adjusted for improved error reporting.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/main.rs | Changed UART probe error handling from propagating errors to logging the error. |
| page-tracking/src/page_tracker.rs | Updated PageMapNoSpace to include a u64 value. |
| page-tracking/src/page_info.rs | Updated error propagation to pass the page_map_size to the new PageMapNoSpace variant. |
| drivers/src/imsic/error.rs | Added new error variants with improved descriptions; note spelling correction needed. |
| drivers/src/imsic/core.rs | Modified MMIO region validation logic and error reporting for IMSIC configuration. |
Comments suppressed due to low confidence (3)
src/main.rs:481
- Switching from error propagation to merely logging the error during UART initialization may result in the system console not being properly set up; please confirm that this behavior is intentional.
if let Err(e) = UartDriver::probe_from(&hyp_dt, &mut mem_map) {
drivers/src/imsic/core.rs:366
- [nitpick] Review the updated condition for checking the MMIO region size; replacing a misalignment check with a minimum size check may not fully capture the intended validation.
if region_size < guests_per_hart as u64 * PageSize::Size4k as u64 {
drivers/src/imsic/core.rs:369
- [nitpick] Ensure that forcing a minimum count of 1 hart in the region using 'max' is safe and that it does not mask potential configuration issues with region sizes.
let harts_in_region = core::cmp::max(region_size / per_hart_size, 1);
Use a different error for different failure cases. Signed-off-by: Dylan Reid <[email protected]>
If m-mode interrupt files are interleaved with S and guest files, then the device tree may report holes in the reg map for the imsics, with each cpu's files separated by a missing page. Secondary reg regions will have non-zero hart ids, so remove the check that all regions are for hart 0. Similarly the per_hart_size is more of a stride and it's possible to have less than that size in each region. Signed-off-by: Dylan Reid <[email protected]>
Having the amount of space needed available makes debugging more convenient. Signed-off-by: Dylan Reid <[email protected]>
937ec06 to
254ca52
Compare
atishp04
left a comment
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.
What do you mean by this UART ? The default UART device in virt machine that salus parses from DT ? We rely only on DBCN to run things on spike/hw for now.
May be just clarify the commit message ?
atishp04
left a comment
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.
Other than that, LGTM.
The UART driver supports only the 16550a that is only available on QEMU. Print an error but continue so salus can run on spike and HW. Signed-off-by: Dylan Reid <[email protected]>
254ca52 to
4a78ce6
Compare
some useful changes that allow salus to run on spike in addition to qemu.