30 Aug, 2013

1 commit

  • 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: Andres Lagar-Cavilla
    Signed-off-by: David Vrabel
    Signed-off-by: Konrad Rzeszutek Wilk

    Andres Lagar-Cavilla
     

28 Jun, 2013

1 commit

  • Convert printks to pr_ (excludes printk(KERN_DEBUG...)
    to be more consistent throughout the xen subsystem.

    Add pr_fmt with KBUILD_MODNAME or "xen:" KBUILD_MODNAME
    Coalesce formats and add missing word spaces
    Add missing newlines
    Align arguments and reflow to 80 columns
    Remove DRV_NAME from formats as pr_fmt adds the same content

    This does change some of the prefixes of these messages
    but it also does make them more consistent.

    Signed-off-by: Joe Perches
    Signed-off-by: Konrad Rzeszutek Wilk

    Joe Perches
     

15 May, 2013

1 commit


16 Jan, 2013

2 commits

  • 1. If any individual mapping error happens, the V1 case will mark *all*
    operations as failed. Fixed.

    2. The err_array was allocated with kcalloc, resulting in potentially O(n) page
    allocations. Refactor code to not use this array.

    Signed-off-by: Andres Lagar-Cavilla
    Signed-off-by: Konrad Rzeszutek Wilk

    Andres Lagar-Cavilla
     
  • Linux 3.7

    * tag 'v3.7': (833 commits)
    Linux 3.7
    Input: matrix-keymap - provide proper module license
    Revert "revert "Revert "mm: remove __GFP_NO_KSWAPD""" and associated damage
    ipv4: ip_check_defrag must not modify skb before unsharing
    Revert "mm: avoid waking kswapd for THP allocations when compaction is deferred or contended"
    inet_diag: validate port comparison byte code to prevent unsafe reads
    inet_diag: avoid unsafe and nonsensical prefix matches in inet_diag_bc_run()
    inet_diag: validate byte code to prevent oops in inet_diag_bc_run()
    inet_diag: fix oops for IPv4 AF_INET6 TCP SYN-RECV state
    mm: vmscan: fix inappropriate zone congestion clearing
    vfs: fix O_DIRECT read past end of block device
    net: gro: fix possible panic in skb_gro_receive()
    tcp: bug fix Fast Open client retransmission
    tmpfs: fix shared mempolicy leak
    mm: vmscan: do not keep kswapd looping forever due to individual uncompactable zones
    mm: compaction: validate pfn range passed to isolate_freepages_block
    mmc: sh-mmcif: avoid oops on spurious interrupts (second try)
    Revert misapplied "mmc: sh-mmcif: avoid oops on spurious interrupts"
    mmc: sdhci-s3c: fix missing clock for gpio card-detect
    lib/Makefile: Fix oid_registry build dependency
    ...

    Signed-off-by: Konrad Rzeszutek Wilk

    Conflicts:
    arch/arm/xen/enlighten.c
    drivers/xen/Makefile

    [We need to have the v3.7 base as the 'for-3.8' was based off v3.7-rc3
    and there are some patches in v3.7-rc6 that we to have in our branch]

    Konrad Rzeszutek Wilk
     

12 Jan, 2013

1 commit

  • In the privcmd Linux driver two checks in the functions
    privcmd_ioctl_mmap and privcmd_ioctl_mmap_batch are not needed as they
    are trying to enforce hypervisor-level access control. They should be
    removed as they break secondary control domains when performing dom0
    disaggregation. Xen itself provides adequate security controls around
    these hypercalls and these checks prevent those controls from
    functioning as intended.

    Signed-off-by: Tamas K Lengyel
    Cc: Daniel De Graaf
    [v1: Fixed up the patch and commit description]
    Signed-off-by: Konrad Rzeszutek Wilk

    Tamas Lengyel
     

29 Nov, 2012

2 commits

  • PVH and ARM only support the batch interface. To map a foreign page to
    a process, the PFN must be allocated and the autotranslated path uses
    ballooning for that purpose.

    The returned PFN is then mapped to the foreign page.
    xen_unmap_domain_mfn_range() is introduced to unmap these pages via the
    privcmd close call.

    Acked-by: Stefano Stabellini
    Signed-off-by: Mukesh Rathor
    [v1: Fix up privcmd_close]
    Signed-off-by: Konrad Rzeszutek Wilk
    Signed-off-by: Ian Campbell
    [v2: used for ARM too]

    Mukesh Rathor
     
  • Also introduce xen_unmap_domain_mfn_range. These are the parts of
    Mukesh's "xen/pvh: Implement MMU changes for PVH" which are also
    needed as a baseline for ARM privcmd support.

    The original patch was:

    Signed-off-by: Mukesh Rathor
    Signed-off-by: Konrad Rzeszutek Wilk

    This derivative is also:

    Signed-off-by: Ian Campbell

    Ian Campbell
     

21 Nov, 2012

1 commit

  • This is a regression introduced by ceb90fa0 (xen/privcmd: add
    PRIVCMD_MMAPBATCH_V2 ioctl). It broke xentrace as it used
    xc_map_foreign() instead of xc_map_foreign_bulk().

    Most code-paths prefer the MMAPBATCH_V2, so this wasn't very obvious
    that it broke. The return value is set early on to -EINVAL, and if all
    goes well, the "set top bits of the MFN's" never gets called, so the
    return value is still EINVAL when the function gets to the end, causing
    the caller to think it went wrong (which it didn't!)

    Now also including Andres "move the ret = -EINVAL into the error handling
    path, as this avoids other similar errors in future.

    Signed-off-by: Mats Petersson
    Acked-by: Andres Lagar-Cavilla
    Acked-by: David Vrabel
    Signed-off-by: Konrad Rzeszutek Wilk

    Mats Petersson
     

09 Oct, 2012

1 commit

  • A long time ago, in v2.4, VM_RESERVED kept swapout process off VMA,
    currently it lost original meaning but still has some effects:

    | effect | alternative flags
    -+------------------------+---------------------------------------------
    1| account as reserved_vm | VM_IO
    2| skip in core dump | VM_IO, VM_DONTDUMP
    3| do not merge or expand | VM_IO, VM_DONTEXPAND, VM_HUGETLB, VM_PFNMAP
    4| do not mlock | VM_IO, VM_DONTEXPAND, VM_HUGETLB, VM_PFNMAP

    This patch removes reserved_vm counter from mm_struct. Seems like nobody
    cares about it, it does not exported into userspace directly, it only
    reduces total_vm showed in proc.

    Thus VM_RESERVED can be replaced with VM_IO or pair VM_DONTEXPAND | VM_DONTDUMP.

    remap_pfn_range() and io_remap_pfn_range() set VM_IO|VM_DONTEXPAND|VM_DONTDUMP.
    remap_vmalloc_range() set VM_DONTEXPAND | VM_DONTDUMP.

    [akpm@linux-foundation.org: drivers/vfio/pci/vfio_pci.c fixup]
    Signed-off-by: Konstantin Khlebnikov
    Cc: Alexander Viro
    Cc: Carsten Otte
    Cc: Chris Metcalf
    Cc: Cyrill Gorcunov
    Cc: Eric Paris
    Cc: H. Peter Anvin
    Cc: Hugh Dickins
    Cc: Ingo Molnar
    Cc: James Morris
    Cc: Jason Baron
    Cc: Kentaro Takeda
    Cc: Matt Helsley
    Cc: Nick Piggin
    Cc: Oleg Nesterov
    Cc: Peter Zijlstra
    Cc: Robert Richter
    Cc: Suresh Siddha
    Cc: Tetsuo Handa
    Cc: Venkatesh Pallipadi
    Acked-by: Linus Torvalds
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Konstantin Khlebnikov
     

11 Sep, 2012

1 commit


07 Sep, 2012

1 commit


06 Sep, 2012

1 commit

  • PRIVCMD_MMAPBATCH_V2 extends PRIVCMD_MMAPBATCH with an additional
    field for reporting the error code for every frame that could not be
    mapped. libxc prefers PRIVCMD_MMAPBATCH_V2 over PRIVCMD_MMAPBATCH.

    Also expand PRIVCMD_MMAPBATCH to return appropriate error-encoding top nibble
    in the mfn array.

    Signed-off-by: David Vrabel
    Signed-off-by: Andres Lagar-Cavilla
    Signed-off-by: Konrad Rzeszutek Wilk

    Andres Lagar-Cavilla
     

23 Aug, 2012

1 commit

  • This patch removes the "return -ENOSYS" for auto_translated_physmap
    guests from privcmd_mmap, thus it allows ARM guests to issue privcmd
    mmap calls. However privcmd mmap calls are still going to fail for HVM
    and hybrid guests on x86 because the xen_remap_domain_mfn_range
    implementation is currently PV only.

    Changes in v2:

    - better commit message;
    - return -EINVAL from xen_remap_domain_mfn_range if
    auto_translated_physmap.

    Signed-off-by: Stefano Stabellini
    Acked-by: Konrad Rzeszutek Wilk
    Signed-off-by: Konrad Rzeszutek Wilk

    Stefano Stabellini
     

17 Dec, 2011

2 commits