diff options
author | Ian Jackson <Ian.Jackson@eu.citrix.com> | 2011-01-28 19:37:49 +0000 |
---|---|---|
committer | Ian Jackson <Ian.Jackson@eu.citrix.com> | 2011-01-28 19:37:49 +0000 |
commit | 9f187767c5f6ca77511a69dd4b7a78b66b3c844a (patch) | |
tree | c7608a105ef69c8bcc9922ee3183d28cfea51253 /tools/libxc/xc_linux.c | |
parent | 36ac3bcd564975302e6e6df556b854687c0d1f93 (diff) | |
download | xen-9f187767c5f6ca77511a69dd4b7a78b66b3c844a.tar.gz xen-9f187767c5f6ca77511a69dd4b7a78b66b3c844a.tar.bz2 xen-9f187767c5f6ca77511a69dd4b7a78b66b3c844a.zip |
libxc: Do not use dom0 physmem as parameter to lzma decoder
It's not clear why a userspace lzma decode would want to use that
particular value, what bearing it has on anything or why it would
assume it could use 1/3 of the total RAM in the system (potentially
quite a large amount of RAM) as opposed to any other limit number.
Instead, hardcode 32Mby.
This reverts 22830:c80960244942, removes the xc_get_physmem/physmem
function entirely, and replaces the expression at the call site with a
fixed constant.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <Ian.Campbell@eu.citrix.com>
Cc: Christoph Egger <Christoph.Egger@amd.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools/libxc/xc_linux.c')
-rw-r--r-- | tools/libxc/xc_linux.c | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/tools/libxc/xc_linux.c b/tools/libxc/xc_linux.c index 66b055cbe4..9acf27573e 100644 --- a/tools/libxc/xc_linux.c +++ b/tools/libxc/xc_linux.c @@ -55,27 +55,6 @@ void discard_file_cache(xc_interface *xch, int fd, int flush) errno = saved_errno; } -uint64_t xc_get_physmem(void) -{ - uint64_t ret = 0; - const long pagesize = sysconf(_SC_PAGESIZE); - const long pages = sysconf(_SC_PHYS_PAGES); - - if ( (pagesize != -1) || (pages != -1) ) - { - /* - * According to docs, pagesize * pages can overflow. - * Simple case is 32-bit box with 4 GiB or more RAM, - * which may report exactly 4 GiB of RAM, and "long" - * being 32-bit will overflow. Casting to uint64_t - * hopefully avoids overflows in the near future. - */ - ret = (uint64_t)(pagesize) * (uint64_t)(pages); - } - - return ret; -} - /* * Local variables: * mode: C |