Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2201866rwl; Thu, 13 Apr 2023 03:10:46 -0700 (PDT) X-Google-Smtp-Source: AKy350ZK/xlVE981aZE83+5I92g1DC0svVJV770NJyBYEctNpt/d0J/xJ62SWalAu1SBFDq92SUF X-Received: by 2002:a05:6402:1486:b0:504:8a10:ac34 with SMTP id e6-20020a056402148600b005048a10ac34mr1971519edv.24.1681380646227; Thu, 13 Apr 2023 03:10:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681380646; cv=none; d=google.com; s=arc-20160816; b=GA/+gM9s//B2aUfET90GOyXqtK5CM+W8z5bhphihHelBcIrd5dmnsEzLScbDDCPHLd a2bCzZeKNUavvKp1FwyT3PxvrnnpNfkLNZop/F7DlJH9s7g+GUh6XMcU10FsqZx76XNJ rvQnNQDbJ5KaQ8z10Xg46kfRY2zgn/1JmAUI6QA0CyR3x9Xm2R3WnpqkeYFrkiN7t49N JXFLWkgSVLbakSyS8UxJSIzbFTvu6bj4GWg8NJYhHUwgXgBYs3HKSf4zjG6xEzmvRdC/ m9h1SMKzPKk2+MMyEhBjyzBCX3fKrCkTkK4yE2ot3Z6qyzSAFeIFjH/q2NjMK2UPgFE7 Duvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=p+lOEqmR1XV9AQ9ZNhPLcQlJffKLDBsvUImzEO478Ic=; b=dcrIbQDMmk89SikeWF5o7q0qYRyPWfrQXP26bRQkXdtIZxouhLKtyL7LXd1/j2ChZc lZF10l1wBJHQSlWbBjQLvSPZhWtXvKWx8VAUXvibucKe2FCJbUQCWSbV7/tOlrt8YkWV LZAr82/YiqRMvT/4HadA1K4ptMpvV0oXh86c5lc1alzFqkcN76s53JhH0Iamk/81vVpp gicLo1CG1HOdVGeACy9vyr9ZZiiapBcowW3jRasJ+5nYwDNnuCdeLxps64tuHJAja2OY fEyOuH9EebczABEo0jCBg/bs5gBwCRpLRNwq/O09QQqbZMlGMvhif1OSVhmvLQW/81B0 zK7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=q6XlEgkS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j10-20020aa7c40a000000b00504b530379fsi1492482edq.683.2023.04.13.03.10.21; Thu, 13 Apr 2023 03:10:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=q6XlEgkS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229615AbjDMKEq (ORCPT + 99 others); Thu, 13 Apr 2023 06:04:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229516AbjDMKEo (ORCPT ); Thu, 13 Apr 2023 06:04:44 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8EB36A4D for ; Thu, 13 Apr 2023 03:04:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1681380283; x=1712916283; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=p+lOEqmR1XV9AQ9ZNhPLcQlJffKLDBsvUImzEO478Ic=; b=q6XlEgkSIpijAkNPfR6nWCQWN0XXfgX4NXVcG70IhSo9417SQHOT4RfH hr4sUbiR1F3WROBXGzfgX2KbnUIs/jsGLyFtJS/pCV9v/jD3iXp9CwMTd 7BzKHTpPox70LIQnmmbwG7jVeuIAzwUhsukilmS8f0aYwkJPG8B/lkiq2 7AALpkjtEFRqY8QaINSiqMb8Tm5igPve3TDL79wIa7uUotG3Yun0VUuxj SUWPmd+SXfC9AY8zRSUJg8klKsveQBzuJAJRTIPOYp8F/VuQvek9awiSA SBvYxCFQuvFfsmkHAsVJCcEBeiXoPcA+IB19VH08D31j1fZlQlWouJmza A==; X-IronPort-AV: E=Sophos;i="5.98,341,1673938800"; d="asc'?scan'208";a="146867761" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 13 Apr 2023 03:04:42 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Thu, 13 Apr 2023 03:04:42 -0700 Received: from wendy (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21 via Frontend Transport; Thu, 13 Apr 2023 03:04:40 -0700 Date: Thu, 13 Apr 2023 11:04:25 +0100 From: Conor Dooley To: Pierre Gondois CC: , Radu Rendec , Alexandre Ghiti , Will Deacon , Sudeep Holla , Greg Kroah-Hartman , "Rafael J. Wysocki" , Palmer Dabbelt , Gavin Shan Subject: Re: [PATCH v3 1/4] cacheinfo: Check sib_leaf in cache_leaves_are_shared() Message-ID: <20230413-willing-ignition-176ca292846d@wendy> References: <20230413091436.230134-1-pierre.gondois@arm.com> <20230413091436.230134-2-pierre.gondois@arm.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="0ZbF3Rs7VX4XZKEm" Content-Disposition: inline In-Reply-To: <20230413091436.230134-2-pierre.gondois@arm.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --0ZbF3Rs7VX4XZKEm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Apr 13, 2023 at 11:14:31AM +0200, Pierre Gondois wrote: > If there is no ACPI/DT information, it is assumed that L1 caches > are private and L2 (and higher) caches are shared. A cache is > 'shared' between two CPUs if it is accessible from these two > CPUs. >=20 > Each CPU owns a representation (i.e. has a dedicated cacheinfo struct) > of the caches it has access to. cache_leaves_are_shared() tries to > identify whether two representations are designating the same actual > cache. >=20 > In cache_leaves_are_shared(), if 'this_leaf' is a L2 cache (or higher) > and 'sib_leaf' is a L1 cache, the caches are detected as shared as > only this_leaf's cache level is checked. > This is leads to setting sib_leaf as being shared with another CPU, > which is incorrect as this is a L1 cache. >=20 > Check 'sib_leaf->level'. Also update the comment as the function is > called when populating 'shared_cpu_map'. >=20 > Fixes: f16d1becf96f ("cacheinfo: Use cache identifiers to check if the ca= ches are shared if available") Cool, thanks for the updated commit message. Easier to twig the rationale this way. Reviewed-by: Conor Dooley Thanks, Conor. --0ZbF3Rs7VX4XZKEm Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZDfTqAAKCRB4tDGHoIJi 0vLLAQDjWmPPYi9cknyfhFnWKQ7O9P4+UusLM7bcX66okm13bgEA7/2zwTqVnmsg VEuTZ5FGbDTdiSwIFwUHulG8WeJYFwo= =HbXi -----END PGP SIGNATURE----- --0ZbF3Rs7VX4XZKEm--