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 X-Spam-Level: X-Spam-Status: No, score=-13.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DE443C47082 for ; Thu, 3 Jun 2021 17:28:29 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id 4FCC06108E for ; Thu, 3 Jun 2021 17:28:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4FCC06108E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvmarm-bounces@lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id D38784B0C8; Thu, 3 Jun 2021 13:28:28 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Authentication-Results: mm01.cs.columbia.edu (amavisd-new); dkim=softfail (fail, message has been altered) header.i=@infradead.org Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GE7IuorYSAhk; Thu, 3 Jun 2021 13:28:27 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 7FB534B0CB; Thu, 3 Jun 2021 13:28:27 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 8DBE54B0C7 for ; Thu, 3 Jun 2021 13:28:25 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hwMaYcj29i8w for ; Thu, 3 Jun 2021 13:28:23 -0400 (EDT) Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id 9CCAE4B0C5 for ; Thu, 3 Jun 2021 13:28:23 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=C2x93GCoZiin4wmQCRttzlu4GmKci1Z97/29V5OUIBQ=; b=GRDRbyMv6qCSE0sh84jmHsdNkF Ca7KqDDXhE6PMeMjq9YlXaVzupQWhipW2IItm4ocsfSpw+d/efAwGK8FtYyzr6e9U2OdG0QNXnu1+ 4QMVh94o4r91Nb9pKuH/aEiHNN/RaaYLJk1EDj7snekcEw+wEoPAM7KtleMUX7IvQ0ursPrzg7ZF/ gXXzGmAwjg3XV30CvwWJ354CMua5g6UeT0oN8FI3A0frhhHpPWm8cujn3JtHZoyDZpU/SxKz+S99B vDFcvTD2d81achEPArKXYaS7aFfuHurRAPSgV0E+UgPbkBvDEdjoVzzfxyhE5YcHK539uoPArzXor gytVNA5Q==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1lor85-00COf2-Ei; Thu, 03 Jun 2021 17:27:46 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 63300300269; Thu, 3 Jun 2021 19:27:35 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 400C72BF86F79; Thu, 3 Jun 2021 19:27:35 +0200 (CEST) Date: Thu, 3 Jun 2021 19:27:35 +0200 From: Peter Zijlstra To: Sergey Senozhatsky Subject: Re: [RFC][PATCH] kvm: add suspend pm-notifier Message-ID: References: <20210603164315.682994-1-senozhatsky@chromium.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210603164315.682994-1-senozhatsky@chromium.org> Cc: Suleiman Souhlal , linux-s390@vger.kernel.org, x86@kernel.org, kvm@vger.kernel.org, Marc Zyngier , Huacai Chen , linux-kernel@vger.kernel.org, kvm-ppc@vger.kernel.org, linux-mips@vger.kernel.org, Paul Mackerras , Christian Borntraeger , Sean Christopherson , Paolo Bonzini , Vitaly Kuznetsov , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, Jim Mattson X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu On Fri, Jun 04, 2021 at 01:43:15AM +0900, Sergey Senozhatsky wrote: > Add KVM suspend/hibernate PM-notifier which lets architectures > to implement arch-specific VM suspend code. For instance, on x86 > this sets PVCLOCK_GUEST_STOPPED on all the VCPUs. > > Our case is that user puts the host system into sleep multiple > times a day (e.g. closes the laptop's lid) so we need a reliable > way to suspend VMs properly. > > Signed-off-by: Sergey Senozhatsky > --- > arch/arm64/kvm/arm.c | 4 ++++ > arch/mips/kvm/mips.c | 4 ++++ > arch/powerpc/kvm/powerpc.c | 4 ++++ > arch/s390/kvm/kvm-s390.c | 4 ++++ > arch/x86/kvm/x86.c | 21 ++++++++++++++++++++ > include/linux/kvm_host.h | 8 ++++++++ > virt/kvm/kvm_main.c | 40 ++++++++++++++++++++++++++++++++++++++ > 7 files changed, 85 insertions(+) > > diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c > index 1126eae27400..547dbe44d039 100644 > --- a/arch/arm64/kvm/arm.c > +++ b/arch/arm64/kvm/arm.c > @@ -1311,6 +1311,10 @@ static int kvm_vm_ioctl_set_device_addr(struct kvm *kvm, > } > } > > +void kvm_arch_pm_notifier(struct kvm *kvm) > +{ > +} > + > long kvm_arch_vm_ioctl(struct file *filp, > unsigned int ioctl, unsigned long arg) > { > diff --git a/arch/mips/kvm/mips.c b/arch/mips/kvm/mips.c > index 4d4af97dcc88..d4408acd2be6 100644 > --- a/arch/mips/kvm/mips.c > +++ b/arch/mips/kvm/mips.c > @@ -980,6 +980,10 @@ void kvm_arch_flush_remote_tlbs_memslot(struct kvm *kvm, > kvm_flush_remote_tlbs(kvm); > } > > +void kvm_arch_pm_notifier(struct kvm *kvm) > +{ > +} > + > long kvm_arch_vm_ioctl(struct file *filp, unsigned int ioctl, unsigned long arg) > { > long r; > diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c > index a2a68a958fa0..96e8a7b6fcf0 100644 > --- a/arch/powerpc/kvm/powerpc.c > +++ b/arch/powerpc/kvm/powerpc.c > @@ -2334,6 +2334,10 @@ static int kvmppc_get_cpu_char(struct kvm_ppc_cpu_char *cp) > } > #endif > > +void kvm_arch_pm_notifier(struct kvm *kvm) > +{ > +} > + > long kvm_arch_vm_ioctl(struct file *filp, > unsigned int ioctl, unsigned long arg) > { > diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c > index 1296fc10f80c..c5f86fc1e497 100644 > --- a/arch/s390/kvm/kvm-s390.c > +++ b/arch/s390/kvm/kvm-s390.c > @@ -2367,6 +2367,10 @@ static int kvm_s390_handle_pv(struct kvm *kvm, struct kvm_pv_cmd *cmd) > return r; > } > > +void kvm_arch_pm_notifier(struct kvm *kvm) > +{ > +} > + > long kvm_arch_vm_ioctl(struct file *filp, > unsigned int ioctl, unsigned long arg) > { What looks like you wants a __weak function. _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm