add smp-retry test for the AP wake retry path
Test hook forces the first wake to fail; the case asserts every core still comes online. Verified it fails when retry is disabled.
This commit is contained in:
@@ -72,6 +72,8 @@ pub fn run(case: []const u8, boot_info: *const BootInfo) void {
|
||||
smpTest();
|
||||
} else if (eql(case, "smp-stress")) {
|
||||
stressTest();
|
||||
} else if (eql(case, "smp-retry")) {
|
||||
smpRetryTest();
|
||||
} else if (eql(case, "fault-ud")) {
|
||||
faultInvalidOpcode();
|
||||
} else if (eql(case, "fault-pf")) {
|
||||
@@ -570,6 +572,20 @@ fn stressTest() void {
|
||||
result();
|
||||
}
|
||||
|
||||
/// Retry: `main` forced the first AP wake attempt to fail (arch.testFailNextWakes),
|
||||
/// so a core missed its first INIT-SIPI-SIPI. The boot retry must have brought it back
|
||||
/// anyway — every enumerated core should be online. If retry were broken, that core
|
||||
/// would be parked and the count would fall short.
|
||||
fn smpRetryTest() void {
|
||||
log("DANOS-TEST-BEGIN: smp-retry\n", .{});
|
||||
const total = platform.cpus().len;
|
||||
const online = sched.onlineCount();
|
||||
log("DANOS-RETRY: {d}/{d} cores online after a forced first-wake failure\n", .{ online, total });
|
||||
check("multiple cores enumerated (run with -smp)", total >= 2);
|
||||
check("retry brought every core online despite a failed first wake", online == total);
|
||||
result();
|
||||
}
|
||||
|
||||
fn faultInvalidOpcode() void {
|
||||
log("DANOS-TEST-BEGIN: fault-ud\n", .{});
|
||||
asm volatile ("ud2");
|
||||
|
||||
Reference in New Issue
Block a user