]> git.proxmox.com Git - qemu.git/commit
kvm: fix unaligned slots
authorAvi Kivity <avi@redhat.com>
Wed, 29 Feb 2012 11:22:12 +0000 (13:22 +0200)
committerAvi Kivity <avi@redhat.com>
Thu, 1 Mar 2012 12:50:07 +0000 (14:50 +0200)
commit8f6f962b994e1402935055ac7093ac977ccc9a5c
treefdbfb7dafd54db06386582f9a95e0b9cdb315eea
parent7c51c1aa03a52b9fd75ed1ade2e65d079ae4d50e
kvm: fix unaligned slots

kvm_set_phys_mem() may be passed sections that are not aligned to a page
boundary.  The current code simply brute-forces the alignment which leads
to an inconsistency and an abort().

Fix by aligning the start and the end of the section correctly, discarding
and unaligned head or tail.

This was triggered by a guest sizing a 64-bit BAR that is smaller than a page
with PCI_COMMAND_MEMORY enabled and the upper dword clear.

Signed-off-by: Avi Kivity <avi@redhat.com>
kvm-all.c