qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: qemu-devel@nongnu.org
Cc: riku.voipio@iki.fi, peter.maydell@linaro.org
Subject: [Qemu-devel] [PATCH v2 1/4] linux-user: Allow -R values up to 0xffff0000 for 32-bit ARM guests
Date: Thu,  5 Oct 2017 10:35:58 -0400	[thread overview]
Message-ID: <20171005143601.21584-2-richard.henderson@linaro.org> (raw)
In-Reply-To: <20171005143601.21584-1-richard.henderson@linaro.org>

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(-)

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;
     }
 
-- 
2.13.6

  reply	other threads:[~2017-10-05 14:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-05 14:35 [Qemu-devel] [PATCH v2 0/4] linux-user fixes for va mapping Richard Henderson
2017-10-05 14:35 ` Richard Henderson [this message]
2017-10-05 14:35 ` [Qemu-devel] [PATCH v2 2/4] tcg: Fix off-by-one in assert in page_set_flags Richard Henderson
2017-10-05 14:36 ` [Qemu-devel] [PATCH v2 3/4] linux-user: Tidy and enforce reserved_va initialization Richard Henderson
2018-01-12 20:37   ` Alistair Francis
2018-01-12 22:12     ` Alistair Francis
2017-10-05 14:36 ` [Qemu-devel] [PATCH v2 4/4] linux-user/sh4: Reduce TARGET_VIRT_ADDR_SPACE_BITS to 31 Richard Henderson
2017-10-16 12:41 ` [Qemu-devel] [PATCH v2 0/4] linux-user fixes for va mapping Riku Voipio

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171005143601.21584-2-richard.henderson@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=riku.voipio@iki.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).