-
Notifications
You must be signed in to change notification settings - Fork 214
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
Fix the bootloader hanging during uefi exit_boot_services #457
base: main
Are you sure you want to change the base?
Changes from 1 commit
b8e2b9b
e41c6c1
0075368
034ddb6
1ef3241
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -95,8 +95,11 @@ where | |
use std::{ | ||
io::Read, | ||
process::{Command, Stdio}, | ||
time::Duration, | ||
}; | ||
|
||
use wait_timeout::ChildExt; | ||
|
||
const QEMU_ARGS: &[&str] = &[ | ||
"-device", | ||
"isa-debug-exit,iobase=0xf4,iosize=0x04", | ||
|
@@ -105,6 +108,8 @@ where | |
"-display", | ||
"none", | ||
"--no-reboot", | ||
"-smp", | ||
"8", | ||
]; | ||
|
||
const SEPARATOR: &str = "\n____________________________________\n"; | ||
|
@@ -138,10 +143,15 @@ where | |
) | ||
}); | ||
|
||
let exit_status = child.wait().unwrap(); | ||
let Some(exit_status) = child.wait_timeout(Duration::new(120, 0)).unwrap() else { | ||
child | ||
.kill() | ||
.expect("Qemu could not be killed after timeout"); | ||
panic!("Test timed out after 2 minutes"); | ||
}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rust's default test runner never times out. At worst it shows a warning after 60s. A timeout means that if you suspend the testing for longer than 120s using ctrl-z, you get an unnnecessary test failure. Also depending on how complex the tests of your OS are you may genuinely need more than 120s on low-end hardware. On local systems you can always kill the test manually and on CI there should be a timeout from the CI provider anyway. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't mind removing this. I don't think the crtl-z case is common, but maybe that just comes down to preference. I never use that myself. As for CI the timeout is 30minutes and that seems excessive. Especially when like here the CPU is maxed out by the hanging test.
That might actually explain the failing CI tests. So maybe I should remove this. |
||
match exit_status.code() { | ||
Some(33) => {} // success | ||
Some(35) => panic!("Test failed"), // success | ||
Some(33) => {} // success | ||
Some(35) => panic!("Test failed"), | ||
other => panic!("Test failed with unexpected exit code `{other:?}`"), | ||
} | ||
|
||
|
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.
Blog os at least doesn't support more than 1 core.
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.
Not sure why that matters here. This is just for the tests in this repo and has no impact on any kernel build with this bootloader. Also correct me if I am wrong but Blog Os should work fine on a multicore system. It will use just 1, but the other cores don't do anything unless specifically started by the kernel.