|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH v2 3/6] xen/x86: rename cache_flush_permitted() to has_arch_io_resources()
To better describe the underlying implementation. Define
cache_flush_permitted() as an alias of has_arch_io_resources(), so that
current users of cache_flush_permitted() are not effectively modified.
With the introduction of the new handler, change some of the call sites of
cache_flush_permitted() to instead use has_arch_io_resources() as such
callers are not after whether cache flush is enabled, but rather whether
the domain has any IO resources assigned.
No functional change intended.
Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
Changes since v1:
- Drop adjustment to l1_disallow_mask().
---
xen/arch/x86/include/asm/iocap.h | 4 +++-
xen/arch/x86/mm/p2m-pod.c | 4 ++--
xen/common/memory.c | 2 +-
xen/include/asm-generic/iocap.h | 4 +++-
4 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/xen/arch/x86/include/asm/iocap.h b/xen/arch/x86/include/asm/iocap.h
index 53d87ae8a334..61d026dbf5f6 100644
--- a/xen/arch/x86/include/asm/iocap.h
+++ b/xen/arch/x86/include/asm/iocap.h
@@ -15,10 +15,12 @@
#define ioports_access_permitted(d, s, e) \
rangeset_contains_range((d)->arch.ioport_caps, s, e)
-#define cache_flush_permitted(d) \
+#define has_arch_io_resources(d) \
(!rangeset_is_empty((d)->iomem_caps) || \
!rangeset_is_empty((d)->arch.ioport_caps))
+#define cache_flush_permitted has_arch_io_resources
+
static inline int ioports_permit_access(struct domain *d, unsigned long s,
unsigned long e)
{
diff --git a/xen/arch/x86/mm/p2m-pod.c b/xen/arch/x86/mm/p2m-pod.c
index df2a1cc0749b..05633fe2ac88 100644
--- a/xen/arch/x86/mm/p2m-pod.c
+++ b/xen/arch/x86/mm/p2m-pod.c
@@ -338,7 +338,7 @@ p2m_pod_set_mem_target(struct domain *d, unsigned long
target)
ASSERT( pod_target >= p2m->pod.count );
- if ( has_arch_pdevs(d) || cache_flush_permitted(d) )
+ if ( has_arch_pdevs(d) || has_arch_io_resources(d) )
ret = -ENOTEMPTY;
else
ret = p2m_pod_set_cache_target(p2m, pod_target, 1/*preemptible*/);
@@ -1395,7 +1395,7 @@ guest_physmap_mark_populate_on_demand(struct domain *d,
unsigned long gfn,
if ( !paging_mode_translate(d) )
return -EINVAL;
- if ( has_arch_pdevs(d) || cache_flush_permitted(d) )
+ if ( has_arch_pdevs(d) || has_arch_io_resources(d) )
return -ENOTEMPTY;
do {
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 8ca4e1a8425b..46620ed8253d 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -86,7 +86,7 @@ static unsigned int max_order(const struct domain *d)
unsigned int order = domu_max_order;
#ifdef CONFIG_HAS_PASSTHROUGH
- if ( cache_flush_permitted(d) && order < ptdom_max_order )
+ if ( has_arch_io_resources(d) && order < ptdom_max_order )
order = ptdom_max_order;
#endif
diff --git a/xen/include/asm-generic/iocap.h b/xen/include/asm-generic/iocap.h
index dd7cb45488f7..664bbc8971fe 100644
--- a/xen/include/asm-generic/iocap.h
+++ b/xen/include/asm-generic/iocap.h
@@ -2,9 +2,11 @@
#ifndef __ASM_GENERIC_IOCAP_H__
#define __ASM_GENERIC_IOCAP_H__
-#define cache_flush_permitted(d) \
+#define has_arch_io_resources(d) \
(!rangeset_is_empty((d)->iomem_caps))
+#define cache_flush_permitted has_arch_io_resources
+
#endif /* __ASM_GENERIC_IOCAP_H__ */
/*
--
2.48.1
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |