Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1376497rdb; Mon, 2 Oct 2023 07:49:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFexpXk4ZyyjCHniXZ8maQ7jKAdWxrOBa7z+MP8EQC7F+tfw0vPK1H5RYXLwrM3k5zzk0Xx X-Received: by 2002:a17:90a:fa96:b0:276:d357:c4bd with SMTP id cu22-20020a17090afa9600b00276d357c4bdmr9978734pjb.28.1696258139958; Mon, 02 Oct 2023 07:48:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696258139; cv=none; d=google.com; s=arc-20160816; b=ROkXuh26LHawOHdtxtNd8VwAc1USfaDLmZ2PCjRVnI5/r/iKtZN1olkkUo1iInW/cK Jasp6O9VIaVvHe1XKAJs5eaI4TYuBn3Y2j5AorV5SWcL8G9R0jnwF4H6b9kudD8dPO2I 9Nl2MbhZiWW3I1nPWP06f6VoR/VDVh4OJFUaTKyknfAtw4xYJsykeTGGDgmAyE6t+1/y T0OWK3P+ZC4MOibAo5MNxRUgpYhuSsyyB3mJwVevxdID4xnJshqT7aYBG8It7oHgFBeC 2vdGdleBgq3KURh6zFIWW+U6xfUV+fghJl1bChQJZbNPOr0STCzARlr1pDeRj0uNXkAc d9gg== 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=KL1v3ERuqGAckhQouBuxqqIbYjdQyTtkhHki0C/q84c=; fh=atjkopNAJ3I+PmyHNxL1sIk1WQe3W65fUTNCxTw8jT0=; b=h56p5CgdGl2umGyVdDWydolJFf3kc51HyAZcN3mFBo4sVXnA9r/NWJOUGmOVy9nHit sQMF9lk2+FksKVdiczi5EBj/N7sKaJ3dLjQALl353PUUoag0+GuVqQfNp4FHzj9NC78i +TdlGNVFds9qBSWBiLxaoUrI1BzEVsykA8xk9VOdC6anSzcJbIjO2Z8jsQfLlGcMwa+l Cj1fQEUJWE65Hr0/gjmFJG0j0d4ZtiTnuD8fJVMSjOMD94rM287LrbRTjr1H3T04D7iu j2+eh5rkwgUE+ctqkL411s8EJiK296HqRaR54QDY+PzHD4AgY+DxdTvws0dqpUVpsmmh 01SA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=YP5xSF1O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id e6-20020a17090a804600b00277624ffa82si7688965pjw.86.2023.10.02.07.48.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 07:48:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=YP5xSF1O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (Postfix) with ESMTP id A1C5E804C23F; Mon, 2 Oct 2023 05:29:49 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237110AbjJBM3o (ORCPT + 99 others); Mon, 2 Oct 2023 08:29:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237028AbjJBM3m (ORCPT ); Mon, 2 Oct 2023 08:29:42 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55191EB; Mon, 2 Oct 2023 05:29:37 -0700 (PDT) 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=KL1v3ERuqGAckhQouBuxqqIbYjdQyTtkhHki0C/q84c=; b=YP5xSF1Oemu2I0hFWrgo43pZ4h fCiZhQofphigB6JQOLIKI/85S60pcMYf1mSHKG39Qsw1JPGo+kXmrufEBFbb+X7zBIQsztHNbTVVD +DjOXt1FD2ZYeisEBDVigdkdAIqZTlY6hWxGBbWQOdtURVMGlg7J9Qw/NXiWPz46GC9WVdLPwuDZx Vn3YHkqkwGFvsm2qDNP4Fe+DV/Z1i0NU5bMns0C73DW25bNMz9NXviIf2iR99M4zXS4KdwNQhJ2pw UeCnkQP33VhvHvHzin+hhLfMRzHFjbIEADlEhAjD0rQI2m+0yNBQkIxbFnY7LvXlc9ECyaQCD1Ly1 l0EOqJNw==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1qnI2v-0091Eh-Ne; Mon, 02 Oct 2023 12:29:09 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 64E33300454; Mon, 2 Oct 2023 14:29:09 +0200 (CEST) Date: Mon, 2 Oct 2023 14:29:09 +0200 From: Peter Zijlstra To: Ravi Bangoria Cc: Sean Christopherson , 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 , Manali Shukla Subject: Re: [Patch v4 07/13] perf/x86: Add constraint for guest perf metrics event Message-ID: <20231002122909.GC13957@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> <957d37c8-c833-e1d3-2afb-45e5ef695b22@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <957d37c8-c833-e1d3-2afb-45e5ef695b22@amd.com> 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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Mon, 02 Oct 2023 05:29:49 -0700 (PDT) On Fri, Sep 29, 2023 at 08:50:07PM +0530, Ravi Bangoria wrote: > On 29-Sep-23 5:23 PM, Peter Zijlstra wrote: > > I don't think you need to go that far, host can use PMU just fine as > > long as it doesn't overlap with a vCPU. Basically, if you force > > perf_attr::exclude_guest on everything your vCPU can haz the full thing. ^ this.. > How about keying off based on PMU specific KVM module parameter? Something > like what Manali has proposed for AMD VIBS? Please see solution 1.1: > > https://lore.kernel.org/r/3a6c693e-1ef4-6542-bc90-d4468773b97d@amd.com So I hadn't read that, but isn't that more or less what I proposed above?