mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 00:14:32 -08:00
[kernel] Make IDT per-cpu, not global
Since we modify IST entries while handling interrupts, the IDT cannot be a global data structure. Allocate new ones for each CPU.
This commit is contained in:
@@ -41,7 +41,7 @@ cpu_validate()
|
||||
void
|
||||
cpu_early_init(cpu_data *cpu)
|
||||
{
|
||||
IDT::get().install();
|
||||
cpu->idt->install();
|
||||
cpu->gdt->install();
|
||||
|
||||
// Install the GS base pointint to the cpu_data
|
||||
@@ -63,4 +63,6 @@ cpu_init(cpu_data *cpu, bool bsp)
|
||||
uint64_t pat = rdmsr(msr::ia32_pat);
|
||||
pat = (pat & 0x00ffffffffffffffull) | (0x01ull << 56); // set PAT 7 to WC
|
||||
wrmsr(msr::ia32_pat, pat);
|
||||
|
||||
cpu->idt->add_ist_entries();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user