// This is required to enable syscall/sysret on x86_64 intel.
os::set_msr(0xC0000080, os::get_msr(0xC0000080) | (1 << 0));
os::set_msr(0xC0000081,
- (std::uint64_t(8 - 8 + 0b11) << 48) + // sysret_cs_and_ss (e.g., userspace segments)
- (std::uint64_t(24 - 8 + 0b00) << 32) + // syscall_cs_and_ss (e.g., kernelspace segments)
+ (std::uint64_t(24 - 8 + 0b11) << 48) + // sysret_cs_and_ss (e.g., userspace segments)
+ (std::uint64_t( 8 - 8 + 0b00) << 32) + // syscall_cs_and_ss (e.g., kernelspace segments)
std::uint64_t(0) // syscall_target_eip, only relevant to 32-bits so useless here
);
os::set_msr(0xC0000082, std::uint64_t(&syscall_64bit_handler)); // RIP for 64-bit program
} else {
os::current_pid = 0;
}
+ os::paging::load_pml4t(os::processes.get(os::current_pid).PML4T);
}
extern "C" void os::syscall_rax_error_handler() {