]> rtime.felk.cvut.cz Git - jailhouse.git/commit
core: Add support for aligned page allocation
authorJan Kiszka <jan.kiszka@siemens.com>
Fri, 17 Jun 2016 12:37:30 +0000 (14:37 +0200)
committerJan Kiszka <jan.kiszka@siemens.com>
Sun, 26 Jun 2016 07:16:28 +0000 (09:16 +0200)
commit6b74f910dc248be969f16dc57e12412412f41b36
tree6ee8daa13f557f51b8e9953eb31545b1d6289ecc
parent11cc0e0cf21d53544bfe19977af1520981769e34
core: Add support for aligned page allocation

Refactor page_alloc to page_alloc_internal which accepts an additional
constraint for its allocation: align_mask. The allocated region will now
have its start page chosen so that page_number & align_mask is zero. If
no alignment is required, align_mask just needs to be set to 0. This is
what page_alloc exploits.

However, the new function page_alloc_aligned is introduces to return
page regions aligned according to their size (num pages will be aligned
by num * PAGE_SIZE). This implied that num needs to be a power of two.

This will be used on the AArch64 port of Jailhouse to support physical
address ranges from 40 to 44 bits: in these configurations, the initial
page table level may take up multiple consecutive pages.

Based on patch by Antonios Motakis.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
hypervisor/arch/arm/include/asm/paging.h
hypervisor/arch/x86/include/asm/paging.h
hypervisor/include/jailhouse/paging.h
hypervisor/paging.c