Virtual address allocator in 64bit kernel
Posted: Thu Apr 20, 2023 9:12 pm
Is it necessary to implement a virtual address (or virtual space) allocator in a 64bit kernel?
When in the 32bit kennel, there are usually not enough virtual space to identically (offset) mapping the whole physical address space. And when kernel wants to access the physical memory where is not identically mapped to the kernel's virtual address space, it requests the kernel to find a free virtual address space to temporarily map that physical space.
In this way, there should be a virtual address allocator in the kernel for allocating the free virtual address spaces and recycle them when they are not used any more.
While in the 64bit kernel, there are enough virtual space in the kernel for creating a whole permanent identical (offset) mapping to the physical space.
And now the kernel wants to access the physical memory, it can just request the physical frame allocator for the physical memory and caculate its virtual address in its virtual address space.
So I think there should be no need to write a virtual address allocator in the 64bit kernel. Is there something I get wrong or missed?
When in the 32bit kennel, there are usually not enough virtual space to identically (offset) mapping the whole physical address space. And when kernel wants to access the physical memory where is not identically mapped to the kernel's virtual address space, it requests the kernel to find a free virtual address space to temporarily map that physical space.
In this way, there should be a virtual address allocator in the kernel for allocating the free virtual address spaces and recycle them when they are not used any more.
While in the 64bit kernel, there are enough virtual space in the kernel for creating a whole permanent identical (offset) mapping to the physical space.
And now the kernel wants to access the physical memory, it can just request the physical frame allocator for the physical memory and caculate its virtual address in its virtual address space.
So I think there should be no need to write a virtual address allocator in the 64bit kernel. Is there something I get wrong or missed?