Re:Adding 16 KB Page Size to Android
by CalChris on Friday August 23, 2024 @08:43PM
(#41334509)
Are huge pages expected to share code (X) and data (RW)?
[ Parent
| on HN ]
Re:Adding 16 KB Page Size to Android
by versteegen on Friday August 23, 2024 @08:56PM
(#41334577)
There's probably no good reason to put code and data on the same page, it's just one extra TLB entry to use two pages instead so the data page can be marked non-executable.
Re:Adding 16 KB Page Size to Android
by nullindividual on Saturday August 24, 2024 @12:34AM
(#41335669)
Quoting Windows Internals 7th Edt Part 1:
There is an unfortunate side effect of large pages. Each page (whether huge, large, or small) must be mapped with a single protection that applies to the entire page. This is because hardware memory protection is on a per-page basis. If a large page contains, for example, both read-only code and read/write data, the page must be marked as read/write, meaning that the code will be writable. As a result, device drivers or other kernel-mode code could, either maliciously or due to a bug, modify what is supposed to be read-only operating system or driver code without causing a memory access violation.