All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Anthony PERARD <anthony.perard@vates.tech>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Juergen Gross <jgross@suse.com>,
	Christian Lindig <christian.lindig@citrix.com>,
	David Scott <dave@recoil.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH 8/9] xen: introduce flag when a domain requires cache control
Date: Fri, 16 May 2025 10:05:46 +0200	[thread overview]
Message-ID: <aCbx2vxqx3T-6uXe@macbook.lan> (raw)
In-Reply-To: <8f7beebc-643b-4308-b8ff-c0b812eb8d02@suse.com>

On Fri, May 16, 2025 at 09:16:10AM +0200, Jan Beulich wrote:
> On 15.05.2025 12:44, Roger Pau Monné wrote:
> > On Mon, May 12, 2025 at 05:24:01PM +0200, Jan Beulich wrote:
> >> On 06.05.2025 10:31, Roger Pau Monne wrote:
> >>> Such flag is added to the domain create hypercall, and a matching option is
> >>> added to xl and libxl to set the flag: `cache_control`.  When the flag is
> >>> set, the domain is allowed the usage of cache control operations.  If the
> >>> flag is not explicitly set, libxl will set it if the domain has any `iomem`
> >>> or `ioports` ranges assigned.
> >>>
> >>> Modify cache_flush_permitted() helper so that it's return value is no
> >>> longer based on the IO resources assigned to the domain, but rather whether
> >>> the domain has been explicitly allowed control over the cache, or if it has
> >>> IOMMU support and there's a single IOMMU in the system that doesn't allow
> >>> forcing snooping behind the guest back.  As a result of this, the return of
> >>> cache_flush_permitted() is constant for the lifetime of a domain, based on
> >>> the domain creation flags and the capabilities of the IOMMU if enabled
> >>> for the domain.
> >>
> >> This then further emphasizes the remark made for patch 7.
> > 
> > Hm, I think you are referring to the remark about how PCI device
> > without IO resources would be handled then, and what would
> > cache_flush_permitted() return then?
> 
> Or more generally the relationship between that and has_arch_io_resources().
> 
> > IMO the benefit of the approach presented here is that it aims to know
> > whether a domain needs cache control to be set at creation time, and
> > not altered during it's runtime.
> 
> I agree that having this not vary over a domain's lifetime makes things easier
> for us. At the same time it may negatively affect performance of domains where
> hardware devices are added / removed on the fly.

I'm planing to leave this change for a further iteration of the
series.  Initially I just want to attempt to limit flushing when the
domain has IOMMU support enabled, and the host globally supports
snooping on all IOMMUs, as that's likely less controversial and would
unblock a customer reported issue.

Thanks, Roger.


  reply	other threads:[~2025-05-16  8:05 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-06  8:31 [PATCH 0/8] xen: cache control improvements Roger Pau Monne
2025-05-06  8:31 ` [PATCH 1/9] x86/pv: fix MMUEXT_FLUSH_CACHE to flush all pCPU caches Roger Pau Monne
2025-05-12 14:09   ` Jan Beulich
2025-05-12 14:27     ` Roger Pau Monné
2025-05-12 14:11   ` Jan Beulich
2025-05-12 14:24     ` Roger Pau Monné
2025-05-06  8:31 ` [PATCH 2/9] x86/pv: fix emulation of wb{,no}invd " Roger Pau Monne
2025-05-12 14:20   ` Jan Beulich
2025-05-12 14:41     ` Roger Pau Monné
2025-05-06  8:31 ` [PATCH 3/9] xen/gnttab: limit cache flush operation to guests allowed cache control Roger Pau Monne
2025-05-06 10:15   ` Julien Grall
2025-05-06 10:40     ` Roger Pau Monné
2025-05-12 14:23       ` Jan Beulich
2025-05-06  8:31 ` [PATCH 4/9] x86/gnttab: do not implement GNTTABOP_cache_flush Roger Pau Monne
2025-05-12 14:27   ` Jan Beulich
2025-05-06  8:31 ` [PATCH 5/9] x86/mtrr: use memory_type_changed() in hvm_set_mem_pinned_cacheattr() Roger Pau Monne
2025-05-12 15:04   ` Jan Beulich
2025-05-15 10:22     ` Roger Pau Monné
2025-05-16  7:00       ` Jan Beulich
2025-05-16  7:57         ` Roger Pau Monné
2025-05-16  6:58   ` Jan Beulich
2025-05-16  7:48     ` Roger Pau Monné
2025-05-16  8:02       ` Jan Beulich
2025-05-16  8:45         ` Roger Pau Monné
2025-05-06  8:31 ` [PATCH 6/9] x86/p2m: limit cache flush in memory_type_changed() Roger Pau Monne
2025-05-12 15:10   ` Jan Beulich
2025-05-06  8:31 ` [PATCH 7/9] xen/x86: rename cache_flush_permitted() to has_arch_io_resources() Roger Pau Monne
2025-05-12 15:16   ` Jan Beulich
2025-05-15 10:28     ` Roger Pau Monné
2025-05-16  7:07       ` Jan Beulich
2025-05-16  8:02         ` Roger Pau Monné
2025-05-16  8:08           ` Jan Beulich
2025-05-16  8:27             ` Roger Pau Monné
2025-05-16  8:36               ` Jan Beulich
2025-05-16  8:55                 ` Roger Pau Monné
2025-05-06  8:31 ` [PATCH 8/9] xen: introduce flag when a domain requires cache control Roger Pau Monne
2025-05-06 10:20   ` Julien Grall
2025-05-06 10:43     ` Roger Pau Monné
2025-05-12 15:24   ` Jan Beulich
2025-05-15 10:44     ` Roger Pau Monné
2025-05-16  7:16       ` Jan Beulich
2025-05-16  8:05         ` Roger Pau Monné [this message]
2025-05-06  8:31 ` [PATCH 9/9] xen/x86: track dirty pCPU caches for a given vCPU Roger Pau Monne
2025-05-06 11:16   ` Andrew Cooper
2025-05-06 12:55     ` Roger Pau Monné
2025-05-12 15:38       ` Jan Beulich
2025-05-15 10:52         ` Roger Pau Monné
2025-05-16  7:25           ` Jan Beulich
2025-05-12 15:33   ` Jan Beulich
2025-05-06  9:32 ` [PATCH 0/8] xen: cache control improvements Christian Lindig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aCbx2vxqx3T-6uXe@macbook.lan \
    --to=roger.pau@citrix.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=anthony.perard@vates.tech \
    --cc=bertrand.marquis@arm.com \
    --cc=christian.lindig@citrix.com \
    --cc=dave@recoil.org \
    --cc=jbeulich@suse.com \
    --cc=jgross@suse.com \
    --cc=julien@xen.org \
    --cc=michal.orzel@amd.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.