From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id ECD61C433EF for ; Thu, 10 Feb 2022 19:56:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241311AbiBJTz7 (ORCPT ); Thu, 10 Feb 2022 14:55:59 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:53502 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240256AbiBJTz6 (ORCPT ); Thu, 10 Feb 2022 14:55:58 -0500 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E65F75F4D for ; Thu, 10 Feb 2022 11:55:57 -0800 (PST) Received: by mail-wr1-x42d.google.com with SMTP id f17so11545764wrx.1 for ; Thu, 10 Feb 2022 11:55:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=yKXi8a/Wa+eHPps1BTbaSB0zXEKBLOSOppniPn0Pfis=; b=KIXghY7d76EqIZgH/qH4nyQVkopww5BOB6AJy5l4PXaZ5jCK7em88mfurNu5Ida8hL Hd+qyi5a01MP6MBUf4LDsMSa+Q/8B31GglQs5wpcLDcvT/hC6tt1QlH7qUDUoS8JAwOw 7uHT4UFJ8t2UVgK4jkm3eRQZVA0ct581Cve2ixO7l/cmytZ0lORhDcl+wgZfw2RqDVO0 z1N0LQMOp+1/fL734/hGMOcRUL0GCzFqxoAW3V43RR3NU3Zc2D/7ra3WXmw1mvTcTIo9 9pPeliJJD17cI7jkOpIxXlwlftl5ba7R4J8a30KTRiPadnfw1AmfUy4cVogqC4BybqtC SECg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=yKXi8a/Wa+eHPps1BTbaSB0zXEKBLOSOppniPn0Pfis=; b=n6e7pp1+lCv0Vnj5XIgHC9l8BgEsBS3+Rg1my1DhnBl/L9rFF7BygyTP/3oMd9j8mq 7fmTt+4ul/k9xlW3oOzPR71w4G7PdZGTvpxhqUZ64IMnO+cVxOKCryA3yI3oE4x7M1DX saEpan80EgDA836MtMjVeoFyh8KQPY9oXqAMnyD/iGoAmf3JtYK70tqzWGfqFU18sIyL knjvu5zewowOIcy+H2+kB/cCrqEVKFjYSEGqt7R6b28I7z9Px7N8sIFvNXWYWwk5vLg8 r2VhSgZLL8jL1BlscS36tIXHYDdDrETTy3fgPSwpiyh7DX91ThBVBLzLQGVbbWk11GQY ObhQ== X-Gm-Message-State: AOAM531DJUhgxhCcQhd0lO72QgB1UCzkAX/j5/WPDrg1izSzYlwmwlgg K6J5Z0mzpi7TI6+x0fW3UdTADXZOIg8pqCR/JR8wtw== X-Google-Smtp-Source: ABdhPJxD0pCxNdOmKrGTVovOyqWedlEr8LeptuwH7w5huyxy8bVVuZzqCTDtFsTK21uvq0eYwkNSjCcnEv50EEynGBI= X-Received: by 2002:a05:6000:1ac5:: with SMTP id i5mr7904367wry.703.1644522956333; Thu, 10 Feb 2022 11:55:56 -0800 (PST) MIME-Version: 1.0 References: <20220117085307.93030-1-likexu@tencent.com> <20220117085307.93030-3-likexu@tencent.com> <20220202144308.GB20638@worktop.programming.kicks-ass.net> <69c0fc41-a5bd-fea9-43f6-4724368baf66@intel.com> <67a731dd-53ba-0eb8-377f-9707e5c9be1b@intel.com> <7b5012d8-6ae1-7cde-a381-e82685dfed4f@linux.intel.com> In-Reply-To: From: David Dunn Date: Thu, 10 Feb 2022 11:55:45 -0800 Message-ID: Subject: Re: [PATCH kvm/queue v2 2/3] perf: x86/core: Add interface to query perfmon_event_map[] directly To: "Liang, Kan" Cc: Jim Mattson , Dave Hansen , Peter Zijlstra , Like Xu , Paolo Bonzini , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Like Xu , Stephane Eranian Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Kan, On Thu, Feb 10, 2022 at 11:46 AM Liang, Kan wrote: > No, we don't, at least for Linux. Because the host own everything. It > doesn't need the MSR to tell which one is in use. We track it in an SW way. > > For the new request from the guest to own a counter, I guess maybe it is > worth implementing it. But yes, the existing/legacy guest never check > the MSR. This is the expectation of all software that uses the PMU in every guest. It isn't just the Linux perf system. The KVM vPMU model we have today results in the PMU utilizing software simply not working properly in a guest. The only case that can consistently "work" today is not giving the guest a PMU at all. And that's why you are hearing requests to gift the entire PMU to the guest while it is running. All existing PMU software knows about the various constraints on exactly how each MSR must be used to get sane data. And by gifting the entire PMU it allows that software to work properly. But that has to be controlled by policy at host level such that the owner of the host knows that they are not going to have PMU visibility into guests that have control of PMU. Dave Dunn