1. 21 12月, 2011 1 次提交
  2. 22 11月, 2011 1 次提交
  3. 17 11月, 2011 1 次提交
  4. 14 10月, 2011 1 次提交
    • D
      xen/gntdev: Fix sleep-inside-spinlock · 1f1503ba
      Daniel De Graaf 提交于
      BUG: sleeping function called from invalid context at /local/scratch/dariof/linux/kernel/mutex.c:271
      in_atomic(): 1, irqs_disabled(): 0, pid: 3256, name: qemu-dm
      1 lock held by qemu-dm/3256:
       #0:  (&(&priv->lock)->rlock){......}, at: [<ffffffff813223da>] gntdev_ioctl+0x2bd/0x4d5
      Pid: 3256, comm: qemu-dm Tainted: G        W   3.1.0-rc8+ #5
      Call Trace:
       [<ffffffff81054594>] __might_sleep+0x131/0x135
       [<ffffffff816bd64f>] mutex_lock_nested+0x25/0x45
       [<ffffffff8131c7c8>] free_xenballooned_pages+0x20/0xb1
       [<ffffffff8132194d>] gntdev_put_map+0xa8/0xdb
       [<ffffffff816be546>] ? _raw_spin_lock+0x71/0x7a
       [<ffffffff813223da>] ? gntdev_ioctl+0x2bd/0x4d5
       [<ffffffff8132243c>] gntdev_ioctl+0x31f/0x4d5
       [<ffffffff81007d62>] ? check_events+0x12/0x20
       [<ffffffff811433bc>] do_vfs_ioctl+0x488/0x4d7
       [<ffffffff81007d4f>] ? xen_restore_fl_direct_reloc+0x4/0x4
       [<ffffffff8109168b>] ? lock_release+0x21c/0x229
       [<ffffffff81135cdd>] ? rcu_read_unlock+0x21/0x32
       [<ffffffff81143452>] sys_ioctl+0x47/0x6a
       [<ffffffff816bfd82>] system_call_fastpath+0x16/0x1b
      
      gntdev_put_map tries to acquire a mutex when freeing pages back to the
      xenballoon pool, so it cannot be called with a spinlock held. In
      gntdev_release, the spinlock is not needed as we are freeing the
      structure later; in the ioctl, only the list manipulation needs to be
      under the lock.
      Reported-and-Tested-By: NDario Faggioli <dario.faggioli@citrix.com>
      Signed-off-by: NDaniel De Graaf <dgdegra@tycho.nsa.gov>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      1f1503ba
  5. 29 9月, 2011 2 次提交
    • S
      xen: modify kernel mappings corresponding to granted pages · 0930bba6
      Stefano Stabellini 提交于
      If we want to use granted pages for AIO, changing the mappings of a user
      vma and the corresponding p2m is not enough, we also need to update the
      kernel mappings accordingly.
      Currently this is only needed for pages that are created for user usages
      through /dev/xen/gntdev. As in, pages that have been in use by the
      kernel and use the P2M will not need this special mapping.
      However there are no guarantees that in the future the kernel won't
      start accessing pages through the 1:1 even for internal usage.
      
      In order to avoid the complexity of dealing with highmem, we allocated
      the pages lowmem.
      We issue a HYPERVISOR_grant_table_op right away in
      m2p_add_override and we remove the mappings using another
      HYPERVISOR_grant_table_op in m2p_remove_override.
      Considering that m2p_add_override and m2p_remove_override are called
      once per page we use multicalls and hypercall batching.
      
      Use the kmap_op pointer directly as argument to do the mapping as it is
      guaranteed to be present up until the unmapping is done.
      Before issuing any unmapping multicalls, we need to make sure that the
      mapping has already being done, because we need the kmap->handle to be
      set correctly.
      Signed-off-by: NStefano Stabellini <stefano.stabellini@eu.citrix.com>
      [v1: Removed GRANT_FRAME_BIT usage]
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      0930bba6
    • S
      xen: add an "highmem" parameter to alloc_xenballooned_pages · 693394b8
      Stefano Stabellini 提交于
      Add an highmem parameter to alloc_xenballooned_pages, to allow callers to
      request lowmem or highmem pages.
      
      Fix the code style of free_xenballooned_pages' prototype.
      Signed-off-by: NStefano Stabellini <stefano.stabellini@eu.citrix.com>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      693394b8
  6. 27 7月, 2011 1 次提交
  7. 24 3月, 2011 2 次提交
  8. 16 3月, 2011 1 次提交
  9. 10 3月, 2011 2 次提交
    • 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
  10. 23 2月, 2011 2 次提交
  11. 15 2月, 2011 11 次提交
  12. 12 1月, 2011 6 次提交