]> www.infradead.org Git - users/jedix/linux-maple.git/commit
um: Discover host_task_size from envp
authorBenjamin Berg <benjamin.berg@intel.com>
Thu, 19 Sep 2024 12:45:09 +0000 (14:45 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 10 Oct 2024 11:37:22 +0000 (13:37 +0200)
commit68b9883cc16ec2ce699d832ef60241b1a4e47d33
tree643472cca34b474083cf41dd9859840648c2e8f8
parent830003c73d190259e45d0a99a0e3d14cb73e0af0
um: Discover host_task_size from envp

When loading the UML binary, the host kernel will place the stack at the
highest possible address. It will then map the program name and
environment variables onto the start of the stack.

As such, an easy way to figure out the host_task_size is to use the
highest pointer to an environment variable as a reference.

Ensure that this works by disabling address layout randomization and
re-executing UML in case it was enabled.

This increases the available TASK_SIZE for 64 bit UML considerably.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Link: https://patch.msgid.link/20240919124511.282088-9-benjamin@sipsolutions.net
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
arch/um/include/shared/as-layout.h
arch/um/include/shared/os.h
arch/um/kernel/um_arch.c
arch/um/os-Linux/main.c
arch/x86/um/os-Linux/Makefile
arch/x86/um/os-Linux/task_size.c [deleted file]