From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
Anthony PERARD <anthony.perard@vates.tech>,
Michal Orzel <michal.orzel@amd.com>,
Julien Grall <julien@xen.org>,
Stefano Stabellini <sstabellini@kernel.org>,
xen-devel@lists.xenproject.org
Subject: Re: [PATCH 7/9] xen/x86: rename cache_flush_permitted() to has_arch_io_resources()
Date: Fri, 16 May 2025 10:27:39 +0200 [thread overview]
Message-ID: <aCb2-6hIlYQ8V0NG@macbook.lan> (raw)
In-Reply-To: <9db4a2ce-ba06-42a1-b6e6-7d0c2b59c0c3@suse.com>
On Fri, May 16, 2025 at 10:08:35AM +0200, Jan Beulich wrote:
> On 16.05.2025 10:02, Roger Pau Monné wrote:
> > On Fri, May 16, 2025 at 09:07:43AM +0200, Jan Beulich wrote:
> >> On 15.05.2025 12:28, Roger Pau Monné wrote:
> >>> On Mon, May 12, 2025 at 05:16:02PM +0200, Jan Beulich wrote:
> >>>> On 06.05.2025 10:31, Roger Pau Monne wrote:
> >>>>> 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.
> >>>>>
> >>>>> Take the opportunity to adjust l1_disallow_mask() to use the newly
> >>>>> introduced has_arch_io_resources() macro.
> >>>>
> >>>> While I'm happy with everything else here, to me it's at least on the
> >>>> edge whether cache_flush_permitted() wouldn't be the better predicate
> >>>> to use there, for this being about ...
> >>>>
> >>>>> --- a/xen/arch/x86/mm.c
> >>>>> +++ b/xen/arch/x86/mm.c
> >>>>> @@ -172,8 +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_io_resources(d) && \
> >>>>> !has_arch_pdevs(d) && \
> >>>>> is_pv_domain(d)) ? \
> >>>>> L1_DISALLOW_MASK : (L1_DISALLOW_MASK & ~PAGE_CACHE_ATTRS))
> >>>>
> >>>> ... cachability, which goes hand in hand with the ability to also
> >>>> flush cache contents.
> >>>
> >>> Hm, I was on the edge here, in fact I've previously coded this using
> >>> cache_flush_permitted(), just to the change back to
> >>> has_arch_io_resources(). If you think cache_flush_permitted() is
> >>> better I'm fine with that.
> >>
> >> I think that would be better here, yet as you say - it's not entirely
> >> clear cut either way.
> >
> > I've reverted this chunk of the change and left the code as-is for the
> > time being.
>
> Didn't we agree to use cache_flush_permitted() here instead?
I think it would be a bit weird, if we want this to be a
non-functional change we would need to keep the has_arch_pdevs()
condition because cache_flush_permitted() doesn't take that into
account. Or we need to adjust cache_flush_permitted() to also take
has_arch_pdevs() into consideration.
Thanks, Roger.
next prev parent reply other threads:[~2025-05-16 8:28 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é [this message]
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é
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=aCb2-6hIlYQ8V0NG@macbook.lan \
--to=roger.pau@citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=anthony.perard@vates.tech \
--cc=jbeulich@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.