Skip to content
  • Paolo Bonzini's avatar
    147ed379
    ioport: loosen assertions on emulation of 16-bit ports · 147ed379
    Paolo Bonzini authored
    
    
    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: default avatarPaolo Bonzini <pbonzini@redhat.com>
    147ed379
    ioport: loosen assertions on emulation of 16-bit ports
    Paolo Bonzini authored
    
    
    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: default avatarPaolo Bonzini <pbonzini@redhat.com>
Loading