Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1224104 > unrolled thread

Re: [PATCH] xen: use correct type for HYPERVISOR_memory_op()

Started byJuergen Gross <jgross@suse.com>
First post2015-09-14 14:50 +0200
Last post2015-09-14 14:50 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] xen: use correct type for HYPERVISOR_memory_op() Juergen Gross <jgross@suse.com> - 2015-09-14 14:50 +0200

#1224104 — Re: [PATCH] xen: use correct type for HYPERVISOR_memory_op()

FromJuergen Gross <jgross@suse.com>
Date2015-09-14 14:50 +0200
SubjectRe: [PATCH] xen: use correct type for HYPERVISOR_memory_op()
Message-ID<q8BmO-6tb-17@gated-at.bofh.it>
Ping?

On 09/04/2015 02:50 PM, Juergen Gross wrote:
> 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>
> ---
>   arch/x86/include/asm/xen/hypercall.h | 4 ++--
>   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 ca08a27..b7a735f 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)
>   	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
> diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
> index f5ef674..4ebfcec 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)
>   {
>   	unsigned long max_pages, limit;
>   	domid_t domid = DOMID_SELF;
> -	int ret;
> +	long ret;
>
>   	limit = xen_get_pages_limit();
>   	max_pages = limit;
>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web