qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] linux-user: Allow -R values up to 0xffff0000 for 32-bit ARM guests
@ 2017-10-03 16:21 Peter Maydell
  2017-10-03 18:23 ` Emilio G. Cota
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Maydell @ 2017-10-03 16:21 UTC (permalink / raw)
  To: qemu-devel; +Cc: Richard Henderson, Riku Voipio, Laurent Vivier

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.

Signed-off-by: Peter Maydell <peter.maydell@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 7906288..3b857fb 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.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] linux-user: Allow -R values up to 0xffff0000 for 32-bit ARM guests
  2017-10-03 16:21 [Qemu-devel] [PATCH] linux-user: Allow -R values up to 0xffff0000 for 32-bit ARM guests Peter Maydell
@ 2017-10-03 18:23 ` Emilio G. Cota
  0 siblings, 0 replies; 2+ messages in thread
From: Emilio G. Cota @ 2017-10-03 18:23 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-devel, Riku Voipio, Laurent Vivier, Richard Henderson

On Tue, Oct 03, 2017 at 17:21:43 +0100, Peter Maydell wrote:
> 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.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

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

		E.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-10-03 18:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-03 16:21 [Qemu-devel] [PATCH] linux-user: Allow -R values up to 0xffff0000 for 32-bit ARM guests Peter Maydell
2017-10-03 18:23 ` Emilio G. Cota

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