Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp637065rwb; Fri, 4 Aug 2023 20:32:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH3KaEwFgfII887glMu+XSpGumf5oknqicdOztuJOPK+ZqrlPpFRY8jhvQsHY1ErK4xZE/k X-Received: by 2002:a05:6808:138c:b0:3a6:fbe3:a9ae with SMTP id c12-20020a056808138c00b003a6fbe3a9aemr5488392oiw.34.1691206330256; Fri, 04 Aug 2023 20:32:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691206330; cv=none; d=google.com; s=arc-20160816; b=TNd7yuBfOA7W65OrhuO38l96mOLWQ/QguipEGmbyXzgq8p24dkral7pjUntQc8eg+h Y2UFrhzyR9M10QFu9E1b1Wizo/ucatmT2Jo1BCcUguiA5Jt74F3YFrBjo5P2wp1o03QO udCly0JlqqY6NPZULvBKs8Be4utyUjOEARZU1HOsci8JBorzK35MewBk+7VJClM0iwL6 9Pnop3nvLFKYspTCUeHVpGIh/Ee9AYdl1Iz+o0P+STsfDWeHZGRWPHZsXueI+7ZfZRIr Q5jOvXXcSRCmi90lgDj/wT7fMsdq0ijdD/aSFgMjUMcaH+oDaqx4+UtQFV3pc303a+lv m5Ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=aTRbRFlZ+gldawpIOX07litpSICNAC6cvrgVsFd81zk=; fh=bxtuI1JvMc1ANMdqu9Y2DNm8QQuhFm7AmKHdCPkhPno=; b=c7WskaOcgGTbpUfgJg7ZP1p+WeosFMkY7I0aqMx45tDtg30/1A+CT9+gntLPkUzSwq jCEK97ksNRELDjl+ZF79qfG3kDv6C+PtWFeznz/Md24FV+Vma3PfLAL3VoZbIHuqqAdG 3ts04XKm0VPR1PJyQKXJvAtM5+36Tc2w72sQcZNQ328zwIqWuUfmZcqY2p6ouFQJxOTq pUQrKHqk0yuLYzG17scmgS7O3/Oe5BqYlksFUZQ+2gDkmBfNoPhgx18rfWSXA8qeCp10 nOpuMyqF7GLhMliDPhSqjHpOILw6dPv8OvSEWp3Z7fvM9TMU9UMur6smF+ycz67KtWKn mXyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=WgqSJepR; 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=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h14-20020a056a001a4e00b00682850547a9si1089714pfv.201.2023.08.04.20.31.55; Fri, 04 Aug 2023 20:32:10 -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=@intel.com header.s=Intel header.b=WgqSJepR; 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=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229727AbjHEBWB (ORCPT + 99 others); Fri, 4 Aug 2023 21:22:01 -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 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,URIBL_BLOCKED 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 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