From 78c3097e4ff6901f74ea6f088ab44bd5b3aa42b7 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Wed, 14 Jan 2009 11:24:37 +0000 Subject: [PATCH] Remove unused XENMEM_remove_from_physmap. Never present in any stable release of Xen. Introduced for use by qemu-dm but now not needed. Signed-off-by: Keir Fraser --- tools/libxc/xc_private.c | 10 ---------- xen/arch/ia64/xen/mm.c | 28 ---------------------------- xen/arch/x86/mm.c | 33 --------------------------------- xen/arch/x86/x86_64/compat/mm.c | 14 -------------- xen/include/public/memory.h | 16 ---------------- xen/include/xlat.lst | 1 - xen/include/xsm/xsm.h | 6 ------ xen/xsm/dummy.c | 5 ----- xen/xsm/flask/hooks.c | 6 ------ 9 files changed, 119 deletions(-) diff --git a/tools/libxc/xc_private.c b/tools/libxc/xc_private.c index e0613b9e4f..99589beaf8 100644 --- a/tools/libxc/xc_private.c +++ b/tools/libxc/xc_private.c @@ -307,13 +307,6 @@ int xc_memory_op(int xc_handle, goto out1; } break; - case XENMEM_remove_from_physmap: - if ( lock_pages(arg, sizeof(struct xen_remove_from_physmap)) ) - { - PERROR("Could not lock"); - goto out1; - } - break; case XENMEM_current_reservation: case XENMEM_maximum_reservation: case XENMEM_maximum_gpfn: @@ -355,9 +348,6 @@ int xc_memory_op(int xc_handle, case XENMEM_add_to_physmap: unlock_pages(arg, sizeof(struct xen_add_to_physmap)); break; - case XENMEM_remove_from_physmap: - unlock_pages(arg, sizeof(struct xen_remove_from_physmap)); - break; case XENMEM_current_reservation: case XENMEM_maximum_reservation: case XENMEM_maximum_gpfn: diff --git a/xen/arch/ia64/xen/mm.c b/xen/arch/ia64/xen/mm.c index 1213f7de96..0483ce40f1 100644 --- a/xen/arch/ia64/xen/mm.c +++ b/xen/arch/ia64/xen/mm.c @@ -3380,34 +3380,6 @@ arch_memory_op(int op, XEN_GUEST_HANDLE(void) arg) break; } - case XENMEM_remove_from_physmap: - { - struct xen_remove_from_physmap xrfp; - unsigned long mfn; - struct domain *d; - - if ( copy_from_guest(&xrfp, arg, 1) ) - return -EFAULT; - - rc = rcu_lock_target_domain_by_id(xrfp.domid, &d); - if ( rc != 0 ) - return rc; - - domain_lock(d); - - mfn = gmfn_to_mfn(d, xrfp.gpfn); - - if ( mfn_valid(mfn) ) - guest_physmap_remove_page(d, xrfp.gpfn, mfn, 0); - - domain_unlock(d); - - rcu_unlock_domain(d); - - break; - } - - case XENMEM_machine_memory_map: { struct xen_memory_map memmap; diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c index 142b9f1efb..13bffee00b 100644 --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -3860,39 +3860,6 @@ long arch_memory_op(int op, XEN_GUEST_HANDLE(void) arg) break; } - case XENMEM_remove_from_physmap: - { - struct xen_remove_from_physmap xrfp; - unsigned long mfn; - struct domain *d; - - if ( copy_from_guest(&xrfp, arg, 1) ) - return -EFAULT; - - rc = rcu_lock_target_domain_by_id(xrfp.domid, &d); - if ( rc != 0 ) - return rc; - - if ( xsm_remove_from_physmap(current->domain, d) ) - { - rcu_unlock_domain(d); - return -EPERM; - } - - domain_lock(d); - - mfn = gmfn_to_mfn(d, xrfp.gpfn); - - if ( mfn_valid(mfn) ) - guest_physmap_remove_page(d, xrfp.gpfn, mfn, 0); - - domain_unlock(d); - - rcu_unlock_domain(d); - - break; - } - case XENMEM_set_memory_map: { struct xen_foreign_memory_map fmap; diff --git a/xen/arch/x86/x86_64/compat/mm.c b/xen/arch/x86/x86_64/compat/mm.c index e14f6fab31..0ac685f366 100644 --- a/xen/arch/x86/x86_64/compat/mm.c +++ b/xen/arch/x86/x86_64/compat/mm.c @@ -69,20 +69,6 @@ int compat_arch_memory_op(int op, XEN_GUEST_HANDLE(void) arg) break; } - case XENMEM_remove_from_physmap: - { - struct compat_remove_from_physmap cmp; - struct xen_remove_from_physmap *nat = (void *)COMPAT_ARG_XLAT_VIRT_BASE; - - if ( copy_from_guest(&cmp, arg, 1) ) - return -EFAULT; - - XLAT_remove_from_physmap(nat, &cmp); - rc = arch_memory_op(op, guest_handle_from_ptr(nat, void)); - - break; - } - case XENMEM_set_memory_map: { struct compat_foreign_memory_map cmp; diff --git a/xen/include/public/memory.h b/xen/include/public/memory.h index 5ba7d33eb9..f0f502c3ee 100644 --- a/xen/include/public/memory.h +++ b/xen/include/public/memory.h @@ -219,22 +219,6 @@ struct xen_add_to_physmap { typedef struct xen_add_to_physmap xen_add_to_physmap_t; DEFINE_XEN_GUEST_HANDLE(xen_add_to_physmap_t); -/* - * Unmaps the page appearing at a particular GPFN from the specified guest's - * pseudophysical address space. - * arg == addr of xen_remove_from_physmap_t. - */ -#define XENMEM_remove_from_physmap 15 -struct xen_remove_from_physmap { - /* Which domain to change the mapping for. */ - domid_t domid; - - /* GPFN of the current mapping of the page. */ - xen_pfn_t gpfn; -}; -typedef struct xen_remove_from_physmap xen_remove_from_physmap_t; -DEFINE_XEN_GUEST_HANDLE(xen_remove_from_physmap_t); - /*** REMOVED ***/ /*#define XENMEM_translate_gpfn_list 8*/ diff --git a/xen/include/xlat.lst b/xen/include/xlat.lst index c780bfe02a..17f47e91ed 100644 --- a/xen/include/xlat.lst +++ b/xen/include/xlat.lst @@ -33,7 +33,6 @@ ! kexec_image kexec.h ! kexec_range kexec.h ! add_to_physmap memory.h -! remove_from_physmap memory.h ! foreign_memory_map memory.h ! memory_exchange memory.h ! memory_map memory.h diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h index 6f2d233085..e5e15d5342 100644 --- a/xen/include/xsm/xsm.h +++ b/xen/include/xsm/xsm.h @@ -142,7 +142,6 @@ struct xsm_operations { int (*update_va_mapping) (struct domain *d, struct domain *f, l1_pgentry_t pte); int (*add_to_physmap) (struct domain *d1, struct domain *d2); - int (*remove_from_physmap) (struct domain *d1, struct domain *d2); int (*sendtrigger) (struct domain *d); int (*test_assign_device) (uint32_t machine_bdf); int (*assign_device) (struct domain *d, uint32_t machine_bdf); @@ -578,11 +577,6 @@ static inline int xsm_add_to_physmap(struct domain *d1, struct domain *d2) return xsm_call(add_to_physmap(d1, d2)); } -static inline int xsm_remove_from_physmap(struct domain *d1, struct domain *d2) -{ - return xsm_call(remove_from_physmap(d1, d2)); -} - static inline int xsm_sendtrigger(struct domain *d) { return xsm_call(sendtrigger(d)); diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c index 9e94724e21..8809828b7f 100644 --- a/xen/xsm/dummy.c +++ b/xen/xsm/dummy.c @@ -452,10 +452,6 @@ static int dummy_ext_vcpucontext (struct domain *d, uint32_t cmd) return 0; } -static int dummy_remove_from_physmap (struct domain *d1, struct domain *d2) -{ - return 0; -} #endif struct xsm_operations dummy_xsm_ops; @@ -562,7 +558,6 @@ void xsm_fixup_ops (struct xsm_operations *ops) set_to_dummy_if_null(ops, mmu_machphys_update); set_to_dummy_if_null(ops, update_va_mapping); set_to_dummy_if_null(ops, add_to_physmap); - set_to_dummy_if_null(ops, remove_from_physmap); set_to_dummy_if_null(ops, sendtrigger); set_to_dummy_if_null(ops, test_assign_device); set_to_dummy_if_null(ops, assign_device); diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c index 527a83c874..0499d79bc4 100644 --- a/xen/xsm/flask/hooks.c +++ b/xen/xsm/flask/hooks.c @@ -1057,11 +1057,6 @@ static int flask_add_to_physmap(struct domain *d1, struct domain *d2) return domain_has_perm(d1, d2, SECCLASS_MMU, MMU__PHYSMAP); } -static int flask_remove_from_physmap(struct domain *d1, struct domain *d2) -{ - return domain_has_perm(d1, d2, SECCLASS_MMU, MMU__PHYSMAP); -} - static int flask_sendtrigger(struct domain *d) { return domain_has_perm(current->domain, d, SECCLASS_DOMAIN, DOMAIN__TRIGGER); @@ -1310,7 +1305,6 @@ static struct xsm_operations flask_ops = { .mmu_machphys_update = flask_mmu_machphys_update, .update_va_mapping = flask_update_va_mapping, .add_to_physmap = flask_add_to_physmap, - .remove_from_physmap = flask_remove_from_physmap, .sendtrigger = flask_sendtrigger, .test_assign_device = flask_test_assign_device, .assign_device = flask_assign_device, -- 2.39.5