From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (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 970AC433BA0 for ; Wed, 8 Jul 2026 10:52:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783507955; cv=none; b=LfbJNLdnPWNwP9kHaoHttz0HQbUOVk4ihZwNqN3X7XNAa9q2HM8Fbq5a/+jOwKA8V1t3850YyArXS1EEJjB/f5AknAZ1rzpwenztowvNUBWuDgfVXbVjC6sn1Jq9NGKTSU8a5HzC6Tuph3gSg5zJF7BbP1MN+n0uzlBlCz78i4A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783507955; c=relaxed/simple; bh=CyxJPLdFVSeuZ2RxzJTcc+hcmMlhX4OBVi0W+0ZwW10=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=HuqLv648ZBckFhSti5us3NnfBj380vSjXH/tluN/SblQfi1i6TE8C2fV+QwrpAZKUp7TLzT7537Fc+F8RulNAJIZKjI99VUpFGNZl+ciHhsYOilvxEp5dgLuH/KzLV3zoiDTTmJUwiao2rb6DiPJTvoDj0H3udy81P3M2YEwWus= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=mJIQuTpQ; arc=none smtp.client-ip=198.175.65.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="mJIQuTpQ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1783507951; x=1815043951; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=CyxJPLdFVSeuZ2RxzJTcc+hcmMlhX4OBVi0W+0ZwW10=; b=mJIQuTpQRSL4SyHOA+NMGVI80C55K+bxSRRCT/iMJPZPNy7+wsyFDxsS iH5tGQmkQ73xJFvPyqqMDm/9yknV2gEGLbMe6Fy16n5B3ZTKF/dqXYSn+ +lEwHf9Anj4MlHjVTlZmuZxhc4JfvmB9cLtetZLcEQ9lFZ0Gnj09fXB80 iZFlbSHGfJSgYZMIL7AdfrlEIvSGOw4q10g9WF3N6FX1yJMMUUhnpID8N jVzDu02mqU2KSNokdpud1yfyUmQYAaVOKZHsZLyQI85qFnfw9Olifwhvg GPwEwFvF3LWfveA+HHNJso8UQjuX46AVF9xClBTbqfYzjpg6O37H2r5N+ A==; X-CSE-ConnectionGUID: N7RcZ+NGS/+TgW1B4Ke5BA== X-CSE-MsgGUID: 3EsTnmBsSLq044iX/+27uA== X-IronPort-AV: E=McAfee;i="6800,10657,11840"; a="84140618" X-IronPort-AV: E=Sophos;i="6.25,153,1779174000"; d="scan'208";a="84140618" Received: from orviesa005.jf.intel.com ([10.64.159.145]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jul 2026 03:52:26 -0700 X-CSE-ConnectionGUID: g8YZV/AdS4WqXLiUz+5jSQ== X-CSE-MsgGUID: Eie5xIutQQaxUySqp2ky5A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.25,153,1779174000"; d="scan'208";a="258561997" Received: from klitkey1-mobl1.ger.corp.intel.com (HELO localhost) ([10.245.245.100]) by orviesa005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jul 2026 03:52:25 -0700 Date: Wed, 8 Jul 2026 13:52:22 +0300 From: Andy Shevchenko To: "Christophe Leroy (CS GROUP)" Cc: Erhard Furtner , "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 Message-ID: References: <98d65de7-e5aa-4197-85bd-219eab01e572@kernel.org> <5430b52d-a072-41ea-ab56-9bb2f6f88849@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5430b52d-a072-41ea-ab56-9bb2f6f88849@kernel.org> Organization: Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs, Bertel Jungin Aukio 5, 02600 Espoo 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