From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 72E52C43461 for ; Mon, 17 May 2021 08:39:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 49078610C9 for ; Mon, 17 May 2021 08:39:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235692AbhEQIlN (ORCPT ); Mon, 17 May 2021 04:41:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235286AbhEQIlM (ORCPT ); Mon, 17 May 2021 04:41:12 -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 C30B6C061573; Mon, 17 May 2021 01:39:56 -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=229IDtmq+Z8rEfJbRIPfNQwRGXcrW7sSmIFvvDMKEaI=; b=EV1ZxjmUqmj4jeBhsHifycK+tg yLQIF2TXWcKLygFEzwkN8ndU7T6Yf4+1kIQRFEv83+/tR/FD8NC5iY2wHSHA+iX+zyXUkH/A7oJ7P iC8cDxdVHbXEf0VCXsEBjmHzTg0vSFfeJzg+LbtMiPIjbAC1c6eNtIUTA/CwWPhb/WAcEVqzxBbSd zZzVIiLW3SqrbPjMcyVQ7MXcl0Vg+513smtbxppu9WDxi+o8RvsRvg4n0Wa4TLTIqhX3Rdjuv80JS lpqYzucgsiUPUJk8DIW8fZ8+sGLEtKuomEn5ROMJHm+H7fDfQuHhmT2+arJrPmGeeuaAQaXn1RYKH P82xu/bA==; 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 1liYmV-00EHr2-SZ; Mon, 17 May 2021 08:39:33 +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)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 884E130022C; Mon, 17 May 2021 10:39:17 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 7088C2D3FBA07; Mon, 17 May 2021 10:39:17 +0200 (CEST) Date: Mon, 17 May 2021 10:39:17 +0200 From: Peter Zijlstra To: Like Xu Cc: Paolo Bonzini , Borislav Petkov , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , weijiang.yang@intel.com, Kan Liang , ak@linux.intel.com, wei.w.wang@intel.com, eranian@google.com, liuxiangdong5@huawei.com, linux-kernel@vger.kernel.org, x86@kernel.org, kvm@vger.kernel.org Subject: Re: [PATCH v6 07/16] KVM: x86/pmu: Reprogram PEBS event to emulate guest PEBS counter Message-ID: References: <20210511024214.280733-1-like.xu@linux.intel.com> <20210511024214.280733-8-like.xu@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210511024214.280733-8-like.xu@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 11, 2021 at 10:42:05AM +0800, Like Xu wrote: > + if (pebs) { > + /* > + * The non-zero precision level of guest event makes the ordinary > + * guest event becomes a guest PEBS event and triggers the host > + * PEBS PMI handler to determine whether the PEBS overflow PMI > + * comes from the host counters or the guest. > + * > + * For most PEBS hardware events, the difference in the software > + * precision levels of guest and host PEBS events will not affect > + * the accuracy of the PEBS profiling result, because the "event IP" > + * in the PEBS record is calibrated on the guest side. > + */ > + attr.precise_ip = 1; > + } You've just destroyed precdist, no?