Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1620286rdb; Mon, 2 Oct 2023 15:55:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGgbrfl6n5Yuv78yHVYJewT0UL1nW1rFRXijOibkHmhrNC6lsAAc1f4dZqKs+qzkNaOIFPg X-Received: by 2002:a17:90a:8cd:b0:277:70f5:115d with SMTP id 13-20020a17090a08cd00b0027770f5115dmr11692376pjn.0.1696287345966; Mon, 02 Oct 2023 15:55:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696287345; cv=none; d=google.com; s=arc-20160816; b=ZnNqZtjabYL3p5Es4KkhZr54FeujdFqKXLbASc2Cn6k+aoJVwhxBo2Xpm2y2+vA769 O/JtBqY8bJtO7GH3W/w8yp/1Z4A5EfqL3ESJtPDJRxTBI+zypTmRtaqv8MbOIOiu0ETW Mcb5en3Ioc7y3zM26Fz63Tbq5Vfld4xKEO5WgvWcoAmJFW8Jv+U8W0OMhUrwzm+o1N7g ND9V37qiMhj/7wwZxDxnGUZgS5LTyxsUjfqVZJw0RKhXWFwPs/MAL+FAa8PbDbzVNHD1 e3hGtykWd6pZEs8vQ0zTpjJXQG/1g64VIQp7C9MNSPuDEPPbde5jwsxWtcInd1PdOae2 7+Tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=PYugQSadN1sU4I76zsSR3ousR9bhAhoozl4QCo+YBEk=; fh=OWhwt+cSDq5WafpYSWHceTwdtcAJ/sbZiDoOBkpJfW4=; b=fCvcYO2PBJ7QeLA2qTWEi1dmwlgk68s27lG3shewciEwuBBJDqjArXT7lOjkE84tom +V0Frxzu1BGG8tsN5NhQR9YQIlOfvVOccGWEVYofObNc3lLSheRrPnLsHbkHac2B8u6d 6ePFfsUUSbJcjc53miZdqdlYGpE4hbn2JIY6wr73/sSOqiIx1YRV/ActMsQ8fvjPewwU UfytaVT9xR368ifc6qVvnxyTjM3fnq8GyqIb9B+qlhoMwDEvNLNqnlUlDwO97qACJetP YBfcKT2kW8oi3LRAWoStAPMZPvAKbCpEUWfg0FZeBKNB0kYWwnfG3VSkgRX+L+93aRFg 3lrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=eSGXxC87; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id d22-20020a17090ad99600b002719ad11d97si8506447pjv.137.2023.10.02.15.55.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 15:55:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=eSGXxC87; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id DD689806858F; Mon, 2 Oct 2023 12:50:50 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238954AbjJBTur (ORCPT + 99 others); Mon, 2 Oct 2023 15:50:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229750AbjJBTuq (ORCPT ); Mon, 2 Oct 2023 15:50:46 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 745CCB3; Mon, 2 Oct 2023 12:50:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696276241; x=1727812241; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=PYugQSadN1sU4I76zsSR3ousR9bhAhoozl4QCo+YBEk=; b=eSGXxC87fOl3AWQ8uzZ8BG9p7ZUKSR9rpVEzAS+1iXf9yrEBvWCSvdZi HEBXXFoPlyuvM8NSUEN4ibK/4ndnVWU/XnrrRhdVpgc00Q3hQ1qPTIg2r ZwvJi62eryYEJnxJ9x34g2mGEfY8T10wEcjilFQidnwLOlBJobOmhQ9Is UzPO7nqykTO/7wsaxxXQi4rJnsIUgb3B/9AVh5F2nn/DenbP9um03fSHI Y6JtCZ1aD55khu/cbr/YXt5KKGtCteLhHgfEIfzWNhcXrJFzSyuXZ7iC3 PBmvr1dgBkGwzIxvktjjELnmt3J3i+MkQsbl2f46IPL9gr+08jQYdGoXT w==; X-IronPort-AV: E=McAfee;i="6600,9927,10851"; a="446882356" X-IronPort-AV: E=Sophos;i="6.03,194,1694761200"; d="scan'208";a="446882356" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Oct 2023 12:50:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10851"; a="780049233" X-IronPort-AV: E=Sophos;i="6.03,194,1694761200"; d="scan'208";a="780049233" Received: from linux.intel.com ([10.54.29.200]) by orsmga008.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Oct 2023 12:50:29 -0700 Received: from [10.212.65.113] (kliang2-mobl1.ccr.corp.intel.com [10.212.65.113]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by linux.intel.com (Postfix) with ESMTPS id 4DD90580AFF; Mon, 2 Oct 2023 12:50:26 -0700 (PDT) Message-ID: Date: Mon, 2 Oct 2023 15:50:24 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [Patch v4 07/13] perf/x86: Add constraint for guest perf metrics event Content-Language: en-US To: Sean Christopherson , Ingo Molnar Cc: Peter Zijlstra , Dapeng Mi , Paolo Bonzini , Arnaldo Carvalho de Melo , 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 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> <20231002115718.GB13957@noisy.programming.kicks-ass.net> From: "Liang, Kan" In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Mon, 02 Oct 2023 12:50:51 -0700 (PDT) On 2023-10-02 11:56 a.m., Sean Christopherson wrote: > I am completely ok with either approach, but I am not ok with being nak'd on both. > Because unless there's a magical third option lurking, those two options are the > only ways for KVM to provide a vPMU that meets the requirements for slice-of-hardware > use cases. It may be doable to introduce a knob to enable/disable the "CPU-pinned" capability of perf_event. If the capability is disabled, the KVM doesn't need to worry about the counters being gone without notification, since the "task pinned" has the highest priority at the moment. It should also keeps the flexibility that sometimes the host wants to profile the guest. Now, the NMI watchdog is using a "CPU-pinned" event. But I think it can be replaced by the buddy system, commit 1f423c905a6b ("watchdog/hardlockup: detect hard lockups using secondary (buddy) CPUs") Thanks, Kan