summaryrefslogtreecommitdiffstats
path: root/include/xen
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-10-23 12:54:58 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2018-10-23 12:54:58 -0400
commitf682a7920baf7b721d01dd317f3b532265357cbb (patch)
tree253e96be2249d704424b153c58ba58c974a9e61d /include/xen
parent99792e0cea1ed733cdc8d0758677981e0cbebfed (diff)
parent3a025de64bf89c84a79909069e3c24ad9e710d27 (diff)
Merge branch 'x86-paravirt-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 paravirt updates from Ingo Molnar: "Two main changes: - Remove no longer used parts of the paravirt infrastructure and put large quantities of paravirt ops under a new config option PARAVIRT_XXL=y, which is selected by XEN_PV only. (Joergen Gross) - Enable PV spinlocks on Hyperv (Yi Sun)" * 'x86-paravirt-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/hyperv: Enable PV qspinlock for Hyper-V x86/hyperv: Add GUEST_IDLE_MSR support x86/paravirt: Clean up native_patch() x86/paravirt: Prevent redefinition of SAVE_FLAGS macro x86/xen: Make xen_reservation_lock static x86/paravirt: Remove unneeded mmu related paravirt ops bits x86/paravirt: Move the Xen-only pv_mmu_ops under the PARAVIRT_XXL umbrella x86/paravirt: Move the pv_irq_ops under the PARAVIRT_XXL umbrella x86/paravirt: Move the Xen-only pv_cpu_ops under the PARAVIRT_XXL umbrella x86/paravirt: Move items in pv_info under PARAVIRT_XXL umbrella x86/paravirt: Introduce new config option PARAVIRT_XXL x86/paravirt: Remove unused paravirt bits x86/paravirt: Use a single ops structure x86/paravirt: Remove clobbers from struct paravirt_patch_site x86/paravirt: Remove clobbers parameter from paravirt patch functions x86/paravirt: Make paravirt_patch_call() and paravirt_patch_jmp() static x86/xen: Add SPDX identifier in arch/x86/xen files x86/xen: Link platform-pci-unplug.o only if CONFIG_XEN_PVHVM x86/xen: Move pv specific parts of arch/x86/xen/mmu.c to mmu_pv.c x86/xen: Move pv irq related functions under CONFIG_XEN_PV umbrella
Diffstat (limited to 'include/xen')
-rw-r--r--include/xen/events.h2
-rw-r--r--include/xen/interface/memory.h6
-rw-r--r--include/xen/xen-ops.h133
3 files changed, 90 insertions, 51 deletions
diff --git a/include/xen/events.h b/include/xen/events.h
index c3e6bc643a7b..a48897199975 100644
--- a/include/xen/events.h
+++ b/include/xen/events.h
@@ -89,11 +89,13 @@ unsigned irq_from_evtchn(unsigned int evtchn);
89int irq_from_virq(unsigned int cpu, unsigned int virq); 89int irq_from_virq(unsigned int cpu, unsigned int virq);
90unsigned int evtchn_from_irq(unsigned irq); 90unsigned int evtchn_from_irq(unsigned irq);
91 91
92#ifdef CONFIG_XEN_PVHVM
92/* Xen HVM evtchn vector callback */ 93/* Xen HVM evtchn vector callback */
93void xen_hvm_callback_vector(void); 94void xen_hvm_callback_vector(void);
94#ifdef CONFIG_TRACING 95#ifdef CONFIG_TRACING
95#define trace_xen_hvm_callback_vector xen_hvm_callback_vector 96#define trace_xen_hvm_callback_vector xen_hvm_callback_vector
96#endif 97#endif
98#endif
97int xen_set_callback_via(uint64_t via); 99int xen_set_callback_via(uint64_t via);
98void xen_evtchn_do_upcall(struct pt_regs *regs); 100void xen_evtchn_do_upcall(struct pt_regs *regs);
99void xen_hvm_evtchn_do_upcall(void); 101void xen_hvm_evtchn_do_upcall(void);
diff --git a/include/xen/interface/memory.h b/include/xen/interface/memory.h
index 4c5751c26f87..447004861f00 100644
--- a/include/xen/interface/memory.h
+++ b/include/xen/interface/memory.h
@@ -245,12 +245,6 @@ DEFINE_GUEST_HANDLE_STRUCT(xen_memory_map);
245 245
246 246
247/* 247/*
248 * Prevent the balloon driver from changing the memory reservation
249 * during a driver critical region.
250 */
251extern spinlock_t xen_reservation_lock;
252
253/*
254 * Unmaps the page appearing at a particular GPFN from the specified guest's 248 * Unmaps the page appearing at a particular GPFN from the specified guest's
255 * pseudophysical address space. 249 * pseudophysical address space.
256 * arg == addr of xen_remove_from_physmap_t. 250 * arg == addr of xen_remove_from_physmap_t.
diff --git a/include/xen/xen-ops.h b/include/xen/xen-ops.h
index fd18c974a619..18803ff76e27 100644
--- a/include/xen/xen-ops.h
+++ b/include/xen/xen-ops.h
@@ -5,6 +5,7 @@
5#include <linux/percpu.h> 5#include <linux/percpu.h>
6#include <linux/notifier.h> 6#include <linux/notifier.h>
7#include <linux/efi.h> 7#include <linux/efi.h>
8#include <xen/features.h>
8#include <asm/xen/interface.h> 9#include <asm/xen/interface.h>
9#include <xen/interface/vcpu.h> 10#include <xen/interface/vcpu.h>
10 11
@@ -47,6 +48,10 @@ int xen_create_contiguous_region(phys_addr_t pstart, unsigned int order,
47 dma_addr_t *dma_handle); 48 dma_addr_t *dma_handle);
48 49
49void xen_destroy_contiguous_region(phys_addr_t pstart, unsigned int order); 50void xen_destroy_contiguous_region(phys_addr_t pstart, unsigned int order);
51
52int xen_remap_pfn(struct vm_area_struct *vma, unsigned long addr,
53 xen_pfn_t *pfn, int nr, int *err_ptr, pgprot_t prot,
54 unsigned int domid, bool no_translate, struct page **pages);
50#else 55#else
51static inline int xen_create_contiguous_region(phys_addr_t pstart, 56static inline int xen_create_contiguous_region(phys_addr_t pstart,
52 unsigned int order, 57 unsigned int order,
@@ -58,10 +63,50 @@ static inline int xen_create_contiguous_region(phys_addr_t pstart,
58 63
59static inline void xen_destroy_contiguous_region(phys_addr_t pstart, 64static inline void xen_destroy_contiguous_region(phys_addr_t pstart,
60 unsigned int order) { } 65 unsigned int order) { }
66
67static inline int xen_remap_pfn(struct vm_area_struct *vma, unsigned long addr,
68 xen_pfn_t *pfn, int nr, int *err_ptr,
69 pgprot_t prot, unsigned int domid,
70 bool no_translate, struct page **pages)
71{
72 BUG();
73 return 0;
74}
61#endif 75#endif
62 76
63struct vm_area_struct; 77struct vm_area_struct;
64 78
79#ifdef CONFIG_XEN_AUTO_XLATE
80int xen_xlate_remap_gfn_array(struct vm_area_struct *vma,
81 unsigned long addr,
82 xen_pfn_t *gfn, int nr,
83 int *err_ptr, pgprot_t prot,
84 unsigned int domid,
85 struct page **pages);
86int xen_xlate_unmap_gfn_range(struct vm_area_struct *vma,
87 int nr, struct page **pages);
88#else
89/*
90 * These two functions are called from arch/x86/xen/mmu.c and so stubs
91 * are needed for a configuration not specifying CONFIG_XEN_AUTO_XLATE.
92 */
93static inline int xen_xlate_remap_gfn_array(struct vm_area_struct *vma,
94 unsigned long addr,
95 xen_pfn_t *gfn, int nr,
96 int *err_ptr, pgprot_t prot,
97 unsigned int domid,
98 struct page **pages)
99{
100 return -EOPNOTSUPP;
101}
102
103static inline int xen_xlate_unmap_gfn_range(struct vm_area_struct *vma,
104 int nr, struct page **pages)
105{
106 return -EOPNOTSUPP;
107}
108#endif
109
65/* 110/*
66 * xen_remap_domain_gfn_array() - map an array of foreign frames by gfn 111 * xen_remap_domain_gfn_array() - map an array of foreign frames by gfn
67 * @vma: VMA to map the pages into 112 * @vma: VMA to map the pages into
@@ -79,12 +124,25 @@ struct vm_area_struct;
79 * Returns the number of successfully mapped frames, or a -ve error 124 * Returns the number of successfully mapped frames, or a -ve error
80 * code. 125 * code.
81 */ 126 */
82int xen_remap_domain_gfn_array(struct vm_area_struct *vma, 127static inline int xen_remap_domain_gfn_array(struct vm_area_struct *vma,
83 unsigned long addr, 128 unsigned long addr,
84 xen_pfn_t *gfn, int nr, 129 xen_pfn_t *gfn, int nr,
85 int *err_ptr, pgprot_t prot, 130 int *err_ptr, pgprot_t prot,
86 unsigned domid, 131 unsigned int domid,
87 struct page **pages); 132 struct page **pages)
133{
134 if (xen_feature(XENFEAT_auto_translated_physmap))
135 return xen_xlate_remap_gfn_array(vma, addr, gfn, nr, err_ptr,
136 prot, domid, pages);
137
138 /* We BUG_ON because it's a programmer error to pass a NULL err_ptr,
139 * and the consequences later is quite hard to detect what the actual
140 * cause of "wrong memory was mapped in".
141 */
142 BUG_ON(err_ptr == NULL);
143 return xen_remap_pfn(vma, addr, gfn, nr, err_ptr, prot, domid,
144 false, pages);
145}
88 146
89/* 147/*
90 * xen_remap_domain_mfn_array() - map an array of foreign frames by mfn 148 * xen_remap_domain_mfn_array() - map an array of foreign frames by mfn
@@ -103,10 +161,18 @@ int xen_remap_domain_gfn_array(struct vm_area_struct *vma,
103 * Returns the number of successfully mapped frames, or a -ve error 161 * Returns the number of successfully mapped frames, or a -ve error
104 * code. 162 * code.
105 */ 163 */
106int xen_remap_domain_mfn_array(struct vm_area_struct *vma, 164static inline int xen_remap_domain_mfn_array(struct vm_area_struct *vma,
107 unsigned long addr, xen_pfn_t *mfn, int nr, 165 unsigned long addr, xen_pfn_t *mfn,
108 int *err_ptr, pgprot_t prot, 166 int nr, int *err_ptr,
109 unsigned int domid, struct page **pages); 167 pgprot_t prot, unsigned int domid,
168 struct page **pages)
169{
170 if (xen_feature(XENFEAT_auto_translated_physmap))
171 return -EOPNOTSUPP;
172
173 return xen_remap_pfn(vma, addr, mfn, nr, err_ptr, prot, domid,
174 true, pages);
175}
110 176
111/* xen_remap_domain_gfn_range() - map a range of foreign frames 177/* xen_remap_domain_gfn_range() - map a range of foreign frames
112 * @vma: VMA to map the pages into 178 * @vma: VMA to map the pages into
@@ -120,44 +186,21 @@ int xen_remap_domain_mfn_array(struct vm_area_struct *vma,
120 * Returns the number of successfully mapped frames, or a -ve error 186 * Returns the number of successfully mapped frames, or a -ve error
121 * code. 187 * code.
122 */ 188 */
123int xen_remap_domain_gfn_range(struct vm_area_struct *vma, 189static inline int xen_remap_domain_gfn_range(struct vm_area_struct *vma,
124 unsigned long addr, 190 unsigned long addr,
125 xen_pfn_t gfn, int nr, 191 xen_pfn_t gfn, int nr,
126 pgprot_t prot, unsigned domid, 192 pgprot_t prot, unsigned int domid,
127 struct page **pages); 193 struct page **pages)
128int xen_unmap_domain_gfn_range(struct vm_area_struct *vma,
129 int numpgs, struct page **pages);
130
131#ifdef CONFIG_XEN_AUTO_XLATE
132int xen_xlate_remap_gfn_array(struct vm_area_struct *vma,
133 unsigned long addr,
134 xen_pfn_t *gfn, int nr,
135 int *err_ptr, pgprot_t prot,
136 unsigned domid,
137 struct page **pages);
138int xen_xlate_unmap_gfn_range(struct vm_area_struct *vma,
139 int nr, struct page **pages);
140#else
141/*
142 * These two functions are called from arch/x86/xen/mmu.c and so stubs
143 * are needed for a configuration not specifying CONFIG_XEN_AUTO_XLATE.
144 */
145static inline int xen_xlate_remap_gfn_array(struct vm_area_struct *vma,
146 unsigned long addr,
147 xen_pfn_t *gfn, int nr,
148 int *err_ptr, pgprot_t prot,
149 unsigned int domid,
150 struct page **pages)
151{ 194{
152 return -EOPNOTSUPP; 195 if (xen_feature(XENFEAT_auto_translated_physmap))
153} 196 return -EOPNOTSUPP;
154 197
155static inline int xen_xlate_unmap_gfn_range(struct vm_area_struct *vma, 198 return xen_remap_pfn(vma, addr, &gfn, nr, NULL, prot, domid, false,
156 int nr, struct page **pages) 199 pages);
157{
158 return -EOPNOTSUPP;
159} 200}
160#endif 201
202int xen_unmap_domain_gfn_range(struct vm_area_struct *vma,
203 int numpgs, struct page **pages);
161 204
162int xen_xlate_map_ballooned_pages(xen_pfn_t **pfns, void **vaddr, 205int xen_xlate_map_ballooned_pages(xen_pfn_t **pfns, void **vaddr,
163 unsigned long nr_grant_frames); 206 unsigned long nr_grant_frames);