From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id ACBCAC04A6A for ; Sat, 5 Aug 2023 01:22:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229753AbjHEBWC (ORCPT ); Fri, 4 Aug 2023 21:22:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49382 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229675AbjHEBWA (ORCPT ); Fri, 4 Aug 2023 21:22:00 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A5874EE4; Fri, 4 Aug 2023 18:21:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1691198518; x=1722734518; h=from:to:cc:subject:date:message-id; bh=8qZ03i3VQJk0gArG0C57L1TxXOVJULlo1Yez71dt/+g=; b=WgqSJepR8LX5soCYvNHkgW3wRTm/UmZXcOY1Qr/Jd4B12auYFeWv5fps nqNQ844Mrx+ZicoNEhyOCObEZVA6N8pw5O78t5layvK/bhUy1FtiXFdLu uNNmmIp6dNTqw7JpafxFmaQeVRwwJrUghupoFwgLM7uGuxtfdzEknG4Qx po12f4sdIUgwbIcpAC9q2j/ybP831APaHK8yDwzcpmISkuuoGatj5gZQM oAINgVp4OfKgnGbnkwmNxGO6uTkruFsFIICu9OtbjEjsTFUVWIrcREZ9h //KlFmNxyQBKfFeGg/aEosgJKAgSsCbe4S2QGKXJOD86KCMTuRNzTPs7o A==; X-IronPort-AV: E=McAfee;i="6600,9927,10792"; a="367735754" X-IronPort-AV: E=Sophos;i="6.01,256,1684825200"; d="scan'208";a="367735754" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Aug 2023 18:21:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10792"; a="844317613" X-IronPort-AV: E=Sophos;i="6.01,256,1684825200"; d="scan'208";a="844317613" Received: from ranerica-svr.sc.intel.com ([172.25.110.23]) by fmsmga002.fm.intel.com with ESMTP; 04 Aug 2023 18:21:57 -0700 From: Ricardo Neri To: x86@kernel.org Cc: Andreas Herrmann , Catalin Marinas , Chen Yu , Len Brown , Radu Rendec , Pierre Gondois , Pu Wen , "Rafael J. Wysocki" , Sudeep Holla , Srinivas Pandruvada , Will Deacon , Zhang Rui , stable@vger.kernel.org, Ricardo Neri , "Ravi V. Shankar" , linux-kernel@vger.kernel.org, Ricardo Neri Subject: [PATCH v3 0/3] x86/cacheinfo: Set the number of leaves per CPU Date: Fri, 4 Aug 2023 18:24:18 -0700 Message-Id: <20230805012421.7002-1-ricardo.neri-calderon@linux.intel.com> X-Mailer: git-send-email 2.17.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, This is v3 of a patchset to set the number of cache leaves independently for each CPU. v1 and v2 can be found here [1] and here [2]. Changes since v2: * This version uncovered a NULL-pointer dereference in recent changes to cacheinfo[3]. This dereference is observed when the system does not configure cacheinfo early during boot nor makes corrections later during CPU hotplug; as is the case in x86. Patch 1 fixes this issue. Changes since v1: * Dave Hansen suggested to use the existing per-CPU ci_cpu_cacheinfo variable. Now the global variable num_cache_leaves became useless. * While here, I noticed that init_cache_level() also became useless: x86 does not need ci_cpu_cacheinfo::num_levels. [1]. https://lore.kernel.org/lkml/20230314231658.30169-1-ricardo.neri-calderon@linux.intel.com/ [2]. https://lore.kernel.org/all/20230424001956.21434-1-ricardo.neri-calderon@linux.intel.com/ [3]. https://lore.kernel.org/all/20230412185759.755408-1-rrendec@redhat.com/ Ricardo Neri (3): cacheinfo: Allocate memory for memory if not done from the primary CPU x86/cacheinfo: Delete global num_cache_leaves x86/cacheinfo: Clean out init_cache_level() arch/x86/kernel/cpu/cacheinfo.c | 50 ++++++++++++++++----------------- drivers/base/cacheinfo.c | 6 +++- 2 files changed, 30 insertions(+), 26 deletions(-) -- 2.25.1