Skip to content
  • Avi Kivity's avatar
    memory: store MemoryRegionSection pointers in phys_map · 5312bd8b
    Avi Kivity authored
    
    
    Instead of storing PhysPageDesc, store pointers to MemoryRegionSections.
    The various offsets (phys_offset & ~TARGET_PAGE_MASK,
    PHYS_OFFSET & TARGET_PAGE_MASK, region_offset) can all be synthesized
    from the information in a MemoryRegionSection.  Adjust phys_page_find()
    to synthesize a PhysPageDesc.
    
    The upshot is that phys_map now contains uniform values, so it's easier
    to generate and compress.
    
    The end result is somewhat clumsy but this will be improved as we we
    propagate MemoryRegionSections throughout the code instead of transforming
    them to PhysPageDesc.
    
    The MemoryRegionSection pointers are stored as uint16_t offsets in an
    array.  This saves space (when we also compress node pointers) and is
    more cache friendly.
    
    Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
    5312bd8b