exec.c: Use subpages for large unaligned mappings
authorTyler Hall <tylerwhall@gmail.com>
Wed, 25 Jul 2012 22:45:04 +0000 (18:45 -0400)
committerStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Fri, 3 Aug 2012 13:25:22 +0000 (14:25 +0100)
commit69b67646bc7ae7f3d28b278e6ae4435a767450ec
treeac2df7357c0800679fc631de83fc6dffd6e4069a
parentadb2a9b5d4d5170f0b58b9f92f816048f6b8932b
exec.c: Use subpages for large unaligned mappings

Registering a multi-page memory region that is non-page-aligned results
in a subpage from the start to the page boundary, some number of full
pages, and possibly another subpage from the last page boundary to the
end. The full pages will have a value for offset_within_region that is
not a multiple of TARGET_PAGE_SIZE. Accesses through softmmu are unable
to handle this and will segfault.

Handling full pages through subpages is not optimal, but only
non-page-aligned mappings take the penalty.

Signed-off-by: Tyler Hall <tylerwhall@gmail.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
exec.c