Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1320367pxp; Thu, 17 Mar 2022 07:16:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/G3kmQ5LaoeA0gWqfPpo59C6e1HrDhxaeY+L60EAJCQ874ve2f2paz90wzmgDAuhUGLsU X-Received: by 2002:a17:906:c141:b0:6da:b786:3fd4 with SMTP id dp1-20020a170906c14100b006dab7863fd4mr4621378ejc.16.1647526567016; Thu, 17 Mar 2022 07:16:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647526567; cv=none; d=google.com; s=arc-20160816; b=EHMkLj9jlVEWQgGgmJ4sR7vR+3kuvdqYnZ0ebTzZdotsscr7bomfAX58nwx66j/Tbo Id/43CozopQQ2xuAXLA8Jd5eV3Mb5edCa8170mVYalNkpVwCAMPJJ1Vn1pWRwsI3yzTm KfySsRoFXgi2VKl3WkVzMNz2LMHdYR3ZipMtV56KpWcJaZTw/rcvjQkK+9hhSuvzl8hD Im3b/3459jOu97pSYGDKgYRrBXcB9O8RyTxlBajul3RJV1DdKyRcP9uPOTIGgKYq32xO 3vKf9UxmOiS4BwQQRXfjUmfZf4oOEvvmTqmnUPCVIyOKUKqDKO3nOBE5Miouuo465R0l SXvQ== 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=x/tKXZAuaT10dOmNb48L5fwcPj4mj0LsJJXIVULmxmo=; b=e4h1FZoovfcOISm/k8tt7YHV0UBvSO1uAbef/k+xSLOyL7tE47DLjeDsR9gvch5K7C HyP6dqVIcO0Z2cV50SQgFWtCrZkUHuDcNMnyt05J3Y0g30p9HwUrVlvK/kzMrrDuT9EK JcNyLqeSp+64S7KqAInTcmN9c8BsocJ+u5pvRWiXjUlfnMaWpYUhN0wNNeTgrzc8zRJy 74PVQIppWCz54IJ5Sek1+u1PaZsnMqdRTPVTXSBnmQSmuBzUHcBrc5tqzRP2WGHmuLd8 VVDYQz7UkuqxEC9mNFf6H3GepcL3F/+6oCx7FG68Tm/Jby9g96RU4Kz/mr0b5Vi4k9uf hUtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=OttygPqt; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h8-20020a50cdc8000000b00418c2b5bdf5si1426936edj.215.2022.03.17.07.15.40; Thu, 17 Mar 2022 07:16:06 -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=@infradead.org header.s=desiato.20200630 header.b=OttygPqt; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232996AbiCQL11 (ORCPT + 99 others); Thu, 17 Mar 2022 07:27:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51410 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229852AbiCQL10 (ORCPT ); Thu, 17 Mar 2022 07:27:26 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87E7B1E3E0D; Thu, 17 Mar 2022 04:26:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=x/tKXZAuaT10dOmNb48L5fwcPj4mj0LsJJXIVULmxmo=; b=OttygPqts8Wu6Mt2x2yh5JfeVl 4ILJ7FfsAvfive5NryHbromRQqJWsnlfX+LLpJbn3xz3lR6kxP6R8RHaGqTay4xbPHgSDriotQ4AU O3gTGfZsB+bEiRTC97gIvql4ohQJIN0aCrxI1LrU3BdCysynWyH6Ga4JuCPQSZh5xjT0HLTsjVTqc +QSNTZUAwHqOkx4P4Nrb+WI24QMBsi7YC3xTqRZUBmszaTiqxLgPdGJAojq7nW/sPD7yzSXeE4N7K mwjYcK6HiK6O30fLPADTqyC8niHn4wHYl0TdouNHFcsQzvi37U1QBrmERRrF0xUQUjzb/3zKzz0En l7YCXk6A==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nUoGM-001s85-5a; Thu, 17 Mar 2022 11:25:50 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 201353001EA; Thu, 17 Mar 2022 12:25:48 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 012732D621570; Thu, 17 Mar 2022 12:25:47 +0100 (CET) Date: Thu, 17 Mar 2022 12:25:47 +0100 From: Peter Zijlstra To: Sandipan Das Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, x86@kernel.org, bp@alien8.de, dave.hansen@linux.intel.com, acme@kernel.org, mark.rutland@arm.com, alexander.shishkin@linux.intel.com, namhyung@kernel.org, jolsa@kernel.org, tglx@linutronix.de, mingo@redhat.com, pbonzini@redhat.com, jmattson@google.com, like.xu.linux@gmail.com, eranian@google.com, ananth.narayan@amd.com, ravi.bangoria@amd.com, santosh.shukla@amd.com Subject: Re: [PATCH 2/7] x86/msr: Add PerfCntrGlobal* registers Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,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, Mar 17, 2022 at 11:58:31AM +0530, Sandipan Das wrote: > Add MSR definitions that will be used to enable the new AMD > Performance Monitoring Version 2 (PerfMonV2) features. These > include: > > * Performance Counter Global Control (PerfCntrGlobalCtl) > * Performance Counter Global Status (PerfCntrGlobalStatus) > * Performance Counter Global Status Clear (PerfCntrGlobalStatusClr) > > The new Performance Counter Global Control and Status MSRs > provide an interface for enabling or disabling multiple > counters at the same time and for testing overflow without > probing the individual registers for each PMC. > > The availability of these registers is indicated through the > PerfMonV2 feature bit of CPUID Fn80000022[EAX]. > > Signed-off-by: Sandipan Das > --- > arch/x86/include/asm/msr-index.h | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/arch/x86/include/asm/msr-index.h b/arch/x86/include/asm/msr-index.h > index a4a39c3e0f19..61d1a55e15b8 100644 > --- a/arch/x86/include/asm/msr-index.h > +++ b/arch/x86/include/asm/msr-index.h > @@ -504,6 +504,11 @@ > #define AMD_CPPC_DES_PERF(x) (((x) & 0xff) << 16) > #define AMD_CPPC_ENERGY_PERF_PREF(x) (((x) & 0xff) << 24) > > +/* AMD Performance Counter Global Status and Control MSRs */ > +#define MSR_AMD64_PERF_CNTR_GLOBAL_STATUS 0xc0000300 > +#define MSR_AMD64_PERF_CNTR_GLOBAL_STATUS_CLR 0xc0000302 > +#define MSR_AMD64_PERF_CNTR_GLOBAL_CTL 0xc0000301 My OCD would suggest ordering them by number :-)