2 ms·
> Once virtual addresses are enabled, they apply to all software running in the machine, including the kernel itself. Thus a portion of the virtual address spac
by xenadu02 10y ago
> Once virtual addresses are enabled, they apply to all software running in the machine, including the kernel itself. Thus a portion of the virtual address space must be reserved to the kernel
Reserving a portion of the address space for the kernel is a performance optimization and not necessarily required.
In 32-bit macOS the kernel has its own separate address space just like a process. Syscalls copy or map data in and out. The benefit is user mode processes can use all 4 GB. The obvious downside is the extra overhead and TLB flushes.
32/64-bit iOS and 64-bit macOS use the standard convention if having the kernel's address space mapped into all processes. Especially on 64-bit there is no benefit to doing otherwise.