Skip to content
  • Paolo Bonzini's avatar
    exec: fix incorrect assumptions in memory_access_size · e1622f4b
    Paolo Bonzini authored
    
    
    access_size_min can be 1 because erroneous accesses must not crash
    QEMU, they should trigger exceptions in the guest or just return
    garbage (depending on the CPU).  I am not sure I understand the
    comment: placing a 4-byte field at the last byte of a region
    makes no sense (unless impl.unaligned is true), and that is
    why memory.c:access_with_adjusted_size does not bother with
    minimums larger than the remaining length.
    
    access_size_max can be mr->ops->valid.max_access_size because memory.c
    can and will still break accesses bigger than
    mr->ops->impl.max_access_size.
    
    Reported-by: default avatarMarkus Armbruster <armbru@redhat.com>
    Tested-by: default avatarMarkus Armbruster <armbru@redhat.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    e1622f4b