]> git.ipfire.org Git - thirdparty/qemu.git/commit
kvm: Fix memory slot page alignment logic
authorAlexander Graf <agraf@suse.de>
Fri, 7 Nov 2014 21:12:48 +0000 (22:12 +0100)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Wed, 7 Jan 2015 20:42:04 +0000 (14:42 -0600)
commit14b51b6718c304d3051aceeb11664736a38cd272
tree7d9c4f6e80902ddaa58785ff6eb09df153b1a010
parentea227e222bacb16539128b6b201614847374453c
kvm: Fix memory slot page alignment logic

Memory slots have to be page aligned to get entered into KVM. There
is existing logic that tries to ensure that we pad memory slots that
are not page aligned to the biggest region that would still fit in the
alignment requirements.

Unfortunately, that logic is broken. It tries to calculate the start
offset based on the region size.

Fix up the logic to do the thing it was intended to do and document it
properly in the comment above it.

With this patch applied, I can successfully run an e500 guest with more
than 3GB RAM (at which point RAM starts overlapping subpage memory regions).

Cc: qemu-stable@nongnu.org
Signed-off-by: Alexander Graf <agraf@suse.de>
(cherry picked from commit f2a64032a14c642d0ddc9a7a846fc3d737deede5)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
kvm-all.c