qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PULL 15/18] linux-user: init_guest_commpage: Add a comment


From: Laurent Vivier
Subject: [Qemu-devel] [PULL 15/18] linux-user: init_guest_commpage: Add a comment about size check
Date: Tue, 13 Mar 2018 18:33:52 +0100

From: Luke Shumaker <address@hidden>

Signed-off-by: Luke Shumaker <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Peter Maydell <address@hidden>
Signed-off-by: Laurent Vivier <address@hidden>
---
 linux-user/elfload.c | 5 +++++
 1 file changed, 5 insertions(+)

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)) {
-- 
2.14.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]