vhost: Add vhost_commit callback for SeaBIOS ROM region re-mapping
commitaf60314291af3cabda18d27f928b0e0ff899cc76
authorNicholas Bellinger <nab@linux-iscsi.org>
Wed, 3 Apr 2013 09:15:11 +0000 (3 09:15 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 19 Apr 2013 08:44:17 +0000 (19 10:44 +0200)
treeef62ae93c48f58def7e756fba12833c8c27d8026
parent881d588a98bf0dce98ddb65c15aa0854c0ac41ed
vhost: Add vhost_commit callback for SeaBIOS ROM region re-mapping

This patch follows MST's recommendation to move checks for
vhost_verify_ring_mappings() -> cpu_physical_memory_map() operations
from MemoryListener->region_[add,del]() -> vhost_set_memory() into
final MemoryListener->commit() -> vhost_commit() callback.

It addresses the case where virtio-scsi vq ioport RAM re-mapping
to read-only SeaBIOS ROM triggers a cpu_physical_memory_map()
NIL MemoryRegionSection pointer failure.

Also save vhost_dev->mem_changed_[start,end]_addr values in
vhost_set_memory() for final ranges_overlap checks.  (Thanks Paolo!)

Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Asias He <asias@redhat.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/virtio/vhost.c
include/hw/virtio/vhost.h