From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 53DBAC001DE for ; Mon, 7 Aug 2023 23:21:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=QYjiraVsBWUdDps/JN1Baydt8qR7LWLbmlIzOY+bKbo=; b=emhkT3vY4bmdjz 97BdUKB60moUhIMEKFao1q3HAB2nXuz6rO5ugS2ediNQE9lUgeVcS7rBfodsuKc00AiiKfMfYYxNH PFFBtivjzMXYYqsMapAkYszaVPJaCiEGrO4V0MvJMnNSa3lsXgV64pi9aqaT6teHk5ctYFCiXcIs8 MJjgnoruYNUucf5gtQyGfCmbV8CPLVOBm9MbSt4QPkf3wESCWkXNiwVz0Y5S79robT04PGX7y+dzp 8tFAmQjSPCL0V4vf1bOK8P2ZyYGEI+t4rN9zSUw6oaDheTIjR8tigXeGkI9d+x0z8pa+0KYS06mmL i36HoKATosPjSOAMY0Jg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qT9XK-001C8Y-03; Mon, 07 Aug 2023 23:21:18 +0000 Received: from mgamail.intel.com ([192.55.52.88]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qT9XG-001C7j-2p for linux-arm-kernel@lists.infradead.org; Mon, 07 Aug 2023 23:21:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1691450474; x=1722986474; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=MW1RL2mb5XewuhxxaL7Gc11E1DDyvPjXs3PuxFsltlA=; b=BeB13SW9hKvzUDzJ19Gkijv6xkRXA6dC0xXFBIqoB23un19fNd29DNZ9 Zs1aYBWvLXe0lu4BFayeg+dLz3dADMacZoZ7co84MfhdcoltVQbns73yD aYpMyOT4LwdQFcZl1nMFSrRYWeKEhW+3OClWHcMBDWm4m80ohJHFRpozQ Q0fSzGRAshN4NrbhFneGhwix/9yAYNLbIlPvVhgBPvwQh2U/fmmMdpA1f HrWxCcI01n91J7k2HXT1z1aaDp/F75R0aTyLA0OIPwwyiFcG9+7W9MEc3 gXgZHl7KpjhjtRaMBGtRQfXJv031YjSPsjnyLpGpovD8z22c3Vdrb2a7X Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10795"; a="401634202" X-IronPort-AV: E=Sophos;i="6.01,263,1684825200"; d="scan'208";a="401634202" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Aug 2023 16:21:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10795"; a="1061758805" X-IronPort-AV: E=Sophos;i="6.01,263,1684825200"; d="scan'208";a="1061758805" Received: from ranerica-svr.sc.intel.com ([172.25.110.23]) by fmsmga005.fm.intel.com with ESMTP; 07 Aug 2023 16:21:13 -0700 Date: Mon, 7 Aug 2023 16:23:46 -0700 From: Ricardo Neri To: Sudeep Holla Cc: Radu Rendec , linux-kernel@vger.kernel.org, Pierre Gondois , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v4 1/3] cacheinfo: Add arch specific early level initializer Message-ID: <20230807232346.GB18573@ranerica-svr.sc.intel.com> References: <20230412185759.755408-1-rrendec@redhat.com> <20230412185759.755408-2-rrendec@redhat.com> <20230510191207.GA18514@ranerica-svr.sc.intel.com> <20230515093608.etfprpqn3lmgybe6@bogus> <20230518012703.GA19967@ranerica-svr.sc.intel.com> <20230518093414.qhwyogcig4wv3r5s@bogus> <20230531122201.3n3ak5n3cjisbmtm@bogus> <20230531170336.GA22753@ranerica-svr.sc.intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230531170336.GA22753@ranerica-svr.sc.intel.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230807_162114_930146_B1535566 X-CRM114-Status: GOOD ( 38.96 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, May 31, 2023 at 10:03:36AM -0700, Ricardo Neri wrote: > On Wed, May 31, 2023 at 01:22:01PM +0100, Sudeep Holla wrote: > > On Thu, May 18, 2023 at 10:34:14AM +0100, Sudeep Holla wrote: > > > On Wed, May 17, 2023 at 06:27:03PM -0700, Ricardo Neri wrote: > > > > On Mon, May 15, 2023 at 10:36:08AM +0100, Sudeep Holla wrote: > > > > > On Wed, May 10, 2023 at 12:12:07PM -0700, Ricardo Neri wrote: > > > > > > Hi, > > > > > > > > > > > > I had posted a patchset[1] for x86 that initializes > > > > > > ci_cacheinfo(cpu)->num_leaves during SMP boot. > > > > > > > > > > > > > > > > It is entirely clear to me if this is just a clean up or a fix to some > > > > > issue you faced ? Just wanted to let you know Prateek from AMD has couple > > > > > of fixes [2] > > > > > > > > My first patch is a bug fix. The second patch is clean up that results > > > > from fixing the bug in patch 1. > > > > > > > > > > > > > > > This means that early_leaves and a late cache_leaves() are equal but > > > > > > per_cpu_cacheinfo(cpu) is never allocated. Currently, x86 does not use > > > > > > fetch_cache_info(). > > > > > > > > > > > > I think that we should check here that per_cpu_cacheinfo() has been allocated to > > > > > > take care of the case in which early and late cache leaves remain the same: > > > > > > > > > > > > - if (cache_leaves(cpu) <= early_leaves) > > > > > > + if (cache_leaves(cpu) <= early_leaves && per_cpu_cacheinfo(cpu)) > > > > > > > > > > > > Otherwise, in v6.4-rc1 + [1] I observe a NULL pointer dereference from > > > > > > last_level_cache_is_valid(). > > > > > > > > > > > > > > > > I think this is different issue as Prateek was just observing wrong info > > > > > after cpuhotplug operations. But the patches manage the cpumap_populated > > > > > state better with the patches. Can you please look at that as weel ? > > > > > > > > I verified that the patches from Prateek fix a different issue. I was able > > > > to reproduce his issue. His patches fixes it. > > > > > > > > I still see my issue after applying Prateek's patches. > > > > > > Thanks, I thought it is different issue and good that you were able to test > > > them as well. Please post a proper patch for the NULL ptr dereference you > > > are hitting on x86. > > > > Gentle ping! Are you still observing NULL ptr dereference with v6.4-rcx ? > > Yes, I still observe it on v6.4-rc4. > > > If so, can you please post the fix as a proper patch ? Some of the patches > > in v6.4-rc1 are being backported, so I prefer to have all the known issues > > fixed before that happens. Sorry for the nag, but backport is the reason > > I am pushing for this. > > Sure. Sorry for the delay. I have the patch ready and post this week. I > will post it as part my previous patches in [1]. I at last posted the patchet, Sudeep. You can take a look here: https://lore.kernel.org/all/20230805012421.7002-1-ricardo.neri-calderon@linux.intel.com/ Sorry for the delay. I had to jump through various hoops before posting. Thanks and BR, Ricardo _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel