All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/EPT: relax iPAT for "invalid" MFNs
@ 2024-06-10 14:58 Jan Beulich
  2024-06-10 15:00 ` [PATCH for-4.19] " Jan Beulich
  2024-06-11  7:41 ` [PATCH] " Roger Pau Monné
  0 siblings, 2 replies; 14+ messages in thread
From: Jan Beulich @ 2024-06-10 14:58 UTC (permalink / raw)
  To: xen-devel@lists.xenproject.org; +Cc: Andrew Cooper, Roger Pau Monné

mfn_valid() is RAM-focused; it will often return false for MMIO. Yet
access to actual MMIO space should not generally be restricted to UC
only; especially video frame buffer accesses are unduly affected by such
a restriction. Permit PAT use for directly assigned MMIO as long as the
domain is known to have been granted some level of cache control.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
Considering that we've just declared PVH Dom0 "supported", this may well
qualify for 4.19. The issue was specifically very noticable there.

The conditional may be more complex than really necessary, but it's in
line with what we do elsewhere. And imo better continue to be a little
too restrictive, than moving to too lax.

--- a/xen/arch/x86/mm/p2m-ept.c
+++ b/xen/arch/x86/mm/p2m-ept.c
@@ -503,7 +503,8 @@ int epte_get_entry_emt(struct domain *d,
 
     if ( !mfn_valid(mfn) )
     {
-        *ipat = true;
+        *ipat = type != p2m_mmio_direct ||
+                (!is_iommu_enabled(d) && !cache_flush_permitted(d));
         return X86_MT_UC;
     }
 


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2024-06-12 11:53 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-10 14:58 [PATCH] x86/EPT: relax iPAT for "invalid" MFNs Jan Beulich
2024-06-10 15:00 ` [PATCH for-4.19] " Jan Beulich
2024-06-11 10:40   ` Oleksii K.
2024-06-11  7:41 ` [PATCH] " Roger Pau Monné
2024-06-11  8:26   ` Jan Beulich
2024-06-11  9:02     ` Roger Pau Monné
2024-06-11  9:33       ` Jan Beulich
2024-06-11 11:08         ` Roger Pau Monné
2024-06-11 11:52           ` Jan Beulich
2024-06-11 13:52             ` Roger Pau Monné
2024-06-11 14:53               ` Jan Beulich
2024-06-11 16:21                 ` Roger Pau Monné
2024-06-12 11:52                   ` Jan Beulich
2024-06-11 13:55         ` Andrew Cooper

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.