fix(amd64): do sti at another point

This commit is contained in:
Loïc Grégoire
2026-04-19 19:27:54 -04:00
parent bd60d727fb
commit 02fdb1313d
+4 -2
View File
@@ -77,12 +77,11 @@ fn early_cpu_init() linksection(r.init) void {
// Enable syscall if supported. // Enable syscall if supported.
efer.sce = f.syscall; efer.sce = f.syscall;
// Enable NX. // Enable NX.
efer.nxe = true; efer.nxe = true;
amd64.write_msr(.Efer, @bitCast(efer)); amd64.write_msr(.Efer, @bitCast(efer));
amd64.sti();
} }
pub fn ap_entry(cpu_id: u32, booted: *std.atomic.Value(usize)) noreturn { pub fn ap_entry(cpu_id: u32, booted: *std.atomic.Value(usize)) noreturn {
@@ -94,6 +93,8 @@ pub fn ap_entry(cpu_id: u32, booted: *std.atomic.Value(usize)) noreturn {
ki.sched.percpu.local().current_thread = pl.impl.smp.start_thread.local().*; ki.sched.percpu.local().current_thread = pl.impl.smp.start_thread.local().*;
amd64.sti();
_ = booted.fetchAdd(1, .monotonic); _ = booted.fetchAdd(1, .monotonic);
ke.ipl.lower(.Passive); ke.ipl.lower(.Passive);
@@ -115,4 +116,5 @@ pub fn early_init() linksection(r.init) void {
amd64.write_msr(.GsBase, 0); amd64.write_msr(.GsBase, 0);
int.init(); int.init();
amd64.sti();
} }