Commit 0715c0e2 authored by Kalesh Singh's avatar Kalesh Singh
Browse files

ANDROID: 16K: Emulate /proc/pid/pagemap

Collapse X kernelpage pagemap entries into a single emulated pagemap
entry.

PM_PFRAME_BITS are zeroed since there is no guarantee these are
contiguous in physical memory.

Swap related bits are also zeored since there is no guarantee that swap
offset have to be contiguous.

UFFD WP bit is zeroed as it is not supported for x86_64 16K [1].

All other bits are set if any of the subpages' bits are set.

Also introduce __pagemap_lseek(), to adjust the file offset to compensate
for the fact that userspace believes the page size is larger than it
actually is.

[1] https://r.android.com/3424862



Bug: 385167611
Test: atest vts_ltp_test_x86_64:syscalls.msync04_64bit#syscalls.msync04_64bit
Test: atest vts_ltp_test_x86_64:syscalls.mmap12_64bit#syscalls.mmap12_64bit
Test: atest libmeminfo_test
Test: atest bionic-unit-tests:DlExtRelroSharingTest#VerifyMemorySaving
Note: bionic-unit-tests must be run as root (add require_root: true)
Change-Id: Ifc159f63f4b18dc43799b104d6be7d3dcb4fca49
Signed-off-by: default avatarKalesh Singh <kaleshsingh@google.com>
parent 0e0c5304
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment