Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp5199508rwb; Wed, 17 Aug 2022 12:58:19 -0700 (PDT) X-Google-Smtp-Source: AA6agR4N2FRbUeTvZdLgmSXWwwzbtUHVWtXyGrcB84lh/pfUtMyy6mU86TnbYpfjjSaZaFJXROin X-Received: by 2002:a17:907:c12:b0:731:6473:baf6 with SMTP id ga18-20020a1709070c1200b007316473baf6mr17260167ejc.522.1660766299604; Wed, 17 Aug 2022 12:58:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660766299; cv=none; d=google.com; s=arc-20160816; b=ud+GfWhy7BnvRuXFF0VJBJBJBv6aTSjjqUuYcC4ANd/6KHB0D5dKUTVPzWY4GZlTUk QFTSTnbYN0KnVw8QKJGUL77EPD3hxJH2Jm70gFiVxhfe5HSdkc9MuhhaX/QSG1NhwUVM 9flz5yiCwwhmOVtI5z6hCM4DVny7jGoIRZ8dCBaXCvdowsomsHBUccnEmMpusn5QLGk8 N/SoUbRarrRJ7+GhGN4iAxNcPtWOgDqwwn0EEflRNPJNo4oog/soLG/BfXru5fNPsrET 91vAjF7B/2TDm0FtN4CRgBv3S5Z3zSt80XEwhwYKkKnhDqod0MPCit8o2qOGtfTKKZD6 6gIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=44GACs/e0WleSjvrDsLYa/d5aVKDfRJalm17EdZtIGw=; b=L2qfR09w30+y1xNHbBP7xsWu4Vx1GFfptslrLkDgaqh4rHLIzcrbnOp7vrWDNrs5Lh qXbjMaPrp0qibqr1asUIJA3v7ncJ0UGnV0JZ51H4PraS5ynEfH4LGwrIGU10NGb0d0wm OFwDDCm+Vcu1fTmbVkkWQR0lakMpsu95DqGSnfXKAVMbLuv4UV0MpvGV5UJq/EI9vvbr dZkSmcAcHYRXBK1dsvfW9o/k9zufRhO0RVHFr2q/o/r+Ef44vhMu9SiMzhVqSvlAphgY VUENQEonbXjwG568xcCDbny8868gVaFv4iyPaazcZM59FKehFNY7lG48Y3n+emlzD5aP 9dtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b="b/QFgs/Q"; 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=alien8.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i38-20020a0564020f2600b00445f36fb1dcsi920197eda.609.2022.08.17.12.57.50; Wed, 17 Aug 2022 12:58:19 -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=@alien8.de header.s=dkim header.b="b/QFgs/Q"; 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=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241538AbiHQTlv (ORCPT + 99 others); Wed, 17 Aug 2022 15:41:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241660AbiHQTkg (ORCPT ); Wed, 17 Aug 2022 15:40:36 -0400 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69738A4B3A for ; Wed, 17 Aug 2022 12:40:35 -0700 (PDT) Received: from zn.tnic (p200300ea971b98b0329c23fffea6a903.dip0.t-ipconnect.de [IPv6:2003:ea:971b:98b0:329c:23ff:fea6:a903]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id C36101EC0230; Wed, 17 Aug 2022 21:40:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1660765229; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=44GACs/e0WleSjvrDsLYa/d5aVKDfRJalm17EdZtIGw=; b=b/QFgs/QzwtnLR2Oj1km1LH2suhnkYt09N2b/jgWEHTjmpaU8vZL3EEaa51cbdbev4Nybi 7sFZWtVmAgxSp4Do+dTJkjF93aSkow6BpXcX+y1tid9bfeHoYLKlq4ajIc/PXWwRTv7/Cf cAZBEZslpeOmqwtJfHUxeMpYTRgG4+Q= Date: Wed, 17 Aug 2022 21:40:29 +0200 From: Borislav Petkov To: Saurabh Sengar Cc: ssengar@microsoft.com, mikelley@microsoft.com, tglx@linutronix.de, mingo@redhat.com, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, peterz@infradead.org, tim.c.chen@linux.intel.com, will@kernel.org, song.bao.hua@hisilicon.com, suravee.suthikulpanit@amd.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] x86/cacheinfo: Don't use cpu_llc_shared_map for !CONFIG_SMP Message-ID: References: <1660148115-302-1-git-send-email-ssengar@linux.microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1660148115-302-1-git-send-email-ssengar@linux.microsoft.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,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 On Wed, Aug 10, 2022 at 09:15:15AM -0700, Saurabh Sengar wrote: > cpu_llc_shared_map is always declared and defined, but populated in > arch/x86/kernel/smpboot.c which only builds for CONFIG_SMP=y. For > UniProcessor builds this mask is never populated and hence invalid. > Current code doesn't handle the case of AMD UniProcessor correctly, What is "AMD UniProcessor"? > which results "shared_cpu_map" and "shared_cpu_list" files missing from > sysfs entries for l3 cache. This patch fixes this issue. What issue exactly? What is the real life use case for this? > This code used to work because of a another bug in 'cpumask_next', > where in the CONFIG_SMP=n case the cpumask_next() ignores empty mask > that results as if CPU 0 was set. This bug in 'cpumask_next' was fixed by > following commit, which exposes the cpu_llc_shared_map bug. > > b81dce77ced ("cpumask: Fix invalid uniprocessor mask assumption") > > Fixes: 2b83809a5e ("x86/cpu/amd: Derive L3 shared_cpu_map from cpu_llc_shared_mask") Add --- [core] abbrev = 12 [alias] one = show -s --pretty='format:%h (\"%s\")' --- to your git .config so that when you do $ git one you can get the proper formatting and abbreviated sha1 for commits. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette