aboutsummaryrefslogtreecommitdiff
path: root/cpu-all.h
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2012-02-02 03:14:18 +0100
committerRiku Voipio <riku.voipio@linaro.org>2012-04-06 18:49:58 +0300
commit39879bbbea4661a4004ca26673e3d1e6ae1e0bc3 (patch)
tree732cc32cf7b2a2b889dee88b9bc08c562b838ebd /cpu-all.h
parent20249ae189ac0baa5011770bccabf3ee802eb2ab (diff)
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 <agraf@suse.de> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
Diffstat (limited to 'cpu-all.h')
-rw-r--r--cpu-all.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/cpu-all.h b/cpu-all.h
index 9621c3c92e..4512518065 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