Received: from eggs.gnu.org ([140.186.70.92]:40249) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RsmGV-0002z0-US for qemu-devel@nongnu.org; Wed, 01 Feb 2012 21:19:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RsmGU-0006eP-Kc for qemu-devel@nongnu.org; Wed, 01 Feb 2012 21:19:11 -0500 Received: from cantor2.suse.de ([195.135.220.15]:50071 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RsmGU-0006cy-F4 for qemu-devel@nongnu.org; Wed, 01 Feb 2012 21:19:10 -0500 From: Alexander Graf Date: Thu, 2 Feb 2012 03:19:08 +0100 Message-Id: <1328149148-13422-1-git-send-email-agraf@suse.de> Subject: [Qemu-devel] [PATCH] linux-user: take RESERVED_VA into account for g2h_valid() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel Developers Cc: riku.voipio@linaro.org When running with -R (RESERVED_VA > 0) all guest virtual addresses are within the [0..RESERVED_VA] range. Reflect this with g2h_valid() too so we can safely check for boundaries of our guest address space. This is required to have the /proc/self/maps code not show maps that aren't accessible from the guest process's point of view. Signed-off-by: Alexander Graf --- cpu-all.h | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/cpu-all.h b/cpu-all.h index e2c3c49..d42a06e 100644 --- a/cpu-all.h +++ b/cpu-all.h @@ -204,7 +204,8 @@ extern unsigned long reserved_va; #else #define h2g_valid(x) ({ \ unsigned long __guest = (unsigned long)(x) - GUEST_BASE; \ - __guest < (1ul << TARGET_VIRT_ADDR_SPACE_BITS); \ + (__guest < (1ul << TARGET_VIRT_ADDR_SPACE_BITS)) && \ + (!RESERVED_VA || (__guest < RESERVED_VA)); \ }) #endif -- 1.6.0.2