]> git.proxmox.com Git - mirror_qemu.git/commit
ioport: loosen assertions on emulation of 16-bit ports
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 30 Mar 2015 10:49:40 +0000 (12:49 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 27 Apr 2015 16:24:19 +0000 (18:24 +0200)
commit147ed379838176d4780688157891c06f49403b19
tree1ba0876adf56552be0d542712f795dd32df3f317
parent30476b2282c69c9ec1e44e33a4c0b5d5f4bc884e
ioport: loosen assertions on emulation of 16-bit ports

Right now, ioport.c assumes that the entire range specified with
MemoryRegionPortio includes a region with size == 1.  This however
is not true for the VBE DISPI ports, which are 16-bit only.  The
next patch will make these regions' length equal to two, which can
cause the assertions to trigger.  Replace them with simple conditionals.

Also, ioport.c will emulate a 16-bit ioport with two distinct reads
or writes, even if one of the two accesses is out of the bounds given
by the MemoryRegionPortio array.  Do not do this anymore, instead
discard writes to the incorrect register and read it as all-ones.
This ensures that the mrp->read and mrp->write callbacks get an
in-range ioport number.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
ioport.c