xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v6 0/5] introduce XENMEM_exchange_and_pin, XENMEM_unpin and XENMEM_pin
@ 2013-09-27 16:15 Stefano Stabellini
  2013-09-27 16:15 ` [PATCH v6 1/5] xen: move steal_page and donate_page to common code Stefano Stabellini
                   ` (4 more replies)
  0 siblings, 5 replies; 18+ messages in thread
From: Stefano Stabellini @ 2013-09-27 16:15 UTC (permalink / raw)
  To: xen-devel; +Cc: Tim Deegan, Ian Campbell, Stefano Stabellini

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(-)

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2013-09-30 15:27 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-27 16:15 [PATCH v6 0/5] introduce XENMEM_exchange_and_pin, XENMEM_unpin and XENMEM_pin Stefano Stabellini
2013-09-27 16:15 ` [PATCH v6 1/5] xen: move steal_page and donate_page to common code Stefano Stabellini
2013-09-30  7:26   ` Jan Beulich
2013-09-27 16:15 ` [PATCH v6 2/5] xen/arm: introduce a generic p2m walker and use it in p2m_lookup Stefano Stabellini
2013-09-27 16:15 ` [PATCH v6 3/5] xen: implement guest_physmap_pin_range and guest_physmap_unpin_range Stefano Stabellini
2013-09-27 16:15 ` [PATCH v6 4/5] xen: introduce XENMEM_exchange_and_pin and XENMEM_unpin Stefano Stabellini
2013-09-30  7:36   ` Jan Beulich
2013-09-30 12:30     ` Stefano Stabellini
2013-09-30 12:42       ` David Vrabel
2013-09-27 16:16 ` [PATCH v6 5/5] xen: introduce XENMEM_pin Stefano Stabellini
2013-09-30  7:41   ` Jan Beulich
2013-09-30 12:56     ` Stefano Stabellini
2013-09-30 13:02       ` Ian Campbell
2013-09-30 13:03       ` Tim Deegan
2013-09-30 13:53         ` Stefano Stabellini
2013-09-30 13:14       ` Jan Beulich
2013-09-30 14:31         ` Stefano Stabellini
2013-09-30 15:27           ` Jan Beulich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).