From: Oliver Upton <oliver.upton@linux.dev>
To: David Woodhouse <dwmw2@infradead.org>
Cc: linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org,
Paolo Bonzini <pbonzini@redhat.com>,
Jonathan Corbet <corbet@lwn.net>, Marc Zyngier <maz@kernel.org>,
James Morse <james.morse@arm.com>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Zenghui Yu <yuzenghui@huawei.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Lorenzo Pieralisi <lpieralisi@kernel.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Len Brown <len.brown@intel.com>, Pavel Machek <pavel@ucw.cz>,
Mostafa Saleh <smostafa@google.com>,
Jean-Philippe Brucker <jean-philippe@linaro.org>,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
kvmarm@lists.linux.dev, linux-pm@vger.kernel.org
Subject: Re: [RFC PATCH 1/2] KVM: arm64: Add PSCI SYSTEM_OFF2 function for hibernation
Date: Wed, 13 Mar 2024 12:42:39 -0700 [thread overview]
Message-ID: <ZfIBr25V0ulNGUHN@thinky-boi> (raw)
In-Reply-To: <d140bb65f02d2b0e33d176beef400d9e22bebafa.camel@infradead.org>
On Wed, Mar 13, 2024 at 12:53:45PM +0000, David Woodhouse wrote:
> On Tue, 2024-03-12 at 08:47 -0700, Oliver Upton wrote:
> > Hi,
> >
> > On Tue, Mar 12, 2024 at 01:51:28PM +0000, David Woodhouse wrote:
> > > From: David Woodhouse <dwmw@amazon.co.uk>
> > >
> > > The PSCI v1.3 specification (alpha) adds support for a SYSTEM_OFF2 function
> > > which is analogous to ACPI S4 state. This will allow hosting environments
> > > to determine that a guest is hibernated rather than just powered off, and
> > > ensure that they preserve the virtual environment appropriately to allow
> > > the guest to resume safely (or bump the hardware_signature in the FACS to
> > > trigger a clean reboot instead).
> > >
> > > The beta version will be changed to say that PSCI_FEATURES returns a bit
> > > mask of the supported hibernate types, which is implemented here.
> >
> > Have you considered doing the PSCI implementation in userspace? The
> > SMCCC filter [*] was added for this exact purpose.
> >
>
> For the purpose of deprecating the in-KVM PSCI implementation and
> reimplementing it in VMMs? So we're never going to add new features and
> versions to the kernel PSCI?
I'm not against the idea of adding features to the in-kernel PSCI
implementation when it has a clear reason to live in the kernel. For
this hypercall in particular the actual implementation lives in
userspace, the KVM code is just boilerplate for migration / UAPI
compatibility.
> If that's the case then I suppose I can send the patch to clearly
> document the in-KVM PSCI as deprecated, and do it that way.
There probably isn't an awful lot to be gained from documenting the UAPI
as deprecated, we will never actually get to delete it.
> But to answer your question directly, no I hadn't considered that. I
> was just following the existing precedent of adding new optional PSCI
> features like SYSTEM_RESET2.
Understandable. And the infrastructure I'm recommending didn't exist
around the time of THE SYSTEM_RESET2 addition.
> I didn't think that the addition of SYSTEM_OFF2 in precisely the same
> fashion would be the straw that broke the camel's back, and pushed us
> to reimplement it in userspace instead.
I do not believe using the SMCCC filter to take SYSTEM_OFF2 to userspace
would necessitate a _full_ userspace reimplementation. You're free to
leave the default handler in place for functions you don't care about.
Forwarding PSCI_VERSION, PSCI_FEATURES, and SYSTEM_OFF2 would be sufficient
to get this off the ground, and the VMM can still advertise the rest of
the hypercalls implemented by KVM.
That might get you where you want to go a bit faster, since it'd avoid
any concerns about implementing a draft ABI in the kernel.
--
Thanks,
Oliver
next prev parent reply other threads:[~2024-03-13 19:42 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-12 13:51 [RFC PATCH 0/2] Add PSCI v1.3 SYSTEM_OFF2 support for hibernation David Woodhouse
2024-03-12 13:51 ` [RFC PATCH 1/2] KVM: arm64: Add PSCI SYSTEM_OFF2 function " David Woodhouse
2024-03-12 15:36 ` Marc Zyngier
2024-03-12 17:06 ` David Woodhouse
2024-03-12 15:47 ` Oliver Upton
2024-03-13 12:53 ` David Woodhouse
2024-03-13 19:42 ` Oliver Upton [this message]
2024-03-13 23:01 ` David Woodhouse
2024-03-12 13:51 ` [RFC PATCH 2/2] arm64: Use SYSTEM_OFF2 PSCI call to power off for hibernate David Woodhouse
2024-03-12 15:57 ` Sudeep Holla
2024-03-12 16:36 ` David Woodhouse
2024-03-13 15:34 ` Sudeep Holla
2024-03-14 11:09 ` Sudeep Holla
2024-03-14 11:27 ` David Woodhouse
2024-03-12 15:24 ` [RFC PATCH 0/2] Add PSCI v1.3 SYSTEM_OFF2 support for hibernation Marc Zyngier
2024-03-12 17:01 ` David Woodhouse
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZfIBr25V0ulNGUHN@thinky-boi \
--to=oliver.upton@linux.dev \
--cc=catalin.marinas@arm.com \
--cc=corbet@lwn.net \
--cc=dwmw2@infradead.org \
--cc=james.morse@arm.com \
--cc=jean-philippe@linaro.org \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.linux.dev \
--cc=len.brown@intel.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=mark.rutland@arm.com \
--cc=maz@kernel.org \
--cc=pavel@ucw.cz \
--cc=pbonzini@redhat.com \
--cc=rafael@kernel.org \
--cc=smostafa@google.com \
--cc=suzuki.poulose@arm.com \
--cc=will@kernel.org \
--cc=yuzenghui@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).