• Andres Lagar-Cavilla's avatar
    Xen: Fix retry calls into PRIVCMD_MMAPBATCH*. · a5deabe0
    Andres Lagar-Cavilla authored
    When a foreign mapper attempts to map guest frames that are paged out,
    the mapper receives an ENOENT response and will have to try again
    while a helper process pages the target frame back in.
    
    Gating checks on PRIVCMD_MMAPBATCH* ioctl args were preventing retries
    of mapping calls.
    
    Permit subsequent calls to update a sub-range of the VMA, iff nothing
    is yet mapped in that range.
    
    Since it is now valid to call PRIVCMD_MMAPBATCH* multiple times, only
    set vma->vm_private_data if the parameters are valid and (if
    necessary) the pages for the auto_translated_physmap case have been
    allocated.  This prevents subsequent calls from incorrectly entering
    the 'retry' path when there are no pages allocated etc.
    Signed-off-by: default avatarAndres Lagar-Cavilla <andres@lagarcavilla.org>
    Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
    Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    a5deabe0
privcmd.c 13.9 KB