Kernel logical memory map

Derrick McKee derrick.mckee at gmail.com
Fri Aug 7 15:28:30 EDT 2020


> Do you mean Documentation/arm64/memory.rst?

Yes.

> I wouldn't recommend it. If you need something in the kernel space
> (addresses starting with 0xfff...) you can look at reserving some range
> as we already do but you need to be a lot more specific. We have the
> "vmalloc" space where the kernel does various mappings for itself (e.g.
> ioremap).

I am trying to compartmentalize kernel code and data, and then use a
combination of MTE and PAC to enforce the compartmentalization at run
time.  My idea is to let the user decide which data should be grouped
together at compile time, give that group a unique id, and then store
that grouped data at a location where we can easily retrieve the
unique id from the address (using e.g., bits 40-47).  So, this will be
kernel data, using addresses starting with 0xffff, but perhaps use
0xffff000000000000 through 0xffff7fffffffffff.

On Fri, Aug 7, 2020 at 12:40 PM Catalin Marinas <catalin.marinas at arm.com> wrote:
>
> On Wed, Aug 05, 2020 at 11:05:30AM -0400, Derrick McKee wrote:
> > In the documentation,
>
> Do you mean Documentation/arm64/memory.rst?
>
> > the first 128TB above user space is marked as
> > the kernel logical memory map, and I cannot find an explanation for
> > what that is.  What is it used for?
>
> First of all, its not first above the user space. There is a very large
> gap between user and kernel (see the end/start values).
>
> > Can anyone point me towards further explanation of what it is used
> > for?
>
> It's used by the kernel to map the entire RAM.
>
> > I am looking to possibly repurpose some of that space for another use,
> > and I want to know if that is even possible.
>
> I wouldn't recommend it. If you need something in the kernel space
> (addresses starting with 0xfff...) you can look at reserving some range
> as we already do but you need to be a lot more specific. We have the
> "vmalloc" space where the kernel does various mappings for itself (e.g.
> ioremap).
>
> If you want to repurpose it for user, it's not really possible. This
> space is relies on being used in kernel space, it's not context switched
> (page tables pointed at by TTBR1_EL1 rather than TTBR1_EL0). However,
> you have enough user address space to add stuff in there.
>
> --
> Catalin



-- 
Derrick McKee
Phone: (703) 957-9362
Email: derrick.mckee at gmail.com



More information about the linux-arm-kernel mailing list