Understanding the mapping of physical memory to kernel address space

Jeff Haran Jeff.Haran at citrix.com
Thu Mar 12 14:19:19 EDT 2015


-----Original Message-----
From: kernelnewbies-bounces at kernelnewbies.org [mailto:kernelnewbies-bounces at kernelnewbies.org] On Behalf Of Arun KS
Sent: Thursday, March 12, 2015 11:03 AM
To: Sunny Shah
Cc: kernelnewbies
Subject: Re: Understanding the mapping of physical memory to kernel address space

Hello Sunny,

On Thu, Mar 12, 2015 at 10:32 PM, Sunny Shah <shahsunny715 at gmail.com> wrote:
> Hello,
>
> This is my first mail on this list, so please let me know if I'm erring.
>
> I'm reading Bovet and Cesati's "Understanding the Linux Kernel", 
> specifically the chapter "Memory Addressing", sub-section "Kernel Page 
> Tables". Here they describe how Linux initializes its page tables for 
> various RAM sizes and how much of the physical address space is mapped 
> onto the kernel virtual address space.
>
> I have several questions from my reading:
>
> My understanding is that the 32 bit virtual address space of a process 
> is split into 2 parts - the first 3 GiB for the user space and the 
> remaining 1GiB for the kernel (with the same kernel mapping being used 
> for all processes. However, although the kernel is mapped into the 
> higher portion of the address space, it resides in the lower 1 GiB of RAM. Is this correct?
Yes. Incase of 3:1 mapping, kernel virtual address starts at 0xc0000000. You can also have 2:2 mappings aswell. It is a configurable option

Just an FYI, I've seen 1:3 mapping too. We had to do that with the kernels we built
when I was at one company because we needed 3GB of virtual address space to map all
of the memory mapped registers on their ASICs.

There's lots of options here.

Jeff Haran





More information about the Kernelnewbies mailing list