Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp222594ioo; Thu, 26 May 2022 02:05:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxYT4ZQjn4WkTXKSSfvgW8kdP51lmE2I9/rlyEAEkvGm8yHL+v2i3qGVl7BxjWz3mLC5y1c X-Received: by 2002:a05:6402:26ce:b0:42b:6bc4:ce16 with SMTP id x14-20020a05640226ce00b0042b6bc4ce16mr19945818edd.61.1653555926381; Thu, 26 May 2022 02:05:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653555926; cv=none; d=google.com; s=arc-20160816; b=Q3zm2mYXCEoZ/5L4by9jb7+C77j6d5zc9m2IKHA+LQpbbCMr0wBkbqfCi+fQBfXQ1a 46PBjEvd9Qk7wJrZefk4JpBZwtn4mcrEM+fpGUElilqReHQ9GpHfYPcGuXEG/rkLtKrQ IrKvgayK+oWAhfeNuFpGJ+4NEliN5mVQAX91UrRomlylqE0HYXhiPiZ/F/FLeBed5i8D /r2baDXj5cDRZkURlMeD66EgrJYBIoR+hZrN4zl6eEetkuvciFaUUfC/hbpBogCJ0Jg1 GXzkHOsyHHGOTCZVUKRqPgRa/HVrsHzPnufmOmnuIP1a05OCtpha0/1bb+wC96qdavCZ 9Zsw== 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=4H+LLT7l7PZ7wENfbnykXUvZwdeQhvXnzu9++EWhPU8=; b=wetoavlzYPnwTOhPaMDdHT42c/ZnpUoVGxNjTmBVzpeIoijkueNOh/1L3FVoxc/2IA BYRA62neVGG1YhrH3xvOvd5VxAiY4g4UUzWQTxMxMSP1yMY5Qh33hCUe8je+9Grg5Atg 2uNNawFCPUIDzDo0daXCFC4oBW/6xQHJHeg3UHp+fS/F/6XGSbhW1PfMj3XnCCI2XK1k s5MBe6lE9vuSG1/2z0HQAvRotjeVVhExcNy6BhEdwy/E9d3da/PcDGfIe/rLzE4lKa0p lVu0xIQUyTWTJ5rQqg+YVE7Zya+1EIhojSkRZ30JcjqLSSsA2hMTV6Woqu+x0rVwVFR9 Rx1w== 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 ho38-20020a1709070ea600b006efdb098965si1106909ejc.287.2022.05.26.02.04.56; Thu, 26 May 2022 02:05: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 S242411AbiEYIP0 (ORCPT + 99 others); Wed, 25 May 2022 04:15:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237117AbiEYIOt (ORCPT ); Wed, 25 May 2022 04:14:49 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0039782178 for ; Wed, 25 May 2022 01:14:47 -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 2DD3D1FB; Wed, 25 May 2022 01:14:47 -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 450083F73D; Wed, 25 May 2022 01:14:45 -0700 (PDT) From: Sudeep Holla To: linux-kernel@vger.kernel.org Cc: Sudeep Holla , Atish Patra , Atish Patra , Vincent Guittot , Morten Rasmussen , Dietmar Eggemann , Qing Wang , linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, Rob Herring Subject: [PATCH v3 07/16] arch_topology: Use the last level cache information from the cacheinfo Date: Wed, 25 May 2022 09:14:07 +0100 Message-Id: <20220525081416.3306043-8-sudeep.holla@arm.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220525081416.3306043-7-sudeep.holla@arm.com> References: <20220525081416.3306043-1-sudeep.holla@arm.com> <20220525081416.3306043-2-sudeep.holla@arm.com> <20220525081416.3306043-3-sudeep.holla@arm.com> <20220525081416.3306043-4-sudeep.holla@arm.com> <20220525081416.3306043-5-sudeep.holla@arm.com> <20220525081416.3306043-6-sudeep.holla@arm.com> <20220525081416.3306043-7-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_PASS,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. 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 765723448b10..4c486e4e6f2f 100644 --- a/drivers/base/arch_topology.c +++ b/drivers/base/arch_topology.c @@ -663,7 +663,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; } @@ -694,7 +695,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