Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp2783723rdd; Sat, 13 Jan 2024 01:37:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IEbl+DIGG0V7erk/P9Cv29n2o6wory27TCDkHLui19LJhPDWMUKvcnSYQ+wvFutHFRm4DhU X-Received: by 2002:a05:620a:41:b0:783:260a:8b4d with SMTP id t1-20020a05620a004100b00783260a8b4dmr3230072qkt.139.1705138666369; Sat, 13 Jan 2024 01:37:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705138666; cv=none; d=google.com; s=arc-20160816; b=u3/AE7nUmvqpHcfSZxTEa7IdjqMmGlfjUa5fj8et6LnGZx6A9oXI6om90kWQ1VBItB 81yevpV1eV+7UU3F8iQDgqdrmyLPRf/vAzV0unS/veXFMfV/5miCUNA5xEH9MFU+6uik 0pmxB5KKAr3c6TODEoXPdTcMjBOm0wWY86k0clD/p6uQgV7BtsFVpIN1iwofOXdABD2K diJGN/fVaX/kjJSOxDYO22RLCrBe27zQue+9l+8+tK0dq/VkXlaHVdrUlLOFe6y4vfju umOTsxXAAoZjby1b6VoPLwKs5FOLkzF3kwau5BRRb7LILLG/d9owlhSA0CITNVR8LD71 sRIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date:dkim-signature; bh=pQrZCLoMSISUYgmuvodWIWW+sd5nY/a6/CqA0PFkl1o=; fh=TbQYqMfTQZGhFhw9aW4TaHLSUSusKGq1ns2xDVq5b34=; b=Ky2ISAT0magfpWP7NXCFrv6hgw/6vWSPXRCm4AxEvRrbf4cL0nLzUlZavH2p+rwwlG /cHZWLXOjbfWDAO/HgomswfVRCWSB42roY+a3vHdfFmeBAl5E+d5ZZCkJSp8KQyCPOKh A6hhYmdazGl7f+XlGCrnr6IV2hh9UMGioG05uUWPryI7iw+9BEAeLAVEpa34mqdn9xmI h0Erbz9SNo8jLUoX0GMWhsakzvMJIcJ1mKQ6Yzz3QdCscDe/HpYmVX/3uNW1RlFYhIpI cfO7H1AqyXq0TKHUnogD0WoV2eZXjxZbX8QHyP3LDqcXHoRa6uCKyT2S6azNKNVvDv1k BoQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GDzN14Pi; spf=pass (google.com: domain of linux-kernel+bounces-25239-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-25239-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id x15-20020a05620a258f00b00783360f0d46si4801195qko.302.2024.01.13.01.37.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Jan 2024 01:37:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-25239-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GDzN14Pi; spf=pass (google.com: domain of linux-kernel+bounces-25239-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-25239-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 100691C21231 for ; Sat, 13 Jan 2024 09:37:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AA6301846; Sat, 13 Jan 2024 09:37:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="GDzN14Pi" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B695DA2A; Sat, 13 Jan 2024 09:37:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 28057C433C7; Sat, 13 Jan 2024 09:37:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705138656; bh=w/zSBBUrOCogh8TXa7vV7+1viFBuWmgXZKnDrd+wg/4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=GDzN14Pi0f4Pnq/RXyJZlmAXb+3jQHnB1NEEcUgJRyc5RkgaIN2MEh1c664bOhaoF Q4c/L96XzgDV//riRy4W8fbXJ9fouhbrHQ4Z9RWNidU/t+EwYXSlIveNgaQo9ct8Tb sZkGT0PgXZH2kAog8sFRSSlK8lr/EDywrl+BD9TCuX8XdBjSW4Etv0Oahnbkxr6gQK DNiS3LlLvQr6zvg4KBKL5bXqhiblv3zBY05QgINrxYlR4ehLhxWk8iZdV/QmCS2PlU hd32/uCQIhxGcNC5FrGNOiEo3i1VXkNHis3AsJ6+uwmKO6dZcD1za70LP39r7pkQWy wa/Lh3v3mrMMQ== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1rOaSL-00BMls-Kk; Sat, 13 Jan 2024 09:37:33 +0000 Date: Sat, 13 Jan 2024 09:37:33 +0000 Message-ID: <86zfx98tgi.wl-maz@kernel.org> From: Marc Zyngier To: Saravana Kannan Cc: David Dai , "Rafael J. Wysocki" , Viresh Kumar , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Sudeep Holla , Quentin Perret , Masami Hiramatsu , Will Deacon , Peter Zijlstra , Vincent Guittot , Oliver Upton , Dietmar Eggemann , Pavan Kondeti , Gupta Pankaj , Mel Gorman , kernel-team@android.com, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 1/2] dt-bindings: cpufreq: add virtual cpufreq device In-Reply-To: References: <20231111014933.1934562-1-davidai@google.com> <20231111014933.1934562-2-davidai@google.com> <865y231jvj.wl-maz@kernel.org> <867clpaxel.wl-maz@kernel.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/29.1 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: saravanak@google.com, davidai@google.com, rafael@kernel.org, viresh.kumar@linaro.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, sudeep.holla@arm.com, qperret@google.com, mhiramat@google.com, will@kernel.org, peterz@infradead.org, vincent.guittot@linaro.org, oliver.upton@linux.dev, dietmar.eggemann@arm.com, quic_pkondeti@quicinc.com, pankaj.gupta@amd.com, mgorman@suse.de, kernel-team@android.com, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false On Fri, 12 Jan 2024 22:02:39 +0000, Saravana Kannan wrote: >=20 > Sorry for the delay in response. Was very busy for a while and then > holidays started. >=20 > On Fri, Dec 8, 2023 at 12:52=E2=80=AFAM Marc Zyngier wro= te: > > > > On Thu, 07 Dec 2023 22:44:36 +0000, > > Saravana Kannan wrote: > > > > > > On Wed, Nov 15, 2023 at 12:49=E2=80=AFAM Marc Zyngier wrote: > > > > > > > > On Sat, 11 Nov 2023 01:49:29 +0000, > > > > David Dai wrote: > > > > > > > > > > Adding bindings to represent a virtual cpufreq device. > > > > > > > > > > Virtual machines may expose MMIO regions for a virtual cpufreq de= vice > > > > > for guests to read frequency information or to request frequency > > > > > selection. The virtual cpufreq device has an individual controlle= r for > > > > > each frequency domain. > > > > > > > > I would really refrain form having absolute frequencies here. A > > > > virtual machine can be migrated, and there are *zero* guarantees th= at > > > > the target system has the same clock range as the source. > > > > > > > > This really should be a relative number, much like the capacity. Th= at, > > > > at least, can be migrated across systems. > > > > > > There's nothing in this patch that mandates absolute frequency. > > > In true KVM philosophy, we leave it to the VMM to decide. > > > > This has nothing to do with KVM. It would apply to any execution > > environment, including QEMU in TCG mode. > > > > To quote the original patch: > > > > + description: > > + Address and size of region containing frequency controls for eac= h of the > > + frequency domains. Regions for each frequency domain is placed > > + contiugously and contain registers for controlling DVFS(Dynamic = Frequency > > + and Voltage) characteristics. The size of the region is proporti= onal to > > + total number of frequency domains. > > > > What part of that indicates that *relative* frequencies are > > acceptable? The example explicitly uses the opp-v2 binding, which > > clearly is about absolute frequency. >=20 > We can update the doc to make that clearer and update the example too. >=20 > > To reiterate: absolute frequencies are not the right tool for the job, > > and they should explicitly be described as relative in the spec. Not > > left as a "whatev'" option for the execution environment to interpret. >=20 > I think it depends on the use case. If there's no plan to migrate the > VM across different devices, there's no need to do the unnecessary > normalization back and forth. VM migration is a given, specially when QEMU is involved. Designing something that doesn't support it is a bug, plain and simple. > And if we can translate between pCPU frequency and a normalized > frequency, we can do the same for whatever made up frequencies too. In > fact, we plan to do exactly that in our internal use cases for this. > There's nothing here that prevents the VMM from doing that. > > Also, if there are hardware virtualized performance counters (AMU, > CPPC, etc) that are used for frequency normalization, then we have to > use the real frequencies in those devices otherwise the "current > frequency" can be 2 GHz while the max normalized frequency is 1024 > KHz. That'll mess up load tracking. And that's exactly why this shouldn't be a *frequency*, but a performance scale or some other unit-less coefficient. Just like the big-little capacity. M. --=20 Without deviation from the norm, progress is not possible.