Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp891378pxf; Wed, 7 Apr 2021 14:17:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyiwZYIhRVM0XZ2uj9Pcpx8JLngOThMT5//7x3idxlZA1cQwlbb9yIrulpC0ULf9dU/jPzo X-Received: by 2002:a17:906:5618:: with SMTP id f24mr6278833ejq.414.1617830247760; Wed, 07 Apr 2021 14:17:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617830247; cv=none; d=google.com; s=arc-20160816; b=DLKsYj/6QgDjndi2/ZsCij69IHAdeAvL9IgqWzrO6hRJl/RIEsRRotvYV0a+DhEo6W vcdI0eHzCjV+AvunDkihxg9oRY6ZHG0Sk0XuWmTRLuKTvPdGjdDlXlNSTpYTUjDpadZ/ rPCS/ez1M/yw20iqN9OiRjJ9/OsDdxDxSWfZKlrnFSdXz0JVcTQItpf702XQXQnn6hPe G7uM+JmZMv3y88RImG9aZHLgUCq47Fxm+iQKetXzGCcqaz+IrIJR1aQ/UULUk0SDZBzV /e96Q/rV92gCcqVG6NR76Y1DC+5eVJw5X4IndbXghJhFB1SnkcSrJ0jwHRudxGszEe7h 1b0g== 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=jY0P2UufmdE70kZeDZbxVkRO7U3IMhijRe4MI2XThGo=; b=knaa5g3fL9OXubi5UXWjy3G4doelLCcr/B77jb59uaSkjc//eySWWmig+epSfEjkdX XxDmfc5MehN9HtDdud4G2uMoILKhGe2I3Nww8XAiEALN8FkLhbY8ON0plI9f7eZpHTm7 eHaTBBISfCdSd2xzyCxK9pssZ32Y1xfFitw0q+nFD2q+n92zpQqrb5O/tOqPLH8ift/X GYzvJbNRk7/hQxl4P5t2LnTMuHKlCjTWQ4kZzJF9pAL5nXpiRwlpwSb+57N1SPWeZHZR YhLRs8MtO+SHrYU2FUidqquFbWME7ZEfpTLBd6FboOXXq+rV3WrGotCmWuh87yhxIXg3 soog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=VaxFPZtM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id mb15si19790205ejb.147.2021.04.07.14.17.04; Wed, 07 Apr 2021 14:17:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=VaxFPZtM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353515AbhDGP0L (ORCPT + 99 others); Wed, 7 Apr 2021 11:26:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243029AbhDGP0K (ORCPT ); Wed, 7 Apr 2021 11:26:10 -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 114A2C061756; Wed, 7 Apr 2021 08:26:01 -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=jY0P2UufmdE70kZeDZbxVkRO7U3IMhijRe4MI2XThGo=; b=VaxFPZtMMZoPMFhKnxruK4TAIr Blzrz/XgpiuDBZ+WWc8+cpoWKhwPvAqnZL+zTgyYTPaIPkewMoQL7f5YoMEOEkRZELVXtWH1f4l04 bJ6Z22Uk+Uq+MBke9EjkMEwP+rBoH5MP6C4B6hDbMtatH9nwPRVYfS9RKQnhZWi6YZm3fXmEYn2ry 0ioRhmAjAKdxJNnzpcY697rSELXkaeUzn9MUNRIsBCUU/iwv3sPRMMXyTjCRlFr9ILPQwrP++T0Zr d6jvQKhgHrSiuUDJENprfbLuIo7Sco1xNphUesmL6fOeEEimdWv3+2DiO6dJnc+rOXg/3bRCxkfAE j/SLCgmw==; 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 (Red Hat Linux)) id 1lUA3g-005Gnz-7H; Wed, 07 Apr 2021 15:25:32 +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 (2048 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id E313A300219; Wed, 7 Apr 2021 17:25:30 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id D2DBF2BF82B41; Wed, 7 Apr 2021 17:25:30 +0200 (CEST) Date: Wed, 7 Apr 2021 17:25:30 +0200 From: Peter Zijlstra To: Like Xu Cc: Sean Christopherson , Paolo Bonzini , eranian@google.com, andi@firstfloor.org, kan.liang@linux.intel.com, wei.w.wang@intel.com, Wanpeng Li , Vitaly Kuznetsov , Jim Mattson , Joerg Roedel , kvm@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org, Andi Kleen , Luwei Kang Subject: Re: [PATCH v4 07/16] KVM: x86/pmu: Add IA32_PEBS_ENABLE MSR emulation for extended PEBS Message-ID: References: <20210329054137.120994-1-like.xu@linux.intel.com> <20210329054137.120994-8-like.xu@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210329054137.120994-8-like.xu@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 29, 2021 at 01:41:28PM +0800, Like Xu wrote: > + if (vcpu->arch.perf_capabilities & PERF_CAP_PEBS_FORMAT) { > + if (vcpu->arch.perf_capabilities & PERF_CAP_PEBS_BASELINE) { > + pmu->pebs_enable_mask = ~pmu->global_ctrl; > + pmu->reserved_bits &= ~ICL_EVENTSEL_ADAPTIVE; > + for (i = 0; i < pmu->nr_arch_fixed_counters; i++) > + pmu->fixed_ctr_ctrl_mask &= > + ~(1ULL << (INTEL_PMC_IDX_FIXED + i * 4)); { } > + } else > + pmu->pebs_enable_mask = ~((1ull << pmu->nr_arch_gp_counters) - 1); { } > + } else { > + vcpu->arch.perf_capabilities &= ~PERF_CAP_PEBS_MASK; as you already do here.. > + } > }