1. 10 3月, 2011 3 次提交
    • D
      xen/gntdev,gntalloc: Remove unneeded VM flags · d79647ae
      Daniel De Graaf 提交于
      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: NIan Campbell <ian.campbell@citrix.com>
      Signed-off-by: NDaniel De Graaf <dgdegra@tycho.nsa.gov>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      [v2: Added in git commit "We are.." from email correspondence]
      d79647ae
    • I
      xen: gntdev: fix build warning · 38eaeb0f
      Ian Campbell 提交于
      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: NIan Campbell <ian.campbell@citrix.com>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      38eaeb0f
    • I
      xen/p2m/m2p/gnttab: do not add failed grant maps to m2p override · dc4972a4
      Ian Campbell 提交于
      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: NIan 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: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      dc4972a4
  2. 23 2月, 2011 2 次提交
  3. 16 2月, 2011 1 次提交
  4. 15 2月, 2011 12 次提交
  5. 08 2月, 2011 12 次提交
  6. 07 2月, 2011 10 次提交