1. 10 Mar, 2011 3 commits
    • Daniel De Graaf's avatar
      xen/gntdev,gntalloc: Remove unneeded VM flags · d79647ae
      Daniel De Graaf authored
      The only time when granted pages need to be treated specially is when
      using Xen's PTE modification for grant mappings owned by another domain
      (that is, only gntdev on PV guests).  Otherwise, the area does not
      require VM_DONTCOPY and VM_PFNMAP, since it can be accessed just like
      any other page of RAM.
      
      Since the vm_operations_struct close operations decrement reference
      counts, a corresponding open function that increments them is required
      now that it is possible to have multiple references to a single area.
      
      We are careful in the gntdev to check if we can remove those flags. The
      reason that we need to be careful in gntdev on PV guests is because we are
      not changing the PFN/MFN mapping on PV; instead, we change the application's
      page tables to point to the other domain's memory. This means that the vma
      cannot be copied without using another grant mapping hypercall; it also
      requires special handling on unmap, which is the reason for gntdev's
      dependency on the MMU notifier.
      
      For gntalloc, this is not a concern - the pages are owned by the domain
      using the gntalloc device, and can be mapped and unmapped in the same manner
      as any other page of memory.
      Acked-by: default avatarIan Campbell <ian.campbell@citrix.com>
      Signed-off-by: default avatarDaniel De Graaf <dgdegra@tycho.nsa.gov>
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      [v2: Added in git commit "We are.." from email correspondence]
      d79647ae
    • Ian Campbell's avatar
      xen: gntdev: fix build warning · 38eaeb0f
      Ian Campbell authored
      addr is actually a virtual address so use an unsigned long. Fixes:
      
        CC      drivers/xen/gntdev.o
      drivers/xen/gntdev.c: In function 'map_grant_pages':
      drivers/xen/gntdev.c:268: warning: cast from pointer to integer of different size
      
      Reduce the scope of the variable at the same time.
      Signed-off-by: default avatarIan Campbell <ian.campbell@citrix.com>
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      38eaeb0f
    • Ian Campbell's avatar
      xen/p2m/m2p/gnttab: do not add failed grant maps to m2p override · dc4972a4
      Ian Campbell authored
      The caller will not undo a mapping which failed and therefore the
      override will not be removed.
      
      This is especially bad in the case of GNTMAP_contains_pte mapping type
      mappings where m2p_add_override will destroy the kernel mapping of the
      page.
      
      This was observed via a failure of map_grant_pages in gntdev_mmap (due
      to userspace using a bad grant reference), which left the page in
      question unmapped (because it was a GNTMAP_contains_pte mapping) which
      led to a crash later on.
      Signed-off-by: default avatarIan Campbell <ian.campbell@citrix.com>
      Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>
      Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
      Cc: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      dc4972a4
  2. 23 Feb, 2011 2 commits
  3. 16 Feb, 2011 1 commit
  4. 14 Feb, 2011 12 commits
  5. 08 Feb, 2011 1 commit
  6. 07 Feb, 2011 21 commits