]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
xen: use correct type for HYPERVISOR_memory_op()
authorJuergen Gross <jgross@suse.com>
Fri, 4 Sep 2015 12:50:33 +0000 (14:50 +0200)
committerDavid Vrabel <david.vrabel@citrix.com>
Mon, 28 Sep 2015 13:48:52 +0000 (14:48 +0100)
HYPERVISOR_memory_op() is defined to return an "int" value. This is
wrong, as the Xen hypervisor will return "long".

The sub-function XENMEM_maximum_reservation returns the maximum
number of pages for the current domain. An int will overflow for a
domain configured with 8TB of memory or more.

Correct this by using the correct type.

Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
arch/x86/include/asm/xen/hypercall.h
arch/x86/xen/setup.c

index 83aea8055119e2f26beb1c909536609d30e88943..4c20dd333412db5b367d0625e9b7cf69a7891493 100644 (file)
@@ -336,10 +336,10 @@ HYPERVISOR_update_descriptor(u64 ma, u64 desc)
        return _hypercall4(int, update_descriptor, ma, ma>>32, desc, desc>>32);
 }
 
-static inline int
+static inline long
 HYPERVISOR_memory_op(unsigned int cmd, void *arg)
 {
-       return _hypercall2(int, memory_op, cmd, arg);
+       return _hypercall2(long, memory_op, cmd, arg);
 }
 
 static inline int
index f5ef6746d47a0ee36f6b0a11edd0c49cbcf3590a..4ebfcecc2a8b683c88b2443ba61c4e61c5ca4c7e 100644 (file)
@@ -548,7 +548,7 @@ static unsigned long __init xen_get_max_pages(void)
 {
        unsigned long max_pages, limit;
        domid_t domid = DOMID_SELF;
-       int ret;
+       long ret;
 
        limit = xen_get_pages_limit();
        max_pages = limit;