diff --git a/0051-linux-user-take-RESERVED_VA-into-account-for-g2h_va.patch b/0051-linux-user-take-RESERVED_VA-into-account-for-g2h_va.patch new file mode 100644 index 00000000..080e24d1 --- /dev/null +++ b/0051-linux-user-take-RESERVED_VA-into-account-for-g2h_va.patch @@ -0,0 +1,34 @@ +From 63ad8e6ca106981bc18f2d49cf0bed79a7b2cbfe Mon Sep 17 00:00:00 2001 +From: Alexander Graf +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 +--- + 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 + diff --git a/qemu.changes b/qemu.changes index 47dafa1a..c04583ef 100644 --- a/qemu.changes +++ b/qemu.changes @@ -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 diff --git a/qemu.spec b/qemu.spec index 647eaa9d..92991686 100644 --- a/qemu.spec +++ b/qemu.spec @@ -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