[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v1] softmmu/physmem: fix wrong assertion in qemu_ram_alloc_in
From: |
Peter Xu |
Subject: |
Re: [PATCH v1] softmmu/physmem: fix wrong assertion in qemu_ram_alloc_internal() |
Date: |
Tue, 3 Aug 2021 17:14:30 -0400 |
On Mon, Aug 02, 2021 at 05:22:38PM +0200, David Hildenbrand wrote:
> When adding RAM_NORESERVE, we forgot to remove the old assertion when
> adding the updated one, most probably when reworking the patches or
> rebasing. We can easily crash QEMU by adding
> -object memory-backend-ram,id=mem0,size=500G,reserve=off
> to the QEMU cmdline:
> qemu-system-x86_64: ../softmmu/physmem.c:2146: qemu_ram_alloc_internal:
> Assertion `(ram_flags & ~(RAM_SHARED | RAM_RESIZEABLE | RAM_PREALLOC))
> == 0' failed.
>
> Fix it by removing the old assertion.
>
> Fixes: 8dbe22c6868b ("memory: Introduce RAM_NORESERVE and wire it up in
> qemu_ram_mmap()")
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Peter Xu <peterx@redhat.com>
> Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
> Signed-off-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
--
Peter Xu