Skip to content
  • Avi Kivity's avatar
    kvm: fix unaligned slots · 8f6f962b
    Avi Kivity authored
    
    
    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: default avatarAvi Kivity <avi@redhat.com>
    8f6f962b