diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-12 12:09:41 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-12 12:09:41 -0400 |
commit | 26f0cf91813bdc8e61595f8ad6660251e2ee9cf6 (patch) | |
tree | db129d45fba03e3e59392410d0f35ba7d3e438e6 /include/xen/interface | |
parent | d862b13bc8cbab9692fbe0ef44c40d0488b81af1 (diff) | |
parent | fe96eb404e33b59bb39f7050205f7c56c1c7d686 (diff) |
Merge branch 'stable/xen-swiotlb-0.8.6' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen
* 'stable/xen-swiotlb-0.8.6' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
x86: Detect whether we should use Xen SWIOTLB.
pci-swiotlb-xen: Add glue code to setup dma_ops utilizing xen_swiotlb_* functions.
swiotlb-xen: SWIOTLB library for Xen PV guest with PCI passthrough.
xen/mmu: inhibit vmap aliases rather than trying to clear them out
vmap: add flag to allow lazy unmap to be disabled at runtime
xen: Add xen_create_contiguous_region
xen: Rename the balloon lock
xen: Allow unprivileged Xen domains to create iomap pages
xen: use _PAGE_IOMAP in ioremap to do machine mappings
Fix up trivial conflicts (adding both xen swiotlb and xen pci platform
driver setup close to each other) in drivers/xen/{Kconfig,Makefile} and
include/xen/xen-ops.h
Diffstat (limited to 'include/xen/interface')
-rw-r--r-- | include/xen/interface/memory.h | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/include/xen/interface/memory.h b/include/xen/interface/memory.h index af36ead16817..d3938d3e71f8 100644 --- a/include/xen/interface/memory.h +++ b/include/xen/interface/memory.h | |||
@@ -9,6 +9,8 @@ | |||
9 | #ifndef __XEN_PUBLIC_MEMORY_H__ | 9 | #ifndef __XEN_PUBLIC_MEMORY_H__ |
10 | #define __XEN_PUBLIC_MEMORY_H__ | 10 | #define __XEN_PUBLIC_MEMORY_H__ |
11 | 11 | ||
12 | #include <linux/spinlock.h> | ||
13 | |||
12 | /* | 14 | /* |
13 | * Increase or decrease the specified domain's memory reservation. Returns a | 15 | * Increase or decrease the specified domain's memory reservation. Returns a |
14 | * -ve errcode on failure, or the # extents successfully allocated or freed. | 16 | * -ve errcode on failure, or the # extents successfully allocated or freed. |
@@ -53,6 +55,48 @@ struct xen_memory_reservation { | |||
53 | DEFINE_GUEST_HANDLE_STRUCT(xen_memory_reservation); | 55 | DEFINE_GUEST_HANDLE_STRUCT(xen_memory_reservation); |
54 | 56 | ||
55 | /* | 57 | /* |
58 | * An atomic exchange of memory pages. If return code is zero then | ||
59 | * @out.extent_list provides GMFNs of the newly-allocated memory. | ||
60 | * Returns zero on complete success, otherwise a negative error code. | ||
61 | * On complete success then always @nr_exchanged == @in.nr_extents. | ||
62 | * On partial success @nr_exchanged indicates how much work was done. | ||
63 | */ | ||
64 | #define XENMEM_exchange 11 | ||
65 | struct xen_memory_exchange { | ||
66 | /* | ||
67 | * [IN] Details of memory extents to be exchanged (GMFN bases). | ||
68 | * Note that @in.address_bits is ignored and unused. | ||
69 | */ | ||
70 | struct xen_memory_reservation in; | ||
71 | |||
72 | /* | ||
73 | * [IN/OUT] Details of new memory extents. | ||
74 | * We require that: | ||
75 | * 1. @in.domid == @out.domid | ||
76 | * 2. @in.nr_extents << @in.extent_order == | ||
77 | * @out.nr_extents << @out.extent_order | ||
78 | * 3. @in.extent_start and @out.extent_start lists must not overlap | ||
79 | * 4. @out.extent_start lists GPFN bases to be populated | ||
80 | * 5. @out.extent_start is overwritten with allocated GMFN bases | ||
81 | */ | ||
82 | struct xen_memory_reservation out; | ||
83 | |||
84 | /* | ||
85 | * [OUT] Number of input extents that were successfully exchanged: | ||
86 | * 1. The first @nr_exchanged input extents were successfully | ||
87 | * deallocated. | ||
88 | * 2. The corresponding first entries in the output extent list correctly | ||
89 | * indicate the GMFNs that were successfully exchanged. | ||
90 | * 3. All other input and output extents are untouched. | ||
91 | * 4. If not all input exents are exchanged then the return code of this | ||
92 | * command will be non-zero. | ||
93 | * 5. THIS FIELD MUST BE INITIALISED TO ZERO BY THE CALLER! | ||
94 | */ | ||
95 | unsigned long nr_exchanged; | ||
96 | }; | ||
97 | |||
98 | DEFINE_GUEST_HANDLE_STRUCT(xen_memory_exchange); | ||
99 | /* | ||
56 | * Returns the maximum machine frame number of mapped RAM in this system. | 100 | * Returns the maximum machine frame number of mapped RAM in this system. |
57 | * This command always succeeds (it never returns an error code). | 101 | * This command always succeeds (it never returns an error code). |
58 | * arg == NULL. | 102 | * arg == NULL. |
@@ -142,4 +186,10 @@ struct xen_translate_gpfn_list { | |||
142 | }; | 186 | }; |
143 | DEFINE_GUEST_HANDLE_STRUCT(xen_translate_gpfn_list); | 187 | DEFINE_GUEST_HANDLE_STRUCT(xen_translate_gpfn_list); |
144 | 188 | ||
189 | |||
190 | /* | ||
191 | * Prevent the balloon driver from changing the memory reservation | ||
192 | * during a driver critical region. | ||
193 | */ | ||
194 | extern spinlock_t xen_reservation_lock; | ||
145 | #endif /* __XEN_PUBLIC_MEMORY_H__ */ | 195 | #endif /* __XEN_PUBLIC_MEMORY_H__ */ |