mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
pvh dom0: make xsm_map_gmfn_foreign available for x86
In this patch we make xsm_map_gmfn_foreign available for x86 also. This is used in the next patch "pvh dom0: Add and remove foreign pages" in function p2m_add_foreign. Signed-off-by: Mukesh Rathor <mukesh.rathor@oracle.com> Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
This commit is contained in:
1 parent
243cebb3df
commit
b37bb2bfc2
4 files changed
+19
-33
No files matched your search
@@ -477,6 +477,12 @@ static XSM_INLINE int xsm_remove_from_physmap(XSM_DEFAULT_ARG struct domain *d1,
|
||||
return xsm_default_action(action, d1, d2);
|
||||
}
|
||||
|
||||
static XSM_INLINE int xsm_map_gmfn_foreign(XSM_DEFAULT_ARG struct domain *d, struct domain *t)
|
||||
{
|
||||
XSM_ASSERT_ACTION(XSM_TARGET);
|
||||
return xsm_default_action(action, d, t);
|
||||
}
|
||||
|
||||
static XSM_INLINE int xsm_hvm_param(XSM_DEFAULT_ARG struct domain *d, unsigned long op)
|
||||
{
|
||||
XSM_ASSERT_ACTION(XSM_TARGET);
|
||||
@@ -624,11 +630,3 @@ static XSM_INLINE int xsm_ioport_mapping(XSM_DEFAULT_ARG struct domain *d, uint3
|
||||
}
|
||||
|
||||
#endif /* CONFIG_X86 */
|
||||
|
||||
#ifdef CONFIG_ARM
|
||||
static XSM_INLINE int xsm_map_gmfn_foreign(XSM_DEFAULT_ARG struct domain *d, struct domain *t)
|
||||
{
|
||||
XSM_ASSERT_ACTION(XSM_TARGET);
|
||||
return xsm_default_action(action, d, t);
|
||||
}
|
||||
#endif
|
||||
+6
-10
@@ -91,6 +91,7 @@ struct xsm_operations {
|
||||
int (*memory_pin_page) (struct domain *d1, struct domain *d2, struct page_info *page);
|
||||
int (*add_to_physmap) (struct domain *d1, struct domain *d2);
|
||||
int (*remove_from_physmap) (struct domain *d1, struct domain *d2);
|
||||
int (*map_gmfn_foreign) (struct domain *d, struct domain *t);
|
||||
int (*claim_pages) (struct domain *d);
|
||||
|
||||
int (*console_io) (struct domain *d, int cmd);
|
||||
@@ -166,9 +167,6 @@ struct xsm_operations {
|
||||
int (*ioport_permission) (struct domain *d, uint32_t s, uint32_t e, uint8_t allow);
|
||||
int (*ioport_mapping) (struct domain *d, uint32_t s, uint32_t e, uint8_t allow);
|
||||
#endif
|
||||
#ifdef CONFIG_ARM
|
||||
int (*map_gmfn_foreign) (struct domain *d, struct domain *t);
|
||||
#endif
|
||||
};
|
||||
|
||||
#ifdef XSM_ENABLE
|
||||
@@ -354,6 +352,11 @@ static inline int xsm_remove_from_physmap(xsm_default_t def, struct domain *d1,
|
||||
return xsm_ops->remove_from_physmap(d1, d2);
|
||||
}
|
||||
|
||||
static inline int xsm_map_gmfn_foreign (xsm_default_t def, struct domain *d, struct domain *t)
|
||||
{
|
||||
return xsm_ops->map_gmfn_foreign(d, t);
|
||||
}
|
||||
|
||||
static inline int xsm_claim_pages(xsm_default_t def, struct domain *d)
|
||||
{
|
||||
return xsm_ops->claim_pages(d);
|
||||
@@ -634,13 +637,6 @@ static inline int xsm_ioport_mapping (xsm_default_t def, struct domain *d, uint3
|
||||
}
|
||||
#endif /* CONFIG_X86 */
|
||||
|
||||
#ifdef CONFIG_ARM
|
||||
static inline int xsm_map_gmfn_foreign (xsm_default_t def, struct domain *d, struct domain *t)
|
||||
{
|
||||
return xsm_ops->map_gmfn_foreign(d, t);
|
||||
}
|
||||
#endif /* CONFIG_ARM */
|
||||
|
||||
#endif /* XSM_NO_WRAPPERS */
|
||||
|
||||
#ifdef CONFIG_MULTIBOOT
|
||||
|
||||
+1
-3
@@ -112,6 +112,7 @@ void xsm_fixup_ops (struct xsm_operations *ops)
|
||||
|
||||
set_to_dummy_if_null(ops, add_to_physmap);
|
||||
set_to_dummy_if_null(ops, remove_from_physmap);
|
||||
set_to_dummy_if_null(ops, map_gmfn_foreign);
|
||||
|
||||
#ifdef CONFIG_X86
|
||||
set_to_dummy_if_null(ops, do_mca);
|
||||
@@ -136,7 +137,4 @@ void xsm_fixup_ops (struct xsm_operations *ops)
|
||||
set_to_dummy_if_null(ops, ioport_permission);
|
||||
set_to_dummy_if_null(ops, ioport_mapping);
|
||||
#endif
|
||||
#ifdef CONFIG_ARM
|
||||
set_to_dummy_if_null(ops, map_gmfn_foreign);
|
||||
#endif
|
||||
}
|
||||
+6
-12
@@ -1078,6 +1078,11 @@ 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_map_gmfn_foreign(struct domain *d, struct domain *t)
|
||||
{
|
||||
return domain_has_perm(d, t, SECCLASS_MMU, MMU__MAP_READ | MMU__MAP_WRITE);
|
||||
}
|
||||
|
||||
static int flask_hvm_param(struct domain *d, unsigned long op)
|
||||
{
|
||||
u32 perm;
|
||||
@@ -1460,13 +1465,6 @@ static int flask_unbind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq
|
||||
}
|
||||
#endif /* CONFIG_X86 */
|
||||
|
||||
#ifdef CONFIG_ARM
|
||||
static int flask_map_gmfn_foreign(struct domain *d, struct domain *t)
|
||||
{
|
||||
return domain_has_perm(d, t, SECCLASS_MMU, MMU__MAP_READ | MMU__MAP_WRITE);
|
||||
}
|
||||
#endif
|
||||
|
||||
long do_flask_op(XEN_GUEST_HANDLE_PARAM(xsm_op_t) u_flask_op);
|
||||
int compat_flask_op(XEN_GUEST_HANDLE_PARAM(xsm_op_t) u_flask_op);
|
||||
|
||||
@@ -1548,7 +1546,7 @@ static struct xsm_operations flask_ops = {
|
||||
|
||||
.add_to_physmap = flask_add_to_physmap,
|
||||
.remove_from_physmap = flask_remove_from_physmap,
|
||||
|
||||
.map_gmfn_foreign = flask_map_gmfn_foreign,
|
||||
|
||||
#if defined(HAS_PASSTHROUGH) && defined(HAS_PCI)
|
||||
.get_device_group = flask_get_device_group,
|
||||
@@ -1580,10 +1578,6 @@ static struct xsm_operations flask_ops = {
|
||||
.ioport_permission = flask_ioport_permission,
|
||||
.ioport_mapping = flask_ioport_mapping,
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ARM
|
||||
.map_gmfn_foreign = flask_map_gmfn_foreign,
|
||||
#endif
|
||||
};
|
||||
|
||||
static __init int flask_init(void)
|
||||
|
||||