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.
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.