LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: "Christophe Leroy (CS GROUP)" <chleroy@kernel.org>
Cc: Erhard Furtner <erhard_f@mailbox.org>,
	"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
	linux-kernel@vger.kernel.org
Subject: Re: test_bitmap fails on ppc/ppc64 on kernels v7.1.3, v7.2-rc2
Date: Wed, 8 Jul 2026 13:52:22 +0300	[thread overview]
Message-ID: <ak4r5uL8BX74H9ta@ashevche-desk.local> (raw)
In-Reply-To: <5430b52d-a072-41ea-ab56-9bb2f6f88849@kernel.org>

On Wed, Jul 08, 2026 at 09:51:34AM +0200, Christophe Leroy (CS GROUP) wrote:
> Le 08/07/2026 à 09:43, Andy Shevchenko a écrit :
> > On Wed, Jul 08, 2026 at 01:25:01AM +0200, Erhard Furtner wrote:

...

> > Oh, this is nice. So, there are two (more?) options I see to mitigate
> > the issue:
> > - carefully copy the garbage from the stack to the expected values
> >    (effectively merge the whatever is on stack with the expected value)
> > - allocate buffers on heap
> > 
> > The latter seems the easiest and right thing to do (since we can't really
> > predict if the stack pattern is the same or bitmap APIs scatters the bits
> > just on top of the respective set or clear ones over that pattern).
> > 
> > I will send a patch, thanks for the report and analysis!
> 
> The following change fixes the issue for me:

Indeed, I missed that and before seeing this message I also realised that this
is the probably best fix. Can you submit it as a formal patch, please?

> diff --git a/lib/test_bitmap.c b/lib/test_bitmap.c
> index 69813c10e6c0b..448c3eb48a4a8 100644
> --- a/lib/test_bitmap.c
> +++ b/lib/test_bitmap.c
> @@ -392,6 +392,7 @@ static void __init test_bitmap_sg(void)
> 
>  	/* Scatter/gather relationship */
>  	bitmap_zero(bmap_tmp, 100);
> +	bitmap_zero(bmap_res, 100);
>  	bitmap_gather(bmap_tmp, bmap_scatter, sg_mask, nbits);
>  	bitmap_scatter(bmap_res, bmap_tmp, sg_mask, nbits);
>  	expect_eq_bitmap(bmap_scatter, bmap_res, 100);

-- 
With Best Regards,
Andy Shevchenko




  reply	other threads:[~2026-07-08 10:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-06 19:27 test_bitmap fails on ppc/ppc64 on kernels v7.1.3, v7.2-rc2 Erhard Furtner
2026-07-07 22:29 ` Christophe Leroy (CS GROUP)
2026-07-07 23:25   ` Erhard Furtner
2026-07-08  7:43     ` Andy Shevchenko
2026-07-08  7:51       ` Christophe Leroy (CS GROUP)
2026-07-08 10:52         ` Andy Shevchenko [this message]
2026-07-08 16:48         ` Erhard Furtner

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=ak4r5uL8BX74H9ta@ashevche-desk.local \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=chleroy@kernel.org \
    --cc=erhard_f@mailbox.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox