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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A317CC54E58 for ; Mon, 18 Mar 2024 17:41:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Subject:Cc:To:From:Message-ID:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=A3qxoLOQWvqXc4huB2Ni4zBDs0x9V4yxv9x4W+JCMH4=; b=4c0ZOQTEVuR+Jx I44zYfqfgi2VovXGHxsJvW/Tr7ZaLbKBOIVO1mlVt7CkF/5UFHD7m7YeL2IlJfqTSoS6xf9buho8G egu7vU+3plRVBWBOPOmQTPLMPWQgdsonChYMIpjZOiKMJDWQTwOPg+7ggF0BLfMql2suu1nsnbSdd YIANqlWRYTWrMofO9duYYqu9QVjvrxBq2Xog8QNoKe1/FJAoqNu1OMIDDsJduIULzRZakhgEPAPpC S6hjAp7UK6/i7AszyI/xnmLb/yhlSYOI8m02WF2RWVuEukriBMDbMF7L3QYCaIlAIfzDt1jwByRGL jwhrb9Lfm46WcighTaiQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rmGzC-00000009V3k-3R1C; Mon, 18 Mar 2024 17:41:22 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rmGz7-00000009V1o-3Eld for linux-arm-kernel@lists.infradead.org; Mon, 18 Mar 2024 17:41:19 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 985D060B94; Mon, 18 Mar 2024 17:41:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 208E6C43390; Mon, 18 Mar 2024 17:41:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710783676; bh=E9X/vXcE+KfbqUnxxDsQCnC6isDz8nMc3x3A5fhOaPY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=NBp3bQEcp/MJFUxlDZZdTRT+zxsK1KhrVvtNTwiqett4hZDhYBEgYGIHpc6UHCEvS EkesHyPTiPyQPuHPBWc3avUjHOjXPt3NkwrF0DsetSTiEtkfzualAki1E+D3pBjcm8 eXdQUP8pYq03mJEPUXChGIOxc2mqGZQroTdoXoB933rxnvhuy6Sw4ne2cIJjdr1+1G 4Aq4xVgsM7VpfafU7r33mRbSswMvvvE27KRCQUQY9WPyk9SO9NyAeeCn8w94lHJ5yi ZRzmAq6ACJNrSOAJlD88wxRiVFOYzqLKEysA6vU9bbD+DKbNkSiUwyXvK+RVEZ4igi H7zgOUD6oUWNw== 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 1rmGz2-00DLD7-Q3; Mon, 18 Mar 2024 17:41:12 +0000 Date: Mon, 18 Mar 2024 17:41:12 +0000 Message-ID: <86ttl3zbd3.wl-maz@kernel.org> From: Marc Zyngier To: David Woodhouse Cc: linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, Paolo Bonzini , Jonathan Corbet , Oliver Upton , James Morse , Suzuki K Poulose , Zenghui Yu , Catalin Marinas , Will Deacon , Mark Rutland , Lorenzo Pieralisi , "Rafael J. Wysocki" , Len Brown , Pavel Machek , Mostafa Saleh , Jean-Philippe Brucker , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, kvmarm@lists.linux.dev, linux-pm@vger.kernel.org Subject: Re: [RFC PATCH v2 0/4] arm64: Add PSCI v1.3 SYSTEM_OFF2 support for hibernation In-Reply-To: References: <20240318164646.1010092-1-dwmw2@infradead.org> <86wmpzzdep.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) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: dwmw2@infradead.org, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, pbonzini@redhat.com, corbet@lwn.net, oliver.upton@linux.dev, james.morse@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, catalin.marinas@arm.com, will@kernel.org, mark.rutland@arm.com, lpieralisi@kernel.org, rafael@kernel.org, len.brown@intel.com, pavel@ucw.cz, smostafa@google.com, jean-philippe@linaro.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, kvmarm@lists.linux.dev, linux-pm@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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240318_104118_204312_0EF096C2 X-CRM114-Status: GOOD ( 28.97 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, 18 Mar 2024 17:26:07 +0000, David Woodhouse wrote: > > [1 ] > On Mon, 2024-03-18 at 16:57 +0000, Marc Zyngier wrote: > > > > > > > > There *is* a way for a VMM to opt *out* of newer PSCI versions... by > > > setting a per-vCPU "special" register that actually ends up setting the > > > PSCI version KVM-wide. Quite why this isn't just a simple KVM_CAP, I > > > have no idea. > > > > Because the expectations are that the VMM can blindly save/restore the > > guest's state, including the PSCI version, and restore that blindly. > > KVM CAPs are just a really bad design pattern for this sort of things. > > Hm, am I missing something here? Does the *guest* get to set the PSCI > version somehow, and opt into the latest version that it understands > regardless of what the firmware/host can support? No. The *VMM* sets the PSCI version by writing to a pseudo register. It means that when the guest migrates, the VMM saves and restores that version, and the guest doesn't see any change. The host firmware has nothing to do with it, obviously. This is all about KVM's own implementation of the "firmware", as seen by the guest. > Because if not, surely it's just part of the basic shape of the > machine, like "how many vCPUs does it have". You don't need to be able > to query it back again. Nobody needs to do this. > I don't think we ever aspired to be able to hand an arbitrary KVM fd to > a userspace VMM and have the VMM be able to drive that VM without > having any a priori context, did we? Arbitrary? No. This is actually very specific and pretty well documented. Also, to answer your question about why we treat 0.1 differently from 0.2+: 0.1 didn't specify the PSCI SMC/HCR encoding, meaning that KVM implemented something that was never fully specified. The VMM has to provide firmware tables that describe that. With 0.2+, there is a standard encoding for all functions, and the VMM doesn't have to provide the encoding to the guest. M. -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel