Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2903102rwl; Mon, 27 Mar 2023 06:54:25 -0700 (PDT) X-Google-Smtp-Source: AKy350aM9jliuY1w1rq+iRWOIKH4r8N+aq9tUbNSV8mwjQhUi4k6vXonzW00Xnf7+nUP4W7looPS X-Received: by 2002:aa7:c245:0:b0:4fa:7679:d44c with SMTP id y5-20020aa7c245000000b004fa7679d44cmr13007750edo.11.1679925265343; Mon, 27 Mar 2023 06:54:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679925265; cv=none; d=google.com; s=arc-20160816; b=z2YJf5qoyeQNDU3OX2lob9I6hjow9bfDKZqxi5rQHhcaKKEZdQnj7vX1/zltLrzezC 1Ew3j1zdleFlqCRy9SpA50uyFRYdKI5+VrxqF9XwD545JRSNpLFLkVts2ouDLN1T4Ir9 /gk2WACxV2QUaTIVuvjJjLyt0Thj8tQM66aHy6FS3dNdnTbRiJWCALA6y9TKzGOmLWW4 qNLfj9yFrHTVS/IcsFRISstno1G3dY4UgeQrbA24lASKAhMUyPxjn7O2GI1JSfhmLtFi KeJgHfYShjmjRxK/mb/5z3nkgIgW1I/ThWzwcJIsZXJG6hVyn01sLU75WjpYpn+vAEuB qBIw== 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=fZC46GJjMiCfyRt2jWcGY/1DOI+drne4WpDt0aGCFC4=; b=mmDoiWOW36U6CD7He8J1oCARyir3/Cbl3JqqBeYWBDfqHb4ec+5SnSu2A/wozmHcUe r+dvhzjHQztiXxUDXS728NktFzKf++qYJl0tHZPgX4U/Imo1XDouiusqci/f12/bPvTg 5wi2t3UQZC/CwljtEBiWFEddkVIgF/NTx3FdGgte/mGcq9xdngc7J7664/SXfVsq413M 5OvG/RVd+h3nVNhutjXfvPuucjfjTcPnokHwzAoI59hxevKRXitthPQwNrN37AFHW9qy ycvayDBbfwFTvolph3vvu9leSE7SZx7V3aKZLPs6fX9RjXgBKxcEBVe8SkOxHR16NdfS kYsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=xvUdp+jY; 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 e19-20020a50ec93000000b004ad8bff8f1dsi27559740edr.204.2023.03.27.06.54.00; Mon, 27 Mar 2023 06:54:25 -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=xvUdp+jY; 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 S229950AbjC0NxK (ORCPT + 99 others); Mon, 27 Mar 2023 09:53:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229664AbjC0NxI (ORCPT ); Mon, 27 Mar 2023 09:53:08 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 768BEB8 for ; Mon, 27 Mar 2023 06:53:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1679925185; x=1711461185; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=Q0aw3R6eyNVabVWBk/6BbTOvpxSvBhHjFUEn9k6dIDM=; b=xvUdp+jYpXsTHxOgHVDqGVaygpvMs3zANInsQYJruaCpB0f0NpShyjG6 kjKnTZJq3zgzvI0aUSaCgrOg44c+8SGZETo8XfFeRjtz96Ty+O2GL1nK4 /Ue0f/ZNQKNdmT4LSi13rWj+RL4lmlADwxVfGjn3B6AMFA72o3feaLZsa myw+9JWu9ShXzN1PMQGy7OitD8lhDH+KkIFMMCoHIDpaKEincemUEjRtN rxvyNJPj1dALVcjRGgg5XeE+f/8HMuqH1+iYQr0OIdbY94kxu3eWv9uMK Xft+tXn51uARv+GQfIV/qHbRhTw8HWZVbRm+lMtzaDbg1amwKtpnOxWmi Q==; X-IronPort-AV: E=Sophos;i="5.98,294,1673938800"; d="asc'?scan'208";a="207438968" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 27 Mar 2023 06:53:03 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Mon, 27 Mar 2023 06:53:00 -0700 Received: from wendy (10.10.115.15) 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 via Frontend Transport; Mon, 27 Mar 2023 06:52:58 -0700 Date: Mon, 27 Mar 2023 15:04:15 +0100 From: Conor Dooley To: Pierre Gondois CC: , Radu Rendec , Catalin Marinas , Will Deacon , Greg Kroah-Hartman , "Rafael J. Wysocki" , Sudeep Holla , Oliver Upton , Akihiko Odaki , Palmer Dabbelt , Gavin Shan , Subject: Re: [PATCH 1/3] cacheinfo: Check sib_leaf in cache_leaves_are_shared() Message-ID: <267f5e37-2cfd-4833-a74c-bfc56fe3671c@spud> References: <20230327115953.788244-1-pierre.gondois@arm.com> <20230327115953.788244-2-pierre.gondois@arm.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="b0IIy94NXv1sQNWD" Content-Disposition: inline In-Reply-To: <20230327115953.788244-2-pierre.gondois@arm.com> X-Spam-Status: No, score=-2.5 required=5.0 tests=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 autolearn=unavailable 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 --b0IIy94NXv1sQNWD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Mar 27, 2023 at 01:59:49PM +0200, Pierre Gondois wrote: > If 'this_leaf' is a L2 cache (or higher) and 'sib_leaf' is a L1 cache, > the caches are detected as shared. > Indeed, cache_leaves_are_shared() only checks the cache level of > 'this_leaf' when 'sib_leaf''s cache level should also be checked. nit: this commit message reads quite weirdly as there's a missing "do foo" statement, followed by "also do bar". >=20 > Also update the comment: the function is called when populating > 'shared_cpu_map'. >=20 > Signed-off-by: Pierre Gondois > --- > drivers/base/cacheinfo.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) >=20 > diff --git a/drivers/base/cacheinfo.c b/drivers/base/cacheinfo.c > index f6573c335f4c..4ca117574af1 100644 > --- a/drivers/base/cacheinfo.c > +++ b/drivers/base/cacheinfo.c > @@ -38,11 +38,10 @@ static inline bool cache_leaves_are_shared(struct cac= heinfo *this_leaf, > { > /* > * For non DT/ACPI systems, assume unique level 1 caches, > - * system-wide shared caches for all other levels. This will be used > - * only if arch specific code has not populated shared_cpu_map > + * system-wide shared caches for all other levels. > */ > if (!(IS_ENABLED(CONFIG_OF) || IS_ENABLED(CONFIG_ACPI))) > - return !(this_leaf->level =3D=3D 1); > + return (this_leaf->level !=3D 1) || (sib_leaf->level !=3D 1); So this is Fixes: f16d1becf96f ("cacheinfo: Use cache identifiers to check if the cach= es are shared if available") then? Cheers, Conor. > =20 > if ((sib_leaf->attributes & CACHE_ID) && > (this_leaf->attributes & CACHE_ID)) > --=20 > 2.25.1 >=20 >=20 --b0IIy94NXv1sQNWD Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZCGiXwAKCRB4tDGHoIJi 0t/EAQDXe23dRWv4M0HrXDodpHLa9o3/okRxwNua4LZCvcOoRQD9EcPHWFt02qKp clMayBcdu3gCTiSmliJnj8sLQ9YpLgI= =G6Qk -----END PGP SIGNATURE----- --b0IIy94NXv1sQNWD--