Received: by 2002:ac0:e511:0:0:0:0:0 with SMTP id u17csp347507imp; Mon, 4 Jul 2022 04:09:33 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tkprIGn8wA2AqBMDxuA96WBrZ3q1kA6RPhjyXZwA3XsVp2DiinSSGBZl80L5EsCn7rM+0S X-Received: by 2002:a17:907:1dde:b0:72a:4bc2:1625 with SMTP id og30-20020a1709071dde00b0072a4bc21625mr25086265ejc.144.1656932973380; Mon, 04 Jul 2022 04:09:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656932973; cv=none; d=google.com; s=arc-20160816; b=BMXXh9k/uYdQmDFOYV5r3PJTG+XBtlaMmhoia2Zvw1XZqc223Q2SPxL22wDLuTHYxA H9g87dh2crkNxyF+Op6DJ9256mfEAwBznBxaK7z2sYxLzbyW2ffzDXi1k7PguNHKECBq 2jo3aGU+VfBp8Gy433klACWX+Dy7OlQH03/GhyOvaLmqG5jQjxZ5MzhjmBPGAOtiWOeG A/KzVDpnAnUI8ZgbdHodjIJAMpOKS4Ott3VY1UCsBsMS6FeemHcZ4mIT9yjTsJ7Z2gnt 0aSW+ATdWkAuARZvSQ9oqLj9CL9eBWlDTqfL+cxYGnCKSp6/bm5nxhJ0HhkTuVzKwMPE 41eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=qoQY5AWx5hUYk77HM3z2pzz8gi74K9iAYx5wZ/mgDNk=; b=e5+P3zQYFm9J6KN4AGFLn1QTWik5fMPaJAXdYAlpKnp9ijKepFs2OkvHYgaGo9uNdX lSEN/VrtNOd26j/wXHJsHH4+rytfb/Rq/ofuegjNhAe59IHeFxUtAnGnhcSS73Lcmwpz 5RTkIk9xda31LAvsvYCSpiSDsQ0r7crdzZ9OoFsDIvaOraqgkkdMDUUGO3xaNPFklVMG weXAi4GcUcFFIwV2YIMb6IVandSTgbOTqLjlLqRcOkA75E/yzQN8gmOrogTeYU34r6Rc LKCHYjl1RpJ/oUkzbg5qDZMrcvxJlSx4M2UWt7++1zjRgyb9koev7TEVVS5RxgTBjEvl 40/Q== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fh17-20020a1709073a9100b007262b1c0d80si7765075ejc.589.2022.07.04.04.09.08; Mon, 04 Jul 2022 04:09:33 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233410AbiGDKRg (ORCPT + 99 others); Mon, 4 Jul 2022 06:17:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233401AbiGDKQg (ORCPT ); Mon, 4 Jul 2022 06:16:36 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 12C13DFAA for ; Mon, 4 Jul 2022 03:16:36 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 283F2D6E; Mon, 4 Jul 2022 03:16:36 -0700 (PDT) Received: from usa.arm.com (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id F04A63F792; Mon, 4 Jul 2022 03:16:33 -0700 (PDT) From: Sudeep Holla To: linux-kernel@vger.kernel.org, Greg Kroah-Hartman Cc: Sudeep Holla , conor.dooley@microchip.com, valentina.fernandezalanis@microchip.com, Vincent Guittot , Dietmar Eggemann , Qing Wang , Rob Herring , "Rafael J . Wysocki" , Ionela Voinescu , Pierre Gondois , linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, Gavin Shan Subject: [PATCH v6 10/21] arch_topology: Use the last level cache information from the cacheinfo Date: Mon, 4 Jul 2022 11:15:54 +0100 Message-Id: <20220704101605.1318280-11-sudeep.holla@arm.com> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220704101605.1318280-1-sudeep.holla@arm.com> References: <20220704101605.1318280-1-sudeep.holla@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 The cacheinfo is now initialised early along with the CPU topology initialisation. Instead of relying on the LLC ID information parsed separately only with ACPI PPTT elsewhere, migrate to use the similar information from the cacheinfo. This is generic for both DT and ACPI systems. The ACPI LLC ID information parsed separately can now be removed from arch specific code. Tested-by: Ionela Voinescu Reviewed-by: Gavin Shan Signed-off-by: Sudeep Holla --- drivers/base/arch_topology.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c index e2f7d9ea558e..4f936c984fb6 100644 --- a/drivers/base/arch_topology.c +++ b/drivers/base/arch_topology.c @@ -668,7 +668,8 @@ const struct cpumask *cpu_coregroup_mask(int cpu) /* not numa in package, lets use the package siblings */ core_mask = &cpu_topology[cpu].core_sibling; } - if (cpu_topology[cpu].llc_id != -1) { + + if (last_level_cache_is_valid(cpu)) { if (cpumask_subset(&cpu_topology[cpu].llc_sibling, core_mask)) core_mask = &cpu_topology[cpu].llc_sibling; } @@ -699,7 +700,7 @@ void update_siblings_masks(unsigned int cpuid) for_each_online_cpu(cpu) { cpu_topo = &cpu_topology[cpu]; - if (cpu_topo->llc_id != -1 && cpuid_topo->llc_id == cpu_topo->llc_id) { + if (last_level_cache_is_shared(cpu, cpuid)) { cpumask_set_cpu(cpu, &cpuid_topo->llc_sibling); cpumask_set_cpu(cpuid, &cpu_topo->llc_sibling); } -- 2.37.0