]> xenbits.xensource.com Git - xen.git/commit
xen/arm: Harden setup_frametable_mappings
authorMichal Orzel <michal.orzel@amd.com>
Tue, 17 Jan 2023 11:43:32 +0000 (12:43 +0100)
committerJulien Grall <jgrall@amazon.com>
Fri, 20 Jan 2023 13:44:05 +0000 (13:44 +0000)
commit93017efd7c441420318e46443a06e40fa6f1b6d4
tree85cd66c3cdec3572c2fac2c623af3ef282ef66af
parentb2220f85256a9209560586c25e37d7ad860fa1e2
xen/arm: Harden setup_frametable_mappings

The amount of supported physical memory depends on the frametable size
and the number of struct page_info entries that can fit into it. Define
a macro PAGE_INFO_SIZE to store the current size of the struct page_info
(i.e. 56B for arm64 and 32B for arm32) and add a sanity check in
setup_frametable_mappings to be notified whenever the size of the
structure changes. Also call a panic if the calculated frametable_size
exceeds the limit defined by FRAMETABLE_SIZE macro.

Update the comments regarding the frametable in asm/config.h.

Signed-off-by: Michal Orzel <michal.orzel@amd.com>
Reviewed-by: Julien Grall <jgrall@amazon.com>
xen/arch/arm/include/asm/config.h
xen/arch/arm/include/asm/mm.h
xen/arch/arm/mm.c