]> git.ipfire.org Git - thirdparty/qemu.git/commit
virtio-balloon: Rework pbp tracking data
authorDavid Hildenbrand <david@redhat.com>
Mon, 22 Jul 2019 13:41:07 +0000 (15:41 +0200)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 1 Oct 2019 21:58:28 +0000 (16:58 -0500)
commitd0444b1ee3c6f5cdc3975dc41f27a0c43c398af6
treebe7121fbaae4731b53148e2d7c99770467a4648f
parentb50aab6b836c37344be7ab3b4810ad01cb500e0e
virtio-balloon: Rework pbp tracking data

Using the address of a RAMBlock to test for a matching pbp is not really
safe. Instead, let's use the guest physical address of the base page
along with the page size (via the number of subpages).

Also, let's allocate the bitmap separately. This makes the code
easier to read and maintain - we can reuse bitmap_new().

Prepare the code to move the PBP out of the device.

Fixes: ed48c59875b6 ("virtio-balloon: Safely handle BALLOON_PAGE_SIZE < host page size")
Fixes: b27b32391404 ("virtio-balloon: Fix possible guest memory corruption with inflates & deflates")
Cc: qemu-stable@nongnu.org #v4.0.0
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20190722134108.22151-6-david@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit 1c5cfc2b7153dd72bf4b8ddc456408eb2b9b66d8)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
hw/virtio/virtio-balloon.c