qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] exec: fix regression by making system-memory re


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH] exec: fix regression by making system-memory region UINT64_MAX size
Date: Sun, 3 Nov 2013 21:26:06 +0000

On 3 November 2013 20:48, Marcel Apfelbaum <address@hidden> wrote:
> The problem appears when a root memory region within an
> address space with size < UINT64_MAX has overlapping children
> with the same size. If the size of the root memory region is UINT64_MAX
> everyting is ok.
>
> Solved the regression by making the system-memory region
> of size UINT64_MAX instead of INT64_MAX.
>
> Signed-off-by: Marcel Apfelbaum <address@hidden>
> ---
> In the mean time I am investigating why the
> root memory region has to be UINT64_MAX size in order
> to have overlapping children

>      system_memory = g_malloc(sizeof(*system_memory));
> -    memory_region_init(system_memory, NULL, "system", INT64_MAX);
> +    memory_region_init(system_memory, NULL, "system", UINT64_MAX);
>      address_space_init(&address_space_memory, system_memory, "memory");

As you say above we should investigate why this caused a
problem, but I was surprised the system memory space isn't
already maximum size. It turns out that that change was
introduced in commit 8417cebf in an attempt to avoid overflow
issues by sticking to signed 64 bit arithmetic. This approach was
subsequently ditched in favour of using proper 128 bit arithmetic
in commit 08dafab4, but we never changed the init call for
the system memory back to UINT64_MAX. So I think this is
a good change in itself.

-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]