Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3149713iog; Mon, 27 Jun 2022 10:08:27 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vUGHAUmPBi9ho9lJqlx90bLvQyOLiU8rztrG2JfVw81azM2EzOfOYcWl+PEawXaJncA+h5 X-Received: by 2002:a17:903:2410:b0:16a:81d2:f5e8 with SMTP id e16-20020a170903241000b0016a81d2f5e8mr10567872plo.81.1656349706801; Mon, 27 Jun 2022 10:08:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656349706; cv=none; d=google.com; s=arc-20160816; b=suPVUv94KZ5E4v84rAft1X8rUWVLhsrNa3bY3l6i8H2UN/+u4oKNrGwfkA72z7ryrm i8u9B/ZlpuhR7t7Ehfjp/CuJGsuTdwOGr2ylMD95Anp5hRs0Fhu3t0/oY56qn6e4F6GT XVv8vI1ts7rb0EQDi1pBvvfGcwwhj01r55OPrPWS8I9mIocSCLVVb15kfuTqEjyp0tQP BUp9IWg2vPnvxp5JLsRjT/fdqkp++A2F1zIZk5Ap/G1ICNIZiperuksXVpJW6O3zcqVX GmuGpI7bcykouu7NvyqQ0z+WRzDU/ubLsXYSRTt1StLSt+jk/iwxeZrV4wf8j2jT5+EK ws1w== 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=LlTnNIeIdRQTv6KJxnWQrSNKswPjyT/Init+EWXHkjw=; b=0vwh5u9U+xAMP3/icbT784MQeXuN+V0TSI7pWvgID1K0FIOk8mGTJIUh+EtKJniAaB UXqspTDXzMO+wFBOlA4Bu8Boca9kw5XKiSqhRYp6buW20Xb4pB1ptQh5/0UxMrqOdsLN 114r5KYgLi+H5OBfg+0ulDf77BudRg0pGUqFGaW8+gBB7VmsM+CsxlO0FqTYWvG0mim/ UUacZxRPtsTmioXheKJibVti0krhCO7lrfylil0M8W2K5Oh+5ntX7S7mM6wLhQexgu67 SbO1RD5GJHqo1RzhqQmSjv17kVx2C5rawIQU3u98o5zi6nDq6VzTY6KzIjmh7GX9RJX0 ezlw== 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 18-20020a630112000000b00410702fefc1si2656203pgb.542.2022.06.27.10.08.10; Mon, 27 Jun 2022 10:08:26 -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 S239584AbiF0Qvf (ORCPT + 99 others); Mon, 27 Jun 2022 12:51:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239538AbiF0QvU (ORCPT ); Mon, 27 Jun 2022 12:51:20 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id AF9D213D1A for ; Mon, 27 Jun 2022 09:51:15 -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 AD59B1758; Mon, 27 Jun 2022 09:51:15 -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 B1B393F792; Mon, 27 Jun 2022 09:51:13 -0700 (PDT) From: Sudeep Holla To: linux-kernel@vger.kernel.org Cc: Sudeep Holla , Greg Kroah-Hartman , Atish Patra , Atish Patra , 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 v5 09/19] arch_topology: Use the last level cache information from the cacheinfo Date: Mon, 27 Jun 2022 17:50:37 +0100 Message-Id: <20220627165047.336669-10-sudeep.holla@arm.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627165047.336669-1-sudeep.holla@arm.com> References: <20220627165047.336669-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. Link: https://lore.kernel.org/r/20220621192034.3332546-10-sudeep.holla@arm.com 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 23cb52180ce3..c314c7064397 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.36.1