Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2536921lqt; Mon, 22 Apr 2024 13:42:17 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUButu50wI85L5W5cd20jwJ7CiwwPmvArWzCeX9rVbm87kCrxSd8yqy9RZVw86ML+AoCvP2n9T1jZ/unEOep4X2pwBB5EN1nowejU3yAw== X-Google-Smtp-Source: AGHT+IEqZmDI8dyhU7TzF4xwKAAzLmoK2yfsYiUeLmTZat/ptSdFMXUjcijZv1WDRyrvzPsVodu4 X-Received: by 2002:a50:d606:0:b0:56e:2bf4:fe0a with SMTP id x6-20020a50d606000000b0056e2bf4fe0amr7523865edi.35.1713818537145; Mon, 22 Apr 2024 13:42:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713818537; cv=pass; d=google.com; s=arc-20160816; b=U5Tp0+J/gZ0JprLaluShPONrlZuRDCURv0Ywh66P1YQXvPKKRq/s3MyFWRitvrUvII agJol1/ta6Q0aTEo83H7+pu7q+TaXNr0OGf1TmHfpwB+CvYBkksBWun439/kLvYTwJKF lnusNahyPxyc6QCwPsQWClLSd7u1/gHuoHtFvRUIryPfbxRKFd472Nk3rKBipLgpt62A UQwwnqT6Im1SjUooalGaach7+4N/qeixEd0cnkwu3GFzr8cHOHZb/pnz7AAcmVnvRL+J Uhhm5/oeP002xCfJ9UNrr0/9IlCJRRrPazdm5V2kfpyHXcz3GuPNTgEoN2f/4q5FLGtw xlnA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=OlkiVCvteYN4pxgphraaSRuyPSDJ4D5rYH0N0OYe2js=; fh=6mUJ5ZJtwG94m8RtzSrhEHMTdXSQNIHEr9rhFy2ECEc=; b=BVQ1jORwfqW5Jl0UoSxLr7nevQ6d6nq0PKYPdkPESrIv/SgZoiimpUqYekhzW2WiB/ hnpoYYdjMqCV2v9Pq5DT4kHHlIQLjIQRq0jv2TIPlLuyhp7c9Z8RUfLJKCTZqigqGVgL F0cbRe+iYhCpVPY/+4du75mMWzKUKkZkdUM1PrVTJCijgt6UoyVHJHEBj2LaI1zBkHuR INUtTIvmdyH1nyfKZqtco7QBBCUt5/korvilFma/PExioPKd6UK6MkVzNfhlfe43Rxz4 KRFfJKCIaL5lDE57pmok+1I4/8IYZsJpEHFetBkQeYSwDBh75FZ6vEyHgv0DbKN8NJnA mKeA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@alien8.de header.s=alien8 header.b=itm6atDQ; arc=pass (i=1 spf=pass spfdomain=alien8.de dkim=pass dkdomain=alien8.de dmarc=pass fromdomain=alien8.de); spf=pass (google.com: domain of linux-kernel+bounces-154002-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-154002-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id y12-20020aa7c24c000000b0056c38f7295fsi5958290edo.602.2024.04.22.13.42.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Apr 2024 13:42:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-154002-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=alien8 header.b=itm6atDQ; arc=pass (i=1 spf=pass spfdomain=alien8.de dkim=pass dkdomain=alien8.de dmarc=pass fromdomain=alien8.de); spf=pass (google.com: domain of linux-kernel+bounces-154002-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-154002-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id DD53C1F21CBB for ; Mon, 22 Apr 2024 20:42:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3E8901BC43; Mon, 22 Apr 2024 20:42:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (4096-bit key) header.d=alien8.de header.i=@alien8.de header.b="itm6atDQ" Received: from mail.alien8.de (mail.alien8.de [65.109.113.108]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CC53F1B947 for ; Mon, 22 Apr 2024 20:42:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=65.109.113.108 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713818530; cv=none; b=H5z73baIJAmhzpezlWR2R3NsOKbRpcG0V44dFwLlPerdABTrIXq/yeDOJDoEhuHCR2eq2lV/KaV1oZW029DuaG1c/aZJeI8aUf83GENI33hkV0XqNFJCnZ7hyNhR7DAoFpcBajDJLbJuEy1QkH7mjqrq48xD12fpuk+Z4TdDgXI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713818530; c=relaxed/simple; bh=51xIj97O9lQ9Y9TaGc9pJwYMYuzv07feAOfehZkC93U=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=LxsSbHE5EMXuZ9AI2pJ0mEp+OTM2miodh4B3uJj3zRrQ8GWvG+NV9NxYOYHfTPDwFHAS/STr7ylaxgf/RNEkKyAGbStMBsc/5F7IHWK58F4OFVikZiPyaVfWMrrbe1clv4W1xQiRcX79OUAl/0C+gCPD/yGI/53KuIrBE/jXPCQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=alien8.de; spf=pass smtp.mailfrom=alien8.de; dkim=pass (4096-bit key) header.d=alien8.de header.i=@alien8.de header.b=itm6atDQ; arc=none smtp.client-ip=65.109.113.108 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=alien8.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alien8.de Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTP id 021E040E0240; Mon, 22 Apr 2024 20:42:05 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at mail.alien8.de Authentication-Results: mail.alien8.de (amavisd-new); dkim=pass (4096-bit key) header.d=alien8.de Received: from mail.alien8.de ([127.0.0.1]) by localhost (mail.alien8.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id Ml7F_4ndxso4; Mon, 22 Apr 2024 20:42:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=alien8; t=1713818521; bh=OlkiVCvteYN4pxgphraaSRuyPSDJ4D5rYH0N0OYe2js=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=itm6atDQjc+oW7a6N5Ron8h+aHooV2kdwWEFi8HBx/+i4P3bT3uqGvHMHRFP7PM+m u1Y70F15Dqpuf1C8Y3sOYHclM55/rCpDES7XF2noYyq70s3HpAKQkxNatL4E9iEaRO 3yGOYwBr6FbkCeAnPLFkeaPhcAevdvUuNhvR6wVfrlccAPcKantz8EzLh/bS6XOeeH RBSaaOWLjHG76k9nrZIqv8O36ByTz9wPUyQKY2F8ANKLUH5kdYZKjhO9Zi6Todw6uZ /wUHnVFLAtgLN4tKjc+83flYHHwnPxhhkoU8ekZr3JKb2jT3lm+Urt5IlMFlj43k3t 2yRGTbn1dbat1yt1ZJS+69LgPTFizYbHvlIou9o/w1tep1cYr9fNJugye4oWgsrXXT 7fiSzAZWyXmb7N7Y2WiZ68N7oRB3kWY1t/SZFsjNSLV6qgPm3kS/nzrXeRsAS6Oo4/ pPuA5RUf0blCD1gEuSBPmmRSLHyLqAFtFEsmgARvKie62v7/gbsSxzCDDGuxu7c4m9 yVJDFzWQv3hwbDTpQWse9+8dCnDUXl02qpQXEAj+TY7NWDllfVRdb5VWGUtdvUXeir 12r4CmYerySbiv1bDKSPVTgP6LnrACV83xJtnylYHABI5XqNbkorK+CmGC7JCkrhqG TiZeoRuK2SDt/MbF1aEgk+b0= Received: from zn.tnic (pd953020b.dip0.t-ipconnect.de [217.83.2.11]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id DA14640E00B2; Mon, 22 Apr 2024 20:41:51 +0000 (UTC) Date: Mon, 22 Apr 2024 22:41:46 +0200 From: Borislav Petkov To: Robert Richter Cc: Dave Hansen , Dave Hansen , linux-kernel@vger.kernel.org, jgross@suse.com, tglx@linutronix.de, x86@kernel.org, Kim Phillips , Robert Richter Subject: Re: [PATCH 2/4] perf/x86/ibs: Use CPUID region helper Message-ID: <20240422204146.GCZibLiqZhbY1J4qFJ@fat_crate.local> References: <20240403153508.7328E749@davehans-spike.ostc.intel.com> <20240403153511.75CB9DA0@davehans-spike.ostc.intel.com> <20240416151242.GGZh6VaiO2gC4ej2BT@fat_crate.local> <20240416174850.GEZh66AmnDjrLxoXaw@fat_crate.local> <20240422172055.GAZiacdxkQU0XAbybW@fat_crate.local> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: On Mon, Apr 22, 2024 at 10:09:57PM +0200, Robert Richter wrote: > Since we check get_cpuid_region_leaf()'s return code here we know if > the cpud leaf exists and return IBS_CAPS_DEFAULT if not. That would > not change the refB behaviour. Yes. > Though I think that case is rare or even not existing, I would just > keep the implementation like that and as it was for for years. Yes. > > > This slightly modifies the functionality so that 0 is return if > > > !IBS_CAPS_AVAIL (instead of IBS_CAPS_DEFAULT). > > > > If !IBS_CAPS_AVAIL, then this is revB. But then you want to return > > IBS_CAPS_DEFAULT there. > > No, on a rebB get_cpuid_region_leaf() would be false, meaning the > cpuid leaf is missing, function returns with IBS_CAPS_DEFAULT then. So what functionality modification do you mean then? When will IBS_CAPS_AVAIL be not set? GH BKDG says about that bit: "IBSFFV. IBS feature flags valid. Revision B = 0. Revision C = 1." so that has been set ever since on >= revC. And on revB we'll return IBS_CAPS_DEFAULT which has IBS_CAPS_AVAIL. IOW, I don't see how we'll return 0 if !IBS_CAPS_AVAIL because latter doesn't happen practically with that flow. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette