You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On 64-bit POWER platforms, a page is 64 KB in size (at least on Linux by default). Similarly, Asahi Linux uses a 16 KB page size.
Currently, a page size of 4k is hard-coded in the block trampolines and block_to_imp.c. In alloc_trampolines we set PROT_EXEC for rx_buffer, but this assumes that rx_buffer points to the beginning of a 4k page.
There is one proper solution, and one duck tape fix:
Determine page size on runtime. Requires restructuring of block_to_imp.c as struct fields are determined based on PAGE_SIZE.
Determine page size during configuration
The text was updated successfully, but these errors were encountered:
Check for code instances that reference specific page sizes
Even if your app is 16 KB-aligned, your app can encounter errors if places in your code assume that a device is using a specific page size. To avoid this, complete the following steps:
Look for usages of mmap() and other APIs that require page-aligned arguments and replace with alternatives where necessary.
In some cases, if your app uses PAGE_SIZE as a convenient value that isn't tied to the underlying page size, then this won't cause your app to break when used in 16 KB mode. However, if this value is passed to the kernel with mmap without MAP_FIXED, the kernel still uses an entire page, which wastes some memory. For these reasons, PAGE_SIZE is undefined when 16 KB mode is enabled on NDK r27 and higher.
If your app uses PAGE_SIZE in this way and never directly passes this value to the kernel, then instead of using PAGE_SIZE, create a new variable with a new name to reflect that it is used for other purposes and does not reflect a real memory page.
On 64-bit POWER platforms, a page is 64 KB in size (at least on Linux by default). Similarly, Asahi Linux uses a 16 KB page size.
Currently, a page size of 4k is hard-coded in the block trampolines and
block_to_imp.c
. Inalloc_trampolines
we setPROT_EXEC
forrx_buffer
, but this assumes that rx_buffer points to the beginning of a 4k page.There is one proper solution, and one duck tape fix:
block_to_imp.c
as struct fields are determined based on PAGE_SIZE.The text was updated successfully, but these errors were encountered: