From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: xen-devel@lists.xenproject.org,
Oleksii Kurochko <oleksii.kurochko@gmail.com>,
Anthony PERARD <anthony.perard@vates.tech>,
Michal Orzel <michal.orzel@amd.com>,
Jan Beulich <jbeulich@suse.com>, Julien Grall <julien@xen.org>,
Stefano Stabellini <sstabellini@kernel.org>
Subject: Re: [PATCH for-4.22] xen/pdx: fix off-by-one index in offset mask calculation
Date: Tue, 9 Jun 2026 11:14:52 +0200 [thread overview]
Message-ID: <aifZjKqOrIosqles@macbook.local> (raw)
In-Reply-To: <a0cfb079-653f-4c06-8004-017c7f60ffee@citrix.com>
On Tue, Jun 09, 2026 at 09:59:37AM +0100, Andrew Cooper wrote:
> On 09/06/2026 9:53 am, Roger Pau Monne wrote:
> > Adjust the mask calculation in case the last range is merged with the
> > previous one, as then the mask must be calculated from the previous range,
> > which the current one has been merged into.
> >
> > Instead of fixing the off-by-one in place, move the calculation of the bit
> > change mask to the next loop, after the ranges have been merged. This
> > simplifies the logic by consolidating mask calculation in a single place,
> > possibly making it less error prone in the future.
> >
> > Also add a test case that triggers the bug being fixed by this commit.
> >
> > Fixes: c5c45bcbd6a1 ("pdx: introduce a new compression algorithm based on region offsets")
> > Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
>
> Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
>
> > diff --git a/tools/tests/pdx/test-pdx.c b/tools/tests/pdx/test-pdx.c
> > index d783186577ef..ba57f1793011 100644
> > --- a/tools/tests/pdx/test-pdx.c
> > +++ b/tools/tests/pdx/test-pdx.c
> > @@ -191,6 +191,20 @@ int main(int argc, char **argv)
> > },
> > .compress = false,
> > },
> > + /*
> > + * 2s Dell R740, merging of ranges causes mask differences in PDX
> > + * offset mode. Useful for checking mask calculations.
>
> What's the 2s here? If it is what I think it is, I'd suggest "Dell
> R740, dual socket,"
Yes, it's what you think it is. I've used "2s" in existing comments,
but I'm perfectly fine with spelling it out.
Thanks, Roger.
next prev parent reply other threads:[~2026-06-09 9:15 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-09 8:53 [PATCH for-4.22] xen/pdx: fix off-by-one index in offset mask calculation Roger Pau Monne
2026-06-09 8:58 ` Roger Pau Monné
2026-06-09 8:59 ` Andrew Cooper
2026-06-09 9:14 ` Roger Pau Monné [this message]
2026-06-09 9:17 ` Andrew Cooper
2026-06-09 9:39 ` Oleksii Kurochko
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=aifZjKqOrIosqles@macbook.local \
--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=oleksii.kurochko@gmail.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.