From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mout-p-201.mailbox.org (mout-p-201.mailbox.org [80.241.56.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A7C414307A4 for ; Wed, 8 Jul 2026 16:49:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.241.56.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783529345; cv=none; b=e/V0oJXDie+wxs6wYC6Kdd4jJ4khZRBv7jOd8lWP6o/61JfjX2cy/ftjMFrgYnD89RMtBlQvSnpQhNT6uFKBrR6rUw2UpSJjIVn7SpD7t1FtRWNQ49ShgRjsZFDz0htsSp2wU/hfDpxJhBFyv4ZqxTnq3Zx3ag/zxsHLiA6CfjQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783529345; c=relaxed/simple; bh=K7ePS8oHSfupyl4F76jxYQTTKPkwrFQue0fXlWRh+WM=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=f9ja9EjxGgmeDdq8CRhZ26SUBcHgKEGP/2bI1VVIIh10hdH1I9a3vfMc3rcPBVXJ3F6K1hzl/kKl4jUsiuq3ngWCSwL/1RUEyoYF/8n6+vDgjzEKLH97OAxCMs7xD6gj9n3Jvqyts05p6GxIaDGKnzEkSleeZ2zXQzlG+kSuJtQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=mailbox.org; spf=pass smtp.mailfrom=mailbox.org; dkim=pass (2048-bit key) header.d=mailbox.org header.i=@mailbox.org header.b=DmE5wen+; arc=none smtp.client-ip=80.241.56.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=mailbox.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mailbox.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=mailbox.org header.i=@mailbox.org header.b="DmE5wen+" Received: from smtp102.mailbox.org (smtp102.mailbox.org [10.196.197.102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA512) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4gwPF81CJQzMlKF; Wed, 08 Jul 2026 18:49:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1783529340; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qrJEykycDfWq6bCgDWXkzYQH/3VfPU7rgds3LGVzhsA=; b=DmE5wen+oy5/60K95Kzug6jx4+uFJVzKy+bwTxONgHf7KEr/DpUMmLhemeg8INa3obwD0t G7EMyzsKyG0I3DZDiQs2fmC0HfZRpD7YSEquPbjK8iqTdW3/Geutqd5ZLRh3cLt1993Jt/ P1p2nLRP1K8BHO6ZcQ7A3hzyZEpqk5k2i9rRS8jzIkeCT1KtMDuS7j38rL0i8t8o5fM12R WsynkpsLrLSivR3qdDDmdrfB53cb06tvazxzqRqJivnf2bKndasLl9iBcrXWSa0fQTsEQW zBFuUO+iX1vbmfD3/1ui4ZPsQfKzjk75MDBMTziMljQcqHYgLtG4A/fkKfeV0w== Message-ID: <74b10578-1e80-427a-8888-943c26da471e@mailbox.org> Date: Wed, 8 Jul 2026 18:48:57 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: test_bitmap fails on ppc/ppc64 on kernels v7.1.3, v7.2-rc2 To: "Christophe Leroy (CS GROUP)" , Andy Shevchenko Cc: "linuxppc-dev@lists.ozlabs.org" , linux-kernel@vger.kernel.org References: <98d65de7-e5aa-4197-85bd-219eab01e572@kernel.org> <5430b52d-a072-41ea-ab56-9bb2f6f88849@kernel.org> Content-Language: en-US, de-DE From: Erhard Furtner In-Reply-To: <5430b52d-a072-41ea-ab56-9bb2f6f88849@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-MBO-RS-META: hgwpr1jst6unneut7116fftbesftrcuw X-MBO-RS-ID: ff2d7b8e63ed77ee5dc >> 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: > > 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); Patch applied on top of v7.2-rc2. I can confirm Christophes patch fixes the issue for me. Thanks! Regards, Erhard