xen/x86: account for assigned PCI devices in cache_flush_permitted()

While unlikely, it's possible for PCI devices to not have any IO resources
assigned, yet in such case the owner domain might still need to issue cache
control operations in case the device performs DMA requests.

Adjust cache_flush_permitted() to account for has_arch_pdevs().

While there also switch l1_disallow_mask() to use cache_flush_permitted().
This should be a non-functional change after the adjustment done to
cache_flush_permitted().

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
This commit is contained in:
Roger Pau Monne committed 2025-05-20 16:35:52 +02:00
1 parent 58c227fcb2
commit 8333e358e4
2 files changed
+3 -4

No files matched your search

+2 -1
View File
@@ -19,7 +19,8 @@
(!rangeset_is_empty((d)->iomem_caps) || \
!rangeset_is_empty((d)->arch.ioport_caps))
#define cache_flush_permitted has_arch_io_resources
#define cache_flush_permitted(d) \
(has_arch_io_resources(d) || has_arch_pdevs(d))
static inline int ioports_permit_access(struct domain *d, unsigned long s,
unsigned long e)
+1 -3
View File
@@ -172,9 +172,7 @@ static DEFINE_SPINLOCK(subpage_ro_lock);
#define l1_disallow_mask(d) \
(((d) != dom_io) && \
(rangeset_is_empty((d)->iomem_caps) && \
rangeset_is_empty((d)->arch.ioport_caps) && \
!has_arch_pdevs(d) && \
(!cache_flush_permitted(d) && \
is_pv_domain(d)) ? \
L1_DISALLOW_MASK : (L1_DISALLOW_MASK & ~PAGE_CACHE_ATTRS))
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.