[PATCH v2 2/4] arm64: mm: extend linear region for 52-bit VA configurations
Ard Biesheuvel
ardb at kernel.org
Wed Oct 14 03:18:44 EDT 2020
On Wed, 14 Oct 2020 at 05:45, Anshuman Khandual
<anshuman.khandual at arm.com> wrote:
>
>
>
> On 10/08/2020 09:06 PM, Ard Biesheuvel wrote:
> > For historical reasons, the arm64 kernel VA space is configured as two
> > equally sized halves, i.e., on a 48-bit VA build, the VA space is split
> > into a 47-bit vmalloc region and a 47-bit linear region.
> >
> > When support for 52-bit virtual addressing was added, this equal split
> > was kept, resulting in a substantial waste of virtual address space in
> > the linear region:
> >
> > 48-bit VA 52-bit VA
> > 0xffff_ffff_ffff_ffff +-------------+ +-------------+
> > | vmalloc | | vmalloc |
> > 0xffff_8000_0000_0000 +-------------+ _PAGE_END(48) +-------------+
> > | linear | : :
> > 0xffff_0000_0000_0000 +-------------+ : :
> > : : : :
> > : : : :
> > : : : :
> > : : : currently :
> > : unusable : : :
> > : : : unused :
> > : by : : :
> > : : : :
> > : hardware : : :
> > : : : :
> > 0xfff8_0000_0000_0000 : : _PAGE_END(52) +-------------+
> > : : | |
> > : : | |
> > : : | |
> > : : | |
> > : : | |
> > : unusable : | |
> > : : | linear |
> > : by : | |
> > : : | region |
> > : hardware : | |
> > : : | |
> > : : | |
> > : : | |
> > : : | |
> > : : | |
> > : : | |
> > 0xfff0_0000_0000_0000 +-------------+ PAGE_OFFSET +-------------+
> >
> > As illustrated above, the 52-bit VA kernel uses 47 bits for the vmalloc
> > space (as before), to ensure that a single 64k granule kernel image can
> > support any 64k granule capable system, regardless of whether it supports
> > the 52-bit virtual addressing extension. However, due to the fact that
> > the VA space is still split in equal halves, the linear region is only
> > 2^51 bytes in size, wasting almost half of the 52-bit VA space.
>
> Right, that is a huge wastage. Increasing the linear mapping will definitely
> help in getting more memory used on the system. But now do we have enough
> vmemmap range to support this enlarged linear mapping ?
Yes.
More information about the linux-arm-kernel
mailing list