Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp589063rwb; Thu, 11 Aug 2022 06:53:34 -0700 (PDT) X-Google-Smtp-Source: AA6agR7tXM64sGVPt/mIgKhsNDXnqHlMYT2MIRTDzfxlhhNoMgRs4VqWi+z90aB49fjv/B+rtcvr X-Received: by 2002:a17:907:7b92:b0:72b:67fb:8985 with SMTP id ne18-20020a1709077b9200b0072b67fb8985mr23444904ejc.569.1660226014448; Thu, 11 Aug 2022 06:53:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660226014; cv=none; d=google.com; s=arc-20160816; b=yu5GT407H6ckF4ZPH/tVhvf1f71x8EwmNDu8ISZvp2ruh/pKzV3SgyTtJSO9y4XwDH jcrOIRW7R9MdiUbV42DwZK0VhyCzv+OkFin5346b/pPGjXSOjWFBS3YVZnsFKiyu/AIV aceMHXOyd7NaWjICQafXg0VSg3uNBTOHXBRv6ONkdIGoUQ2itAzAurITqaTik/0TCez6 +Tj/9JXx1dd8ba9t2BliqSpxG1qLmII9ryybhxuyC+ZPFcSODuNU/KRbrRABGZPovX61 HzqISSuDyvN9Lr3KTBgajiAWFHJjISmqq0MhxWSa0wD/cELJg07LAZw1ZYAdEHIG7zSR ZXwA== 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=OldGnQzh68j0ria9OKr1ZKpGr6HHRfZ58vsjqVtmBGM=; b=mZbKDv+SU7HpZ6tUHF5xbF+/hXbnGRZrqIXtk/CHoXDhHNCol62yF8Bv7qKo+c8IhB GrRSptkHiAUWytnMRSUmvq2PfIQmJOckQvu2eCmFRQ/NSVPawoHn2BBPM6glkL0ZE7Wv HghF4xYqL5fmAO+RnY6i+ordBJB3eYDISXdJdGWaCdK6x2iC5RMVAZCVaDC/KP/oYLIs j4ketAvMFecL/m/86kQqMz0Ug/j9mMwtjylS5WwKxEpf6t4t1QRMQyRqmpkdeNRTmfHX W7Z3mGp44JOSQ9M98oN7zc4/JYgBpOEte3IDmU6nevWWe95NEdlUR6hBDrrLWpGbIcR3 oZIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=Jom2upwk; 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 dt20-20020a170907729400b00734bbe8d2e1si935305ejc.545.2022.08.11.06.53.08; Thu, 11 Aug 2022 06:53:34 -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=Jom2upwk; 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 S235540AbiHKNNi (ORCPT + 99 others); Thu, 11 Aug 2022 09:13:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235471AbiHKNNe (ORCPT ); Thu, 11 Aug 2022 09:13:34 -0400 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B93F6E2EC; Thu, 11 Aug 2022 06:13:33 -0700 (PDT) Received: from zn.tnic (p200300ea971b9854329c23fffea6a903.dip0.t-ipconnect.de [IPv6:2003:ea:971b:9854: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 F16601EC059D; Thu, 11 Aug 2022 15:13:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1660223608; 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=OldGnQzh68j0ria9OKr1ZKpGr6HHRfZ58vsjqVtmBGM=; b=Jom2upwkNnyYk1jgdaBY1cA2U9a1piccWCjIfwQWrzp2t4mYuQKDRlSYFkCHpeu/iUfeQM rFpZxOGA4A+OzHUIwp8pVdVz1VL8nRyYCFZEqjBaEqylpDodbKiCnCKKXkAfKStqXDzwvo CTEWgaPRc9+rgc253wfO5evolOJ5YBU= Date: Thu, 11 Aug 2022 15:13:23 +0200 From: Borislav Petkov To: Sandipan Das Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, x86@kernel.org, peterz@infradead.org, acme@kernel.org, namhyung@kernel.org, jolsa@kernel.org, tglx@linutronix.de, mingo@redhat.com, mark.rutland@arm.com, alexander.shishkin@linux.intel.com, dave.hansen@linux.intel.com, like.xu.linux@gmail.com, eranian@google.com, ananth.narayan@amd.com, ravi.bangoria@amd.com, santosh.shukla@amd.com Subject: Re: [PATCH 04/13] x86/cpufeatures: Add LbrExtV2 feature bit Message-ID: References: <172d2b0df39306ed77221c45ee1aa62e8ae0548d.1660211399.git.sandipan.das@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <172d2b0df39306ed77221c45ee1aa62e8ae0548d.1660211399.git.sandipan.das@amd.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 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 Thu, Aug 11, 2022 at 05:59:52PM +0530, Sandipan Das wrote: > CPUID leaf 0x80000022 i.e. ExtPerfMonAndDbg advertises some new performance > monitoring features for AMD processors. > > Bit 1 of EAX indicates support for Last Branch Record Extension Version 2 > (LbrExtV2) features. If found to be set during PMU initialization, the EBX > bits of the same leaf can be used to determine the number of available LBR > entries. > > For better utilization of feature words, LbrExtV2 is added as a scattered s/LbrExtV2 is added/add LbrExtV2/ > feature bit. > > Signed-off-by: Sandipan Das > --- > arch/x86/include/asm/cpufeatures.h | 2 +- > arch/x86/kernel/cpu/scattered.c | 1 + > 2 files changed, 2 insertions(+), 1 deletion(-) > > diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpufeatures.h > index 393f2bbb5e3a..e3fa476a24b0 100644 > --- a/arch/x86/include/asm/cpufeatures.h > +++ b/arch/x86/include/asm/cpufeatures.h > @@ -96,7 +96,7 @@ > #define X86_FEATURE_SYSCALL32 ( 3*32+14) /* "" syscall in IA32 userspace */ > #define X86_FEATURE_SYSENTER32 ( 3*32+15) /* "" sysenter in IA32 userspace */ > #define X86_FEATURE_REP_GOOD ( 3*32+16) /* REP microcode works well */ > -/* FREE! ( 3*32+17) */ > +#define X86_FEATURE_LBREXT_V2 ( 3*32+17) /* AMD Last Branch Record Extension Version 2 */ > #define X86_FEATURE_LFENCE_RDTSC ( 3*32+18) /* "" LFENCE synchronizes RDTSC */ > #define X86_FEATURE_ACC_POWER ( 3*32+19) /* AMD Accumulated Power Mechanism */ > #define X86_FEATURE_NOPL ( 3*32+20) /* The NOPL (0F 1F) instructions */ > diff --git a/arch/x86/kernel/cpu/scattered.c b/arch/x86/kernel/cpu/scattered.c > index dbaa8326d6f2..6be46dffddbf 100644 > --- a/arch/x86/kernel/cpu/scattered.c > +++ b/arch/x86/kernel/cpu/scattered.c > @@ -44,6 +44,7 @@ static const struct cpuid_bit cpuid_bits[] = { > { X86_FEATURE_PROC_FEEDBACK, CPUID_EDX, 11, 0x80000007, 0 }, > { X86_FEATURE_MBA, CPUID_EBX, 6, 0x80000008, 0 }, > { X86_FEATURE_PERFMON_V2, CPUID_EAX, 0, 0x80000022, 0 }, > + { X86_FEATURE_LBREXT_V2, CPUID_EAX, 1, 0x80000022, 0 }, > { 0, 0, 0, 0, 0 } > }; Other than that: Acked-by: Borislav Petkov -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette