Commit 78c3097e authored by Keir Fraser's avatar Keir Fraser
Browse files

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: default avatarKeir Fraser <keir.fraser@citrix.com>
parent 2d2f7977
......@@ -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:
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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*/
......
......@@ -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
......
......@@ -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));
......
......@@ -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);
......
......@@ -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,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment