[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH v6 0/5] introduce XENMEM_exchange_and_pin, XENMEM_unpin and XENMEM_pin



Hi all,
this patch series introduces three new hypercalls to allow autotranslate
guests to allocate a contiguous buffer in machine addresses.
The XENMEM_exchange_and_pin returns the mfns and makes sure to pin the
pages so that the hypervisor won't change their p2m mappings while in
use.
XENMEM_pin allows a guest to pin one or more pages whose machine
addresses respect the number of bits addressable by the caller as
expressed by the address_bits field.
XENMEM_unpin simply unpins the pages.

Cheers,

Stefano


Changes in v6:
- replace gdprintk with dprintk(XENLOG_G_ in donate_page;
- replace printk with dprintk(XENLOG_G_ in steal_page;
- remove casting of page_to_mfn to void*, use %lx instead;
- add "steal" to the steal_page gdprintk;
- replace 1 with (-PGC_count_mask & PGC_count_mask) in donate_page;
- improve p2m_walker description;
- cast 1UL to (paddr_t);
- handle the first level within the loop;
- use literal 1, 2, 3 for the levels;
- add missing continue in case of superpages;
- handle third level leaves with !table as errors;
- ASSERT second and third are not NULL after being mapped;
- guest_physmap_pin_range: check that the pages are normal r/w ram
pages;
- guest_physmap_unpin_range: return -EINVAL instead of -EBUSY if a page
is not pinned;
- use a count_info flag rather than using spare bits in the ptes;
- do not change error paths in memory_exchange;
- crash the guest on pinning failure;
- use the right op with hypercall_create_continuation;
- comments in public/memory.h should precede the #define;
- make unpin return int;
- improve the description of the new hypercalls;
- make sure to copy back the right value of nr_unpinned even on early
error paths;
- add a XENMEM_pin hypercall.

Changes in v5:
- move donate_page to common code;
- update commit message;
- align tests;
- comment p2m_walker;
- fix return codes in p2m_walker;
- handle superpages in p2m_walker;
- rename _p2m_lookup to p2m_lookup_f;
- return -EBUSY when the P2M_DMA_PIN check fails;
- rename _guest_physmap_pin_range to pin_one_pte;
- rename _guest_physmap_unpin_range to unpin_one_pte;
- memory_exchange: handle guest_physmap_pin_range failures;
- make i an unsigned long in unpinned;
- add nr_unpinned to xen_unpin to report partial success.

Changes in v4:
- move steal_page to common code;
- introduce a generic p2m walker and use it in p2m_lookup,
  guest_physmap_pin_range and guest_physmap_unpin_range;
- return -EINVAL when the P2M_DMA_PIN check fails;
- change the printk into a gdprintk;
- add a comment on what type of page can be pinned;
- rename XENMEM_get_dma_buf to XENMEM_exchange_and_pin;
- rename XENMEM_get_dma_buf to XENMEM_unpin;
- move the pinning before we copy back the mfn to the guest;
- propagate errors returned by guest_physmap_pin_range;
- use xen_memory_exchange_t as parameter for XENMEM_exchange_and_pin;
- use an unsigned iterator in unpin;
- improve the documentation of the new hypercalls;
- add a note about out.address_bits for XENMEM_exchange.

Changes in v3:
- implement guest_physmap_pin_range and guest_physmap_unpin_range on
  ARM;
- implement XENMEM_put_dma_buf.

Changes in v2:
- actually don't print the warning more than once.



Stefano Stabellini (5):
      xen: move steal_page and donate_page to common code
      xen/arm: introduce a generic p2m walker and use it in p2m_lookup
      xen: implement guest_physmap_pin_range and guest_physmap_unpin_range
      xen: introduce XENMEM_exchange_and_pin and XENMEM_unpin
      xen: introduce XENMEM_pin

 xen/arch/arm/mm.c           |   12 --
 xen/arch/arm/p2m.c          |  189 +++++++++++++++++++++++++----
 xen/arch/x86/mm.c           |   85 -------------
 xen/common/memory.c         |  278 ++++++++++++++++++++++++++++++++++++++++++-
 xen/include/asm-arm/mm.h    |   12 +-
 xen/include/asm-x86/mm.h    |    5 -
 xen/include/asm-x86/p2m.h   |   12 ++
 xen/include/public/memory.h |   85 +++++++++++++
 xen/include/xen/mm.h        |    3 +
 9 files changed, 545 insertions(+), 136 deletions(-)

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.