From 39879bbbea4661a4004ca26673e3d1e6ae1e0bc3 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Thu, 2 Feb 2012 03:14:18 +0100 Subject: linux-user: take RESERVED_VA into account for g2h_valid() 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 Signed-off-by: Riku Voipio --- cpu-all.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'cpu-all.h') diff --git a/cpu-all.h b/cpu-all.h index 9621c3c..4512518 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 -- cgit v1.1