SHA256
1
0
forked from pool/qemu

- qemu-user: add fix for /proc/self/maps to only show mappable regions

OBS-URL: https://build.opensuse.org/package/show/Virtualization/qemu?expand=0&rev=43
This commit is contained in:
Alexander Graf 2012-02-02 02:18:00 +00:00 committed by Git OBS Bridge
parent c5a1e8c9ff
commit 4688a1eeb2
3 changed files with 41 additions and 0 deletions

View File

@ -0,0 +1,34 @@
From 63ad8e6ca106981bc18f2d49cf0bed79a7b2cbfe Mon Sep 17 00:00:00 2001
From: Alexander Graf <agraf@suse.de>
Date: Thu, 2 Feb 2012 03:14:18 +0100
Subject: [PATCH] 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>
---
cpu-all.h | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/cpu-all.h b/cpu-all.h
index 5f47ab8..ce3e78f 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

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Thu Feb 2 00:41:21 UTC 2012 - agraf@suse.de
- qemu-user: add fix for /proc/self/maps to only show mappable regions
-------------------------------------------------------------------
Wed Feb 1 23:48:53 UTC 2012 - agraf@suse.de

View File

@ -76,6 +76,7 @@ Patch0047: 0047-linux-user-add-struct-old_dev_t-compat.patch
Patch0048: 0048-linux-user-fix-BLK-ioctl-arguments.patch
Patch0049: 0049-linux-user-add-BLKSSZGET-ioctl-wrapper.patch
Patch0050: 0050-linux-user-Add-ioctl-for-BLKBSZGET.patch
Patch0051: 0051-linux-user-take-RESERVED_VA-into-account-for-g2h_va.patch
# this is to make lint happy
Source300: rpmlintrc
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@ -185,6 +186,7 @@ run cross architectures builds
%patch0048 -p1
%patch0049 -p1
%patch0050 -p1
%patch0051 -p1
%build
# build QEMU