Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2300920pxb; Wed, 9 Feb 2022 15:34:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJxKpT0FDPAS6oEODeTMOysfYqBGF3rjF+m5l2yQxx2gIHWoi/8a8Bn8r7tExC1B8NeRegP4 X-Received: by 2002:a17:902:f606:: with SMTP id n6mr4578642plg.32.1644449697390; Wed, 09 Feb 2022 15:34:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644449697; cv=none; d=google.com; s=arc-20160816; b=TwE0fxas02tjzXbUzpYXviSca9yYbr3uK5Sd7GYXljQxWTq12085knBmCJqReFn8BW riuJvzSinUqnQdl4kJrlyPtL0XDEO1frbFZF2Dwv3NrP7aBR0Bb9aYdeNL9s0qPBogk9 5RRV3DpSXGhLScw/aAH3cZi1WQwHlY/izMDOYJgpIfIJQ6U0aRBeBfhunpAMJsz7HQe1 t0mIOuAR4CYRWPG+cVaL54Vg+mtQx5vSTh+NeDbru6kaorwjjrUQnYPEW04nmRQIep1b UQsFfehVYeRQ0gBze1AyJ+Yk+AQ/og/GA7HnxSXpKUGBpxv/Qagd/ZzApxpX2dSjliBC 7ZSQ== 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=EQu/Hvwu+5JuPznaoKbB1EorddMM7fTfsGLmiQAYQZI=; b=NuVf9IjfwXs1mhKRcvHpTKhTSsDyL6W8N8aOiPr5Pukk6X4wEkQoRUb4+iHDoCpX2a qjJyekIIYcXOY1Y0yXbjcxYTDN2tpVsY2rXsnQVKkMW27hUS5RIS6T9cWC6RBotHnDC8 g9MI1UKj7gdTSD0tZpHYCYltBt0Aivh5qY3y/DOYrylHhlR/KocNul5zi5rn4ONleK0h ODw2uJ4nnfmwpPXX0pKMxc+gu//+7Dbgt1IUoKWFNG01uco4dtMz2D1+yK/u91DSV+bX udr6TJl7mOQN/1UlfNqsWMdxVOHRHIFgHUTqlbDvDiLlqrQ0j0Uj14oWk37C2vJbiQAo UXtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=K+wmv2hy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id me16si8084856pjb.173.2022.02.09.15.34.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 15:34:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=K+wmv2hy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B4945E08113B; Wed, 9 Feb 2022 15:22:54 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232637AbiBIVAQ (ORCPT + 99 others); Wed, 9 Feb 2022 16:00:16 -0500 Received: from gmail-smtp-in.l.google.com ([23.128.96.19]:45044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232506AbiBIVAK (ORCPT ); Wed, 9 Feb 2022 16:00:10 -0500 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5500DC03C1B8 for ; Wed, 9 Feb 2022 13:00:13 -0800 (PST) Received: by mail-pj1-x1029.google.com with SMTP id h14-20020a17090a130e00b001b88991a305so6426724pja.3 for ; Wed, 09 Feb 2022 13:00:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=EQu/Hvwu+5JuPznaoKbB1EorddMM7fTfsGLmiQAYQZI=; b=K+wmv2hyR2o8GJLwGQa4S1j9XHcyrLXv9yntJQKJagwDON8Q4/S+YXfDU2qt15cdj8 psPnt98ZiiT/D200xM9bDtrQ+CHf0LP229pyfFLh6cDD59cDrRPapKdmsU2YxPaifnKe UaGx9jo1pxf2e2+/+N9hOIr/dkWmr15Shzpa6k9f4Q5YeeKsXXp6oTtNbBDJfvGrjCcc 7ErBHiYR8KOQT7AMrFSVpQGW5SF1pUvj1eAnhqQqGUr5z4Hqjk7npHA62tBUcPzdwSMt 0SNkAjeg+iyaUzwrsHebnzsx23Cz3DtSQfz/J8gUmuud0TgSB51o8R6BG0tYGhVtBjhk Pleg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=EQu/Hvwu+5JuPznaoKbB1EorddMM7fTfsGLmiQAYQZI=; b=a7Iuc11+4IvHoTpIZt7y8xnFa3P2GCoAQE50heCdWtIWYRE+qIiREGfT3rRP2eQxhC Su2UYMrWwti4B7Mk32QqtC9ffuUpv4H/9c/ojiy+piW0PsbeLIC16VOuCW3b/YCRlMza PT694YFUiGm984ytz4q5H+UN8/TAWlFWiyGZWJUQEuF0Abgfm7vP1Y3cm6xoicblV48V 9li4dSxenRZMmOsccL155KkFn1qfFTiMhnDdvK0VHwY9BAul6zWH7C0JfpVuXBqtCzYm CSmj3ZXcV6GXNi+Lr8x1Gm6rMVy3QmZREYCJifZ3PsGkhxJec24GhGznOKW/vTOPGDhd L76w== X-Gm-Message-State: AOAM531KrTSL5npjOTbOVC+VZo2sDr1KujQBdX2Y68Ggds2jU1GZ+mP5 y45dWov9QorYkE81JWHu+Ygc3Q== X-Received: by 2002:a17:902:8c91:: with SMTP id t17mr4013103plo.89.1644440412425; Wed, 09 Feb 2022 13:00:12 -0800 (PST) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id d8sm14043624pfj.179.2022.02.09.13.00.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 13:00:11 -0800 (PST) Date: Wed, 9 Feb 2022 21:00:08 +0000 From: Sean Christopherson To: Peter Zijlstra Cc: Like Xu , Jim Mattson , Paolo Bonzini , 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: X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=no 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, Peter Zijlstra wrote: > 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. The proposal is to add an option to allow userspace to gift the PMU to the guest, not to let the guest steal the PMU at will. Off by default, certain capabilities required, etc... are all completely ok and desired, e.g. we also have use cases where we don't want to let the guest touch the PMU. David's response in the original thread[*] explains things far better than I can do. [*] https://lore.kernel.org/all/CABOYuvbPL0DeEgV4gsC+v786xfBAo3T6+7XQr7cVVzbaoFoEAg@mail.gmail.com