From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sergey Senozhatsky Date: Sat, 05 Jun 2021 00:58:10 +0000 Subject: Re: [RFC][PATCH] kvm: add suspend pm-notifier Message-Id: List-Id: References: <20210603164315.682994-1-senozhatsky@chromium.org> <87v96uyq2v.wl-maz@kernel.org> <87tumeymih.wl-maz@kernel.org> In-Reply-To: <87tumeymih.wl-maz@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Marc Zyngier Cc: Sergey Senozhatsky , Paolo Bonzini , Sean Christopherson , Vitaly Kuznetsov , Jim Mattson , Huacai Chen , Paul Mackerras , Christian Borntraeger , Suleiman Souhlal , x86@kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, kvm@vger.kernel.org, kvm-ppc@vger.kernel.org, linux-s390@vger.kernel.org On (21/06/04 11:03), Marc Zyngier wrote: [..] > > Well on the other hand PM-callbacks are harmless on those archs, they > > won't overload the __weak function. > > I don't care much for the callbacks. But struct kvm is bloated enough, > and I'd be happy not to have this structure embedded in it if I can > avoid it. Got it. > > > How about passing the state to the notifier callback? I'd expect it to > > > be useful to do something on resume too. > > > > For different states we can have different kvm_arch functions instead. > > kvm_arch_pm_notifier() can be renamed to kvm_arch_suspend_notifier(), > > so that we don't need to have `switch (state)` in every arch-code. Then > > for resume/post resume states we can have kvm_arch_resume_notifier() > > arch functions. > > I'd rather we keep an arch API that is similar to the one the rest of > the kernel has, instead of a flurry of small helpers that need to grow > each time someone adds a new PM state. A switch() in the arch-specific > implementation is absolutely fine. OK.