[v2,1/4] linux-user: Allow -R values up to 0xffff0000 for 32-bit ARM guests

Message ID 20171005143601.21584-2-richard.henderson@linaro.org
State New
Headers show
Series
  • linux-user fixes for va mapping
Related show

Commit Message

Richard Henderson Oct. 5, 2017, 2:35 p.m.
From: Peter Maydell <peter.maydell@linaro.org>


The 32-bit ARM validate_guest_space() check tests whether the
specified -R value leaves enough space for us to put the
commpage in at 0xffff0f00. However it was incorrectly doing
a <= check for the check against (guest_base + guest_size),
which meant that it wasn't permitting the guest space to
butt right up against the commpage.

Fix the comparison, so that -R values all the way up to 0xffff0000
work correctly.

Reviewed-by: Emilio G. Cota <cota@braap.org>

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Message-Id: <1507047703-10774-1-git-send-email-peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

---
 linux-user/elfload.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.13.6

Patch

diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index 79062882ba..3b857fbc9c 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -377,7 +377,7 @@  static int validate_guest_space(unsigned long guest_base,
      * then there is no way we can allocate it.
      */
     if (test_page_addr >= guest_base
-        && test_page_addr <= (guest_base + guest_size)) {
+        && test_page_addr < (guest_base + guest_size)) {
         return -1;
     }