Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1549380rdb; Mon, 2 Oct 2023 13:08:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGi+bQXLo2JWtZPfhFrD5tSeYlVGEuYs8PdpbKSgHzIvaU+DFCA472/R6uwE3PpAQAcxn22 X-Received: by 2002:a05:6a00:190e:b0:690:ce30:47ba with SMTP id y14-20020a056a00190e00b00690ce3047bamr11370102pfi.10.1696277280326; Mon, 02 Oct 2023 13:08:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696277280; cv=none; d=google.com; s=arc-20160816; b=lKm2/BG3n14GzaymJcyuFhyEIqTcln2gt8xTeFFnoCcnK9wmQGUuELMJUS4tnPDz2e T4EOtX2hxZxaVGK5Iez3Qjy2uipUX2c5oBkX2/NHUJ2rzaQwrdI1hKrhtlPmMafTsOIi PV1V8V4Ir3I2ly10FaaLbaEX7ZIOj5QXBt4IZ/wpTgg+Wx6SFwALm97s6BvrH0qKp7LK tn4vvg0SqrIwvZOe777PLprTyaYhZ9BgzknhAonn4Vv4D0/xKdYttVi4klIOeEeafNo8 hD5RoAq6g1XgWS5ANhv91/3ObCN+hLuMCVmw7vwRNYAI4kbUyEpVufbiZDy1BO9ox2JS fEnQ== 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=Wkp4ZFR4A8eDeB5jRNcWvSfEDmCQBh31225KsSq0CIM=; fh=HYbKi0+ttYwd0RpmCeb9W3ZzLXnr9aLI3RamTuTg2Tw=; b=Ta7ubMuDkj1j9KoaHPdIRNA5PBrQI08EGzhpac1vNfrH/ljYBDYRJtJlTvrLiYWutV iUGGHkkDd9XKRDVDOw/ucFBa89WpC/wRe2JBXTgBBU8oNWFTymoTa4vUTiLr1JL9VwXt 0j5PeTxCD8lAnAYAsdRXgpyrfbM+4fE9wTCv675m/RI0A4MkgnoCs0dcijMm85i10vDp +TzMbacUvA/WMbgKcqdEUeAtLvMBcL3EP+NSpr4jmAv2bBhGOQoQAejCjcJS4vKTYgl/ i+/4edb6Ki0Kx0pEUzakWfb5t57ltEi0VvqoezNTfiMvJTDPEKBmOA+je35St0N7woih 5CLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=dc8WAugV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id ck12-20020a056a00328c00b0069026a3de0asi27133617pfb.138.2023.10.02.13.07.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 13:08:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=dc8WAugV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id D50998023980; Mon, 2 Oct 2023 04:58:09 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236806AbjJBL5y (ORCPT + 99 others); Mon, 2 Oct 2023 07:57:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231338AbjJBL5x (ORCPT ); Mon, 2 Oct 2023 07:57:53 -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 E9C97DA; Mon, 2 Oct 2023 04:57:49 -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=Wkp4ZFR4A8eDeB5jRNcWvSfEDmCQBh31225KsSq0CIM=; b=dc8WAugVpShhXR3MSKlvXjPHOC eheG5oU/xn3vn+bQm2fXAvqK7cp+YhZ93zD7SsmprJn6xaPL/61Rau/z2DJcWEFUbDpfbdRH2TF4p LGhPJsMhTui3n7wsD/T4iGkQ2kDa/1yKOMvoijNNVhFdfciB216+i3HkB6rwbtAVKu8uL8r6v+4zA 2a9A1z9HllqaPqJYb4O0oLGuKdqSDyTCxVsT0DLOScob8VEG1a3em2llnoVDDrlaUa8JS6BWmqR5m 4K4sVByJ879c6JOzej3Fdm+Xgsj8Oz/k1ct9Nli8w49ZkHa2ejxXZ8uGATKfWDYvNqfNCDQrmaak0 KpxeuWOA==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1qnHY5-0090Er-0H; Mon, 02 Oct 2023 11:57:19 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 347FC300410; Mon, 2 Oct 2023 13:57:18 +0200 (CEST) Date: Mon, 2 Oct 2023 13:57:18 +0200 From: Peter Zijlstra To: Sean Christopherson Cc: Dapeng Mi , Paolo Bonzini , Arnaldo Carvalho de Melo , Kan Liang , Like Xu , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Adrian Hunter , kvm@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, Zhenyu Wang , Zhang Xiong , Lv Zhiyuan , Yang Weijiang , Dapeng Mi , Jim Mattson , David Dunn , Mingwei Zhang , Thomas Gleixner , Ingo Molnar Subject: Re: [Patch v4 07/13] perf/x86: Add constraint for guest perf metrics event Message-ID: <20231002115718.GB13957@noisy.programming.kicks-ass.net> References: <20230927033124.1226509-1-dapeng1.mi@linux.intel.com> <20230927033124.1226509-8-dapeng1.mi@linux.intel.com> <20230927113312.GD21810@noisy.programming.kicks-ass.net> <20230929115344.GE6282@noisy.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Mon, 02 Oct 2023 04:58:10 -0700 (PDT) On Fri, Sep 29, 2023 at 03:46:55PM +0000, Sean Christopherson wrote: > > I will firmly reject anything that takes the PMU away from the host > > entirely through. > > Why? What is so wrong with supporting use cases where the platform owner *wants* > to give up host PMU and NMI watchdog functionality? If disabling host PMU usage > were complex, highly invasive, and/or difficult to maintain, then I can understand > the pushback. Because it sucks. You're forcing people to choose between no host PMU or a slow guest PMU. And that's simply not a sane choice for most people -- worse it's not a choice based in technical reality. It's a choice out of lazyness, disabling host PMU is not a requirement for pass-through. Like I wrote, all we need to do is ensure vCPU tasks will never have a perf-event scheduled that covers guest mode. Currently this would be achievable by having event creation for both: - CPU events without attr::exclude_guest=1, and - task events for vCPU task of interest without attr::exclude_guest=1 error with -EBUSY or something. This ensures there are no events active for those vCPU tasks at VMENTER time and you can haz pass-through.