Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1889768pxb; Wed, 9 Feb 2022 06:44:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJwsEUMmmVrv4TrYeJwzqLboWalMo98jQqpSP+gt0lDURztxpZc9uNA+UJjzCNJP6LP+fbOF X-Received: by 2002:a05:6402:3546:: with SMTP id f6mr2812546edd.363.1644417877061; Wed, 09 Feb 2022 06:44:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644417877; cv=none; d=google.com; s=arc-20160816; b=p7QhWxkI+JXyv4wi0xcRXZA4cXc45sZD4CylIRDjR8g1Qgp0+VH8CITem3/05bsD/5 FUsQig1LyKdJtazQpvrwSTiy3s85nxsZ/LyduvZWMnnJM25qx+xiOR9BMnRls5ldW7tR 3BqZSo6ocNzs1E/dPUO7dYgBiyh+/84k+xTJcfdjoN8JrBDlvp0o4P1qpZLUtijsHWG9 O5Bnv/lnWHR8vEYdAvh6Z4zW/xtYd3o0Ue0xTCHaIhbw7rZXUHhX0fPSqrSLdxmQ3RTZ bcXJTiaTt3/NNO5ly/AQEBLO+xbz0AfmxjXttNyEtbZyrTtjc/YTOfjNDUsWUDBdiXB0 UmGA== 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=qNFeZbXeaZKk85n28kZlF4G4XFUL/pGDhSDIhAQszpM=; b=d9XMV1Wqiej0SfiaGe/A96h6J1qtkq6Zl/qRmGq+W106B4q7HozkYKeKI1HJI3jhmi OCNQHZfi7oE9lbxwylsH5Ybt8Jfncc/oP344m6+SeF1c1KE8s5rFcu9uUrQ+lR56ATR8 D2cFD/XyXF1H6lt2I8HOh7Y92jwMnJ7INL3yCa8g84eghtM6el5DAXZTmXqHtKVkN8QY w+W5nNT5MognaxXaRr5Sk47vysvufq+FyqUaKBPlu08ljJKCmW3zDRBrMzPQqHWSwWu1 jxaXHlZZWEKqaCbYeVdsRiI3lhQ16MUu364qXmvTl9leh/CfZbNPE7/PMocc6DeI8qnC wMJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=MTJjgBht; 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 n12si13549396edx.380.2022.02.09.06.44.11; Wed, 09 Feb 2022 06:44:37 -0800 (PST) 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=casper.20170209 header.b=MTJjgBht; 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 S234005AbiBINdb (ORCPT + 99 others); Wed, 9 Feb 2022 08:33:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229774AbiBINd3 (ORCPT ); Wed, 9 Feb 2022 08:33:29 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CF28C0613C9; Wed, 9 Feb 2022 05:33:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; 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=qNFeZbXeaZKk85n28kZlF4G4XFUL/pGDhSDIhAQszpM=; b=MTJjgBhtdTUnuAO1JGOZdtaUFs I+2ttLT4l44z55HYhUvItVJwzExq3r+CcY7FaRbcUrDFxWqDPX+383xbP81pPo8EuNtgAmmdt7Kkk MQiulzsU1wXPVBIDC5jxd1018017hSETE+Gvq6rGROczOxSvMgOuJ1jmbXdaCmf/CwPmlACW06zf+ kL2gsdV/NblV/RHvuDRwXYcg5RwFWiHKYUBwKadHengfLf5RnaaF7Tcs4nB7pZKCbTDcJJD2SflLc gxPEMN6FB4MNJE7IqckLyyUZXN1yRmKc+5r/CYRGiQjpWuOn0xPvSVoygaQHD703zudw6MrzjlKQJ cSEspMLA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nHn5w-007ntX-Dp; Wed, 09 Feb 2022 13:33:16 +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) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id A6E99300478; Wed, 9 Feb 2022 14:33:15 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 905EF201BECDA; Wed, 9 Feb 2022 14:33:15 +0100 (CET) Date: Wed, 9 Feb 2022 14:33:15 +0100 From: Peter Zijlstra To: Like Xu Cc: Jim Mattson , Paolo Bonzini , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Stephane Eranian , David Dunn Subject: Re: KVM: x86: Reconsider the current approach of vPMU Message-ID: References: <20220117085307.93030-1-likexu@tencent.com> <20220117085307.93030-3-likexu@tencent.com> <20220202144308.GB20638@worktop.programming.kicks-ass.net> <2db2ebbe-e552-b974-fc77-870d958465ba@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2db2ebbe-e552-b974-fc77-870d958465ba@gmail.com> 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 Wed, Feb 09, 2022 at 04:10:48PM +0800, Like Xu wrote: > On 3/2/2022 6:35 am, Jim Mattson wrote: > > 3) TDX is going to pull the rug out from under us anyway. When the TDX > > module usurps control of the PMU, any active host counters are going > > to stop counting. We are going to need a way of telling the host perf > > I presume that performance counters data of TDX guest is isolated for host, > and host counters (from host perf agent) will not stop and keep counting > only for TDX guests in debug mode. Right, lots of people like profiling guests from the host. That allows including all the other virt gunk that supports the guest. Guests must not unilaterally steal the PMU. > At one time, we proposed to statically reserve counters from the host > perf view at guest startup, but this option was NAK-ed from PeterZ. Because counter constraints, if you hand C0 to the guest, the host can no longer count certain events, which is bad.