Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp338647rwl; Wed, 5 Apr 2023 01:05:23 -0700 (PDT) X-Google-Smtp-Source: AKy350b6J1Psr5pTDVqHYD/gDhfa8MLNOGPxn2BAWFztX4uHdEW7CLRtFNQoW0zaqf5qY+agw6G1 X-Received: by 2002:a17:906:8a48:b0:8aa:c090:a9ef with SMTP id gx8-20020a1709068a4800b008aac090a9efmr2036814ejc.55.1680681923580; Wed, 05 Apr 2023 01:05:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680681923; cv=none; d=google.com; s=arc-20160816; b=BPL5GSj9bkJ38xMjdEDFqP+IJYs1kNXjgUqADEskkAjANhz8rSp+aGq3iJGSjhj/Jl hQ8WeZ6TSjBrRE3pS+ymCKSPpa33+dx2Zq4p/PQ+pQu3A5bSQYbG3TETNDQsUhyIMZ8r rDFZ94D5nJjHOhfmQpg2kWgJ36a97+OB2sp0wyfVUvmNVevP70tZtq1Cis/cKNVww0iG g6jwl2GAUCeAPPovnHxWMwMErfxVKtl0ZWEegPB6KMxyjwxcYrZmfVPZSoQXzVKF3C35 5ywUy/1ZD38L9Ocgum9JJ2SkpxZ3Fg1xSAEYLqZejTscMhSztJiawM4ItOvtCYjVCSzT O6eA== 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=1qeWL9csSccLs6fLdE0uQkmoTpVTl/CNeE7DAxN2MXc=; b=s+MeOk7meq5oFQZxGuV6Jv6L8J3cnGTf1/NV1ShtNE+XlPgvEZWgRifu3vsTFlwuGN Bw8tc381F83uUxnybjgch85EDRsdjqNmAFkkMuEUta8heeTm2/4MZ7aWq4PISCkcuxt2 AKYfP6UP20ZGwPBCWg0efw+KzKLRHLmnjLoD3/yG12ibedPJ/jAPqL+8yCyW/7O9hI4u 8m8JDlk1LgDAw+jQaCl37gOWukO5eliCGoDLreTEXvX457RHub2mMdgrkV5JD/Ypj6UY Oustkqw/zIdVDdyWLdmKIN3SSC157E+OYNYNWtmjgRL9/Zg11Qr8BY4yXj2+SjRVta7R AEUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=Xhq2FpN6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k1-20020a1709062a4100b009318c913c59si10526858eje.525.2023.04.05.01.04.42; Wed, 05 Apr 2023 01:05:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=Xhq2FpN6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236881AbjDEIEd (ORCPT + 99 others); Wed, 5 Apr 2023 04:04:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237209AbjDEIEb (ORCPT ); Wed, 5 Apr 2023 04:04:31 -0400 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A98E49E5 for ; Wed, 5 Apr 2023 01:04:26 -0700 (PDT) Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-947cd8b2de3so31871066b.0 for ; Wed, 05 Apr 2023 01:04:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1680681864; x=1683273864; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=1qeWL9csSccLs6fLdE0uQkmoTpVTl/CNeE7DAxN2MXc=; b=Xhq2FpN6Mn9U+EjSMWm81/rOkL0bCFC+/2wjeKRsitvqUzxRSPfp9fuoLeyBFssxEy uDCSbz1YbvYjEPswqb3S2GTeD5WrMfOxja6ExrIKkGQLeADhlgbB7YOPra4MuzjHMrmj ZXdFh+JVuRGjSQyYZanQX5QlEVziDHiVidIiylGL7f0MyJUhqMsMEyHDcOQ7gNiV1wC+ ahUaXralaKBaRSz4fOK+iGVNv27U4eaNu+zC6QxXTv6Jps/OaYMBUjv3ab9gY0hKw4g7 NAydS21zEz4TOSL9DVk3uvDj3K8Lk9ct3FFtJCd1yGfrC7kCaSATBwW4q2DaUE7YXwsp DLwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680681864; x=1683273864; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=1qeWL9csSccLs6fLdE0uQkmoTpVTl/CNeE7DAxN2MXc=; b=KgDR7W3s4hSYKcKRIoTkVcGCzalDtuLncAgXpx9kGGpXVtuhSEbI2FNRnD2eYl5i3z ETcVxBfYgh1MMaMhhEjPJYPzDa8m2PgONkPKdKadJV8JVxRD9WjwGGJVWk47stfAd+iM p/6MStPJ7LSt9CtYAOr5i7ucJbJTJFVUTTGHXvwcaqBm5P9Wwh4FffDmBtE8XzawaqTv HuPwe5Gfet421BJpOWRHjonH/fJkbtLqH2uOzve8m8dl5a0kfrazVLIqzIgEH6zd/Apn m3L2rsYss16LqwLrflWzruISpP30guz9khZja0MLLOnZ9zmME+97ywd7HBsE2YDv752V EZIQ== X-Gm-Message-State: AAQBX9fUD+rz/32/exjtfhbdhg/vYRpxQWXYy97bAd3CiVvC/XYtjytI l+nm/dpbV/NS+bZq82mqUd+Q8g== X-Received: by 2002:a05:6402:2026:b0:4fd:2533:f56 with SMTP id ay6-20020a056402202600b004fd25330f56mr1005988edb.39.1680681864506; Wed, 05 Apr 2023 01:04:24 -0700 (PDT) Received: from google.com (64.227.90.34.bc.googleusercontent.com. [34.90.227.64]) by smtp.gmail.com with ESMTPSA id a65-20020a509ec7000000b004fbf6b35a56sm6955177edf.76.2023.04.05.01.04.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Apr 2023 01:04:23 -0700 (PDT) Date: Wed, 5 Apr 2023 08:04:20 +0000 From: Quentin Perret To: David Dai Cc: Paolo Bonzini , Jonathan Corbet , Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose , Zenghui Yu , Catalin Marinas , Will Deacon , Mark Rutland , Lorenzo Pieralisi , Sudeep Holla , Saravana Kannan , kernel-team@android.com, kvm@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev Subject: Re: [RFC PATCH 2/6] kvm: arm64: Add support for get_cur_cpufreq service Message-ID: References: <20230330224348.1006691-1-davidai@google.com> <20230330224348.1006691-3-davidai@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230330224348.1006691-3-davidai@google.com> X-Spam-Status: No, score=-15.7 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,ENV_AND_HDR_SPF_MATCH, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL autolearn=unavailable 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 On Thursday 30 Mar 2023 at 15:43:37 (-0700), David Dai wrote: > This service allows guests to query the host for frequency of the CPU > that the vCPU is currently running on. I assume the intention here is to achieve scale invariance in the guest to ensure its PELT signals represent how much work is actually being done. If so, it's likely the usage of activity monitors will be superior for this type of thing as that may allow us to drop the baked-in assumption about vCPU pinning. IIRC, AMUs v2 (arm64-specific obv) have extended support for virtualization, so I'd suggest looking into supporting that first. And assuming we also want to support this on hardware that don't have AMUs, or don't have the right virt extensions, then the only thing I can think of is to have the VMM expose non-architectural AMUs to the guest, maybe emulated using PMUs. If the guest uses Linux, it'll need to grow support for non-architectural AMUs which is its own can of worms though. Thanks, Quentin