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 8634BC433F5 for ; Thu, 10 Feb 2022 19:56:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241342AbiBJT4C (ORCPT ); Thu, 10 Feb 2022 14:56:02 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:53504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239114AbiBJTz6 (ORCPT ); Thu, 10 Feb 2022 14:55:58 -0500 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 006B75F58 for ; Thu, 10 Feb 2022 11:55:57 -0800 (PST) Received: by mail-wr1-x42e.google.com with SMTP id o24so8827020wro.3 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=dxXb/7ohnQaJqORBCky8tnwNXhKscOz3FY6VyBSK9wgi1KvOWPSje4/L2ClaGwHhp9 r9IgmjVCAzlcMXKyf2fBEzmOdyNmleSBRUb8MB6+AwqnjTT+JUqhCn4zx0g82swPlnC7 0l9xUFJ6cjOmANcot5BOWvGc1/ph+E5KmgYKfS8sX/r2kFt6KHH69LsVW2Gm1dRV+TqV pC8f+im27pXl7/bMKRF6y7fYkqEdXe3DfL4ic5RVTHrnirrr5fMnXWMHlNSbAeYiWLhX 8D4ewNO8ql/R4UDpyaaAnZ46R7ofFZFCKkocteOpFC70gBhMwOUneEe/Hd5zn1PWJ2RK op1Q== X-Gm-Message-State: AOAM531GTBYgEuTaydCHgCM2xeSN32bszaMbI8lCfI1ug/DWI1/Z8bUp WDpo/ohlfaFAF28up0p8C7a0KPWEKAj4rkcyOG4V7A== 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: linux-kernel@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