Skip to content
  • Anthony PERARD's avatar
    f5aa69bd
    exec: Add lock parameter to qemu_ram_ptr_length · f5aa69bd
    Anthony PERARD authored
    
    
    Commit 04bf2526 (exec: use
    qemu_ram_ptr_length to access guest ram) start using qemu_ram_ptr_length
    instead of qemu_map_ram_ptr, but when used with Xen, the behavior of
    both function is different. They both call xen_map_cache, but one with
    "lock", meaning the mapping of guest memory is never released
    implicitly, and the second one without, which means, mapping can be
    release later, when needed.
    
    In the context of address_space_{read,write}_continue, the ptr to those
    mapping should not be locked because it is used immediatly and never
    used again.
    
    The lock parameter make it explicit in which context qemu_ram_ptr_length
    is called.
    
    Signed-off-by: default avatarAnthony PERARD <anthony.perard@citrix.com>
    Message-Id: <20170726165326.10327-1-anthony.perard@citrix.com>
    Reviewed-by: default avatarStefano Stabellini <sstabellini@kernel.org>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    f5aa69bd
    exec: Add lock parameter to qemu_ram_ptr_length
    Anthony PERARD authored
    
    
    Commit 04bf2526 (exec: use
    qemu_ram_ptr_length to access guest ram) start using qemu_ram_ptr_length
    instead of qemu_map_ram_ptr, but when used with Xen, the behavior of
    both function is different. They both call xen_map_cache, but one with
    "lock", meaning the mapping of guest memory is never released
    implicitly, and the second one without, which means, mapping can be
    release later, when needed.
    
    In the context of address_space_{read,write}_continue, the ptr to those
    mapping should not be locked because it is used immediatly and never
    used again.
    
    The lock parameter make it explicit in which context qemu_ram_ptr_length
    is called.
    
    Signed-off-by: default avatarAnthony PERARD <anthony.perard@citrix.com>
    Message-Id: <20170726165326.10327-1-anthony.perard@citrix.com>
    Reviewed-by: default avatarStefano Stabellini <sstabellini@kernel.org>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
Loading