Skip to content
Snippets Groups Projects
user avatar
Shivendra Pratap authored
Since kernel v5.0, there is a dedicated region of size 128MB
kept aside for BPF programs(BPF_JIT_REGION) which were
previously using module region. Also in v5.4, kernel VA space
was flipped to accomodate support for kasan shadow and 52bit VA.
Hence we are updating the VA space calculations in parser to make
it work on newer kernel.

Adding few changes on linux banner read and match for cleanup.

There was an unmonitored variable ramdump.version being used in
debug_image_v2 cauing version check failure. Adding a change to
use kernel_version.
Fix intend in debug_image_v2.

Briefly, the calculations are updated as below:

_PAGE_END(va)		= (-(UL(1) << ((va) - 1))) = 0xffffffc000000000
KASAN_SHADOW_END	= (_PAGE_END(VA_BITS_MIN)) = 0xffffffc000000000
BPF_JIT_REGION_START	= (KASAN_SHADOW_END)
BPF_JIT_REGION_SIZE	= (SZ_128M)
BPF_JIT_REGION_END	= (BPF_JIT_REGION_START + BPF_JIT_REGION_SIZE) = 0xffffffc000000000 + 0x8000000
MODULES_VADDR		= (BPF_JIT_REGION_END)
MODULES_END		= (MODULES_VADDR + MODULES_VSIZE) = 0xffffffc000000000 + 0x8000000 + 0x8000000 = 0xffffffc010000000
KIMAGE_VADDR		= (MODULES_END) = 0xffffffc010000000

Change-Id: I5a65b327e015970d68c41210fc813105fd6cb4b8
Signed-off-by: default avatarSai Prakash Ranjan <saiprakash.ranjan@codeaurora.org>
Signed-off-by: default avatarShivendra Pratap <spratap@codeaurora.org>
10b7d1f5