diff options
author | Juergen Gross <jgross@suse.com> | 2015-09-04 08:50:33 -0400 |
---|---|---|
committer | David Vrabel <david.vrabel@citrix.com> | 2015-09-28 09:48:52 -0400 |
commit | 24f775a6605a8ffc697c0767fc7ea85656ddb958 (patch) | |
tree | 405762fa77d7b70171aaeb732f9f6cb808c6f3dd | |
parent | 9ffecb10283508260936b96022d4ee43a7798b4c (diff) |
xen: use correct type for HYPERVISOR_memory_op()
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>
-rw-r--r-- | arch/x86/include/asm/xen/hypercall.h | 4 | ||||
-rw-r--r-- | arch/x86/xen/setup.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/arch/x86/include/asm/xen/hypercall.h b/arch/x86/include/asm/xen/hypercall.h index 83aea8055119..4c20dd333412 100644 --- a/arch/x86/include/asm/xen/hypercall.h +++ b/arch/x86/include/asm/xen/hypercall.h | |||
@@ -336,10 +336,10 @@ HYPERVISOR_update_descriptor(u64 ma, u64 desc) | |||
336 | return _hypercall4(int, update_descriptor, ma, ma>>32, desc, desc>>32); | 336 | return _hypercall4(int, update_descriptor, ma, ma>>32, desc, desc>>32); |
337 | } | 337 | } |
338 | 338 | ||
339 | static inline int | 339 | static inline long |
340 | HYPERVISOR_memory_op(unsigned int cmd, void *arg) | 340 | HYPERVISOR_memory_op(unsigned int cmd, void *arg) |
341 | { | 341 | { |
342 | return _hypercall2(int, memory_op, cmd, arg); | 342 | return _hypercall2(long, memory_op, cmd, arg); |
343 | } | 343 | } |
344 | 344 | ||
345 | static inline int | 345 | static inline int |
diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c index f5ef6746d47a..4ebfcecc2a8b 100644 --- a/arch/x86/xen/setup.c +++ b/arch/x86/xen/setup.c | |||
@@ -548,7 +548,7 @@ static unsigned long __init xen_get_max_pages(void) | |||
548 | { | 548 | { |
549 | unsigned long max_pages, limit; | 549 | unsigned long max_pages, limit; |
550 | domid_t domid = DOMID_SELF; | 550 | domid_t domid = DOMID_SELF; |
551 | int ret; | 551 | long ret; |
552 | 552 | ||
553 | limit = xen_get_pages_limit(); | 553 | limit = xen_get_pages_limit(); |
554 | max_pages = limit; | 554 | max_pages = limit; |