[PATCH] Add a VMSPLIT_2G_OPT config option.

Linus Walleij linus.walleij at linaro.org
Tue Nov 10 08:09:11 EST 2020


On Tue, Nov 3, 2020 at 10:53 PM Christian Melki
<christian.melki at t2data.com> wrote:

> This allows 2GB systems to have their RAM entirely mapped as low memory.
> Needed to avoid CONFIG_HIGHMEM for the last 256M.
>
> Definitely not an uncommon configuration in the industry.
> Following the discussions about deprecating CONFIG_HIGHMEM down the
> line, this is probably a nice addition.
>
> Tested on a Kontron i.MX6 Quad board equipped with 2G RAM.
>
> Signed-off-by: Christian Melki <christian.melki at t2data.com>

This is neat!

>         default PHYS_OFFSET if !MMU
>         default 0x40000000 if VMSPLIT_1G
> +       default 0x70000000 if VMSPLIT_2G_OPT

If you apply this to linux-next it will unfortunately not work with the
KASan address sanitizer.

Right below the PHYS_OFFSET is now this:

config KASAN_SHADOW_OFFSET
        hex
        depends on KASAN
        default 0x1f000000 if PAGE_OFFSET=0x40000000
        default 0x5f000000 if PAGE_OFFSET=0x80000000
        default 0x9f000000 if PAGE_OFFSET=0xC0000000
        default 0x8f000000 if PAGE_OFFSET=0xB0000000
        default 0xffffffff

So this needs to be updated for your new page offset.

commit c12366ba441da2f6f2b915410aca2b5b39c16514
"ARM: 9015/2: Define the virtual space of KASan's shadow region"
explains in detail how these KASAN_SHADOW_OFFSETs
are selected so that you can add that at the same time.

Then you can test the VMSPLIT_2G_OPT system with
KASan to make sure it also works.

Yours,
Linus Walleij



More information about the linux-arm-kernel mailing list