aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/xen/mmu.c
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>2010-12-17 12:17:32 -0500
committerJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>2011-07-18 18:43:27 -0400
commitdcf7435cfe617c9d9f3dd501d3f5ed4d0b30c218 (patch)
tree7fe6ea1d049d33f5a4ac31c4a8b66e2a1ea0d851 /arch/x86/xen/mmu.c
parentc8eed1719afb337472c5ef31ec590d549770b173 (diff)
xen/mmu: use extend_args for more mmuext updates
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Diffstat (limited to 'arch/x86/xen/mmu.c')
-rw-r--r--arch/x86/xen/mmu.c42
1 files changed, 27 insertions, 15 deletions
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
index c3abba17ab00..eb9112687cee 100644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -229,6 +229,24 @@ static void xen_extend_mmu_update(const struct mmu_update *update)
229 *u = *update; 229 *u = *update;
230} 230}
231 231
232static void xen_extend_mmuext_op(const struct mmuext_op *op)
233{
234 struct multicall_space mcs;
235 struct mmuext_op *u;
236
237 mcs = xen_mc_extend_args(__HYPERVISOR_mmuext_op, sizeof(*u));
238
239 if (mcs.mc != NULL) {
240 mcs.mc->args[1]++;
241 } else {
242 mcs = __xen_mc_entry(sizeof(*u));
243 MULTI_mmuext_op(mcs.mc, mcs.args, 1, NULL, DOMID_SELF);
244 }
245
246 u = mcs.args;
247 *u = *op;
248}
249
232static void xen_set_pmd_hyper(pmd_t *ptr, pmd_t val) 250static void xen_set_pmd_hyper(pmd_t *ptr, pmd_t val)
233{ 251{
234 struct mmu_update u; 252 struct mmu_update u;
@@ -810,14 +828,12 @@ static void xen_pte_unlock(void *v)
810 828
811static void xen_do_pin(unsigned level, unsigned long pfn) 829static void xen_do_pin(unsigned level, unsigned long pfn)
812{ 830{
813 struct mmuext_op *op; 831 struct mmuext_op op;
814 struct multicall_space mcs;
815 832
816 mcs = __xen_mc_entry(sizeof(*op)); 833 op.cmd = level;
817 op = mcs.args; 834 op.arg1.mfn = pfn_to_mfn(pfn);
818 op->cmd = level; 835
819 op->arg1.mfn = pfn_to_mfn(pfn); 836 xen_extend_mmuext_op(&op);
820 MULTI_mmuext_op(mcs.mc, op, 1, NULL, DOMID_SELF);
821} 837}
822 838
823static int xen_pin_page(struct mm_struct *mm, struct page *page, 839static int xen_pin_page(struct mm_struct *mm, struct page *page,
@@ -1307,8 +1323,7 @@ static void set_current_cr3(void *v)
1307 1323
1308static void __xen_write_cr3(bool kernel, unsigned long cr3) 1324static void __xen_write_cr3(bool kernel, unsigned long cr3)
1309{ 1325{
1310 struct mmuext_op *op; 1326 struct mmuext_op op;
1311 struct multicall_space mcs;
1312 unsigned long mfn; 1327 unsigned long mfn;
1313 1328
1314 trace_xen_mmu_write_cr3(kernel, cr3); 1329 trace_xen_mmu_write_cr3(kernel, cr3);
@@ -1320,13 +1335,10 @@ static void __xen_write_cr3(bool kernel, unsigned long cr3)
1320 1335
1321 WARN_ON(mfn == 0 && kernel); 1336 WARN_ON(mfn == 0 && kernel);
1322 1337
1323 mcs = __xen_mc_entry(sizeof(*op)); 1338 op.cmd = kernel ? MMUEXT_NEW_BASEPTR : MMUEXT_NEW_USER_BASEPTR;
1339 op.arg1.mfn = mfn;
1324 1340
1325 op = mcs.args; 1341 xen_extend_mmuext_op(&op);
1326 op->cmd = kernel ? MMUEXT_NEW_BASEPTR : MMUEXT_NEW_USER_BASEPTR;
1327 op->arg1.mfn = mfn;
1328
1329 MULTI_mmuext_op(mcs.mc, op, 1, NULL, DOMID_SELF);
1330 1342
1331 if (kernel) { 1343 if (kernel) {
1332 percpu_write(xen_cr3, cr3); 1344 percpu_write(xen_cr3, cr3);