summaryrefslogtreecommitdiff
path: root/linux-user
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@parabola.nu>2017-12-28 13:08:09 -0500
committerLaurent Vivier <laurent@vivier.eu>2018-03-09 21:29:49 +0100
commit955e304f6fc1703edafed69b299a8ca39233f865 (patch)
tree1eb2853e8c1160cc053d7dbebb3f071a6ce4ff9b /linux-user
parent293f20600896d18c05880fb003f08d281b3156cb (diff)
downloadqemu-955e304f6fc1703edafed69b299a8ca39233f865.tar.gz
linux-user: init_guest_commpage: Add a comment about size check
Signed-off-by: Luke Shumaker <lukeshu@parabola.nu> Message-Id: <20171228180814.9749-7-lukeshu@lukeshu.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'linux-user')
-rw-r--r--linux-user/elfload.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index 653157876c..8699f430b1 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -374,6 +374,11 @@ static int init_guest_commpage(unsigned long guest_base,
/* If the commpage lies within the already allocated guest space,
* then there is no way we can allocate it.
+ *
+ * You may be thinking that that this check is redundant because
+ * we already validated the guest size against MAX_RESERVED_VA;
+ * but if qemu_host_page_mask is unusually large, then
+ * test_page_addr may be lower.
*/
if (test_page_addr >= guest_base
&& test_page_addr < (guest_base + guest_size)) {