From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
Andrew Cooper <andrew.cooper3@citrix.com>,
Juergen Gross <jgross@suse.com>,
Anthony PERARD <anthony.perard@vates.tech>
Subject: Re: [PATCH v3 7/8] x86/mm: update log-dirty bitmap when manipulating P2M
Date: Wed, 10 Dec 2025 10:57:45 +0100 [thread overview]
Message-ID: <aTlEGeUzGFX4b2Aa@Mac.lan> (raw)
In-Reply-To: <2341ab2f-f185-4bdb-b851-5a19a820b02e@suse.com>
On Wed, Dec 10, 2025 at 10:55:50AM +0100, Jan Beulich wrote:
> On 10.12.2025 10:42, Roger Pau Monné wrote:
> > On Tue, Apr 26, 2022 at 12:26:10PM +0200, Jan Beulich wrote:
> >> Just like for PV guests MMU_MACHPHYS_UPDATE implies marking of the
> >> respective page as dirty, additions to a HVM guest's P2M should do so.
> >>
> >> For HVM the opposite is also true: Pages being removed from the P2M are
> >> no longer dirty at their prior GFN; there's no point in telling the tool
> >> stack to try and copy that page, when this will fail anyway (until
> >> perhaps a new page gets placed there). Introduce paging_mark_pfn_clean()
> >> (intentionally without a paging_mark_clean() counterpart) to handle
> >> this. Note that while there is an earlier call to set_gpfn_from_mfn() in
> >> guest_physmap_add_entry(), but there's little reason to mark the page
> >> clean there when later in the function it'll be marked dirty. This is
> >> even more so given that at this point it's only the M2P that gets
> >> updated, with the P2M still left unchanged.
> >>
> >> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> >
> > Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
>
> Thanks.
>
> >> --- a/xen/arch/x86/mm/paging.c
> >> +++ b/xen/arch/x86/mm/paging.c
> >> @@ -260,7 +260,7 @@ static int paging_log_dirty_disable(stru
> >> }
> >>
> >> /* Mark a page as dirty, with taking guest pfn as parameter */
> >> -void paging_mark_pfn_dirty(struct domain *d, pfn_t pfn)
> >> +static void mark_pfn_dirty(struct domain *d, pfn_t pfn, bool dirty)
> >
> > Nit: set_pfn_logdirty() or similar? The function name makes it look like
> > it's marking the pfn as dirty (when it's also used to clear it).
> >
> > No strong opinion, it just seems to me the name is slightly confusing.
>
> Changed. While making the change I noticed that I had one other change in
> there for a possible v4. This is the extra hunk:
>
> @@ -260,7 +260,7 @@ void paging_mark_pfn_dirty(struct domain
> return;
>
> /* Shared MFNs should NEVER be marked dirty */
> - BUG_ON(paging_mode_translate(d) && SHARED_M2P(pfn_x(pfn)));
> + BUG_ON(dirty && paging_mode_translate(d) && SHARED_M2P(pfn_x(pfn)));
>
> /*
> * Values with the MSB set denote MFNs that aren't really part of the
>
> I hope that won't invalidate your R-b.
No, that's fine, please keep the RB.
Thanks, Roger.
next prev parent reply other threads:[~2025-12-10 9:58 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-26 10:20 [PATCH v3 0/8] x86: more or less log-dirty related improvements Jan Beulich
2022-04-26 10:22 ` [PATCH v3 1/8] libxenguest: short-circuit "all-dirty" handling Jan Beulich
2022-04-26 10:22 ` [PATCH v3 2/8] libxenguest: avoid allocating unused deferred-pages bitmap Jan Beulich
2022-04-26 10:23 ` [PATCH v3 3/8] libxenguest: guard against overflow from too large p2m when checkpointing Jan Beulich
2022-04-26 10:23 ` [PATCH v3 4/8] libxenguest: restrict PV guest size Jan Beulich
2022-04-26 10:24 ` [PATCH v3 5/8] libxenguest: deal with log-dirty op stats overflow Jan Beulich
2022-04-26 10:54 ` Andrew Cooper
2022-04-26 14:24 ` Jan Beulich
2022-04-26 10:25 ` [PATCH v3 6/8] x86/paging: supply more useful log-dirty page count Jan Beulich
2022-04-26 10:26 ` [PATCH v3 7/8] x86/mm: update log-dirty bitmap when manipulating P2M Jan Beulich
2025-12-05 13:53 ` Roger Pau Monné
2025-12-08 10:48 ` Jan Beulich
2025-12-09 11:34 ` Roger Pau Monné
2025-12-09 11:49 ` Jan Beulich
2025-12-10 9:01 ` Roger Pau Monné
2025-12-10 9:28 ` Jan Beulich
2025-12-10 9:42 ` Roger Pau Monné
2025-12-10 9:55 ` Jan Beulich
2025-12-10 9:57 ` Roger Pau Monné [this message]
2022-04-26 10:27 ` [PATCH v3 8/8] SUPPORT.md: write down restriction of 32-bit tool stacks Jan Beulich
2023-06-16 20:50 ` Julien Grall
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=aTlEGeUzGFX4b2Aa@Mac.lan \
--to=roger.pau@citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=anthony.perard@vates.tech \
--cc=jbeulich@suse.com \
--cc=jgross@suse.com \
--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.