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. 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=-3.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no 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 26E15C47082 for ; Sat, 5 Jun 2021 08:46:35 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id 9CE1E61057 for ; Sat, 5 Jun 2021 08:46:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9CE1E61057 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.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 47ED449F5F; Sat, 5 Jun 2021 04:46:34 -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=@chromium.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 QVg4LJMnARKk; Sat, 5 Jun 2021 04:46:29 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 70B984A1B0; Sat, 5 Jun 2021 04:46:25 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 4951A40D0A for ; Fri, 4 Jun 2021 20:58:22 -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 vYEOJIZ9xW+n for ; Fri, 4 Jun 2021 20:58:18 -0400 (EDT) Received: from mail-pg1-f172.google.com (mail-pg1-f172.google.com [209.85.215.172]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id 1A0C749E5F for ; Fri, 4 Jun 2021 20:58:18 -0400 (EDT) Received: by mail-pg1-f172.google.com with SMTP id i5so9212191pgm.0 for ; Fri, 04 Jun 2021 17:58:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=osHu87SZoZXOMS0NS84nF9iOOHnrmeoNqfJAhUD9Nl8=; b=Pa2JkyxLSE1rRGXabDLfYGJX/e+p4npDVCtYeuxRukmJiFGdGIs7Vo8XKOzfnQzs/h pbb10ZmPwg85W0Dj/cd2W3ynNa33DRRMiaarmlMcQH7ryJSk8MkcmDQypI8DrMcWoYol 7goaClgk0qO6BplZ0Ao8y/pEzN0c96DZijxn0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=osHu87SZoZXOMS0NS84nF9iOOHnrmeoNqfJAhUD9Nl8=; b=gixMJoj/t2lIoGlsUmgzFQv/uyGo/MCqpH0U+kHX+hahQ+wL1B+5nwYJCoE9q5UXeY jNh8asmJb+/CcjBOYPK+jrQDsJf8XvdNtw8tRb/sGXz1zwJjvCY4hj9F0VNWtJtF4vss x9PoaQ+qQs8tcBSkhaIPQk9EIWLal18BKYyEYXTw0xOrLU2fEqvbOmBiXHayR7BOVNM4 nuumKy353BeQbRQzPKtx36NCz4MKz/W0jEsyhNZhc5OltyANbfR2PMgV4v7yQwrZ1Svt Ni+QUV9x5qevWjAh+BxKO9/3hNZE4Q9imxkuU76hHf1G1YVUSbpVkFRFJeQSZF9Roflf Hjig== X-Gm-Message-State: AOAM530GWJoqYcRiHfE6uVW7d8sUtDKeawemKm7lCxkSY+kME6+Z65qr g9qjQAHrUXI2V75JM2XsDrbZeg== X-Google-Smtp-Source: ABdhPJy+XB9KHA35L5KIcgyH8Y+GaTXYvt2kl0/zackCdS6suLdzG8cg7LKDJkfhiNoNuu0cLhDNPw== X-Received: by 2002:a63:4145:: with SMTP id o66mr7648691pga.4.1622854697107; Fri, 04 Jun 2021 17:58:17 -0700 (PDT) Received: from google.com ([2409:10:2e40:5100:5981:261e:350c:bb45]) by smtp.gmail.com with ESMTPSA id v11sm2662358pfm.143.2021.06.04.17.58.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Jun 2021 17:58:16 -0700 (PDT) Date: Sat, 5 Jun 2021 09:58:10 +0900 From: Sergey Senozhatsky To: Marc Zyngier Subject: Re: [RFC][PATCH] kvm: add suspend pm-notifier Message-ID: References: <20210603164315.682994-1-senozhatsky@chromium.org> <87v96uyq2v.wl-maz@kernel.org> <87tumeymih.wl-maz@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <87tumeymih.wl-maz@kernel.org> X-Mailman-Approved-At: Sat, 05 Jun 2021 04:46:23 -0400 Cc: linux-s390@vger.kernel.org, x86@kernel.org, kvm@vger.kernel.org, Christian Borntraeger , Sean Christopherson , Huacai Chen , linux-kernel@vger.kernel.org, kvm-ppc@vger.kernel.org, linux-mips@vger.kernel.org, Paul Mackerras , Sergey Senozhatsky , Suleiman Souhlal , 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 (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. _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm 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=-6.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 2A84DC4743C for ; Sat, 5 Jun 2021 00:59:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 08C62611AD for ; Sat, 5 Jun 2021 00:59:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230185AbhFEBBE (ORCPT ); Fri, 4 Jun 2021 21:01:04 -0400 Received: from mail-pf1-f178.google.com ([209.85.210.178]:37535 "EHLO mail-pf1-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230344AbhFEBBE (ORCPT ); Fri, 4 Jun 2021 21:01:04 -0400 Received: by mail-pf1-f178.google.com with SMTP id y15so8642051pfl.4 for ; Fri, 04 Jun 2021 17:59:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=osHu87SZoZXOMS0NS84nF9iOOHnrmeoNqfJAhUD9Nl8=; b=Pa2JkyxLSE1rRGXabDLfYGJX/e+p4npDVCtYeuxRukmJiFGdGIs7Vo8XKOzfnQzs/h pbb10ZmPwg85W0Dj/cd2W3ynNa33DRRMiaarmlMcQH7ryJSk8MkcmDQypI8DrMcWoYol 7goaClgk0qO6BplZ0Ao8y/pEzN0c96DZijxn0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=osHu87SZoZXOMS0NS84nF9iOOHnrmeoNqfJAhUD9Nl8=; b=n9zAJXpKBROURbNM0S2rBRkME7/40dzv45sIU0r/kZ3uunjMaQwmwuZLPcPvWHc64y N4QZRovi689CZF0uTvzqM7WNcKOZcfYi1nNqwYaEQidKSz37SPWBonsjfz06ZxBrkpDT aZr/2GIqhhsAzJ+FWtw4c2T0OVXaK1HmC0sg0vj7xoNG2J9Nk9ENRieYNTK4QsxXh+pC 680NoBSA9v75mEcDyjgpnNUURyzPQ+8vhzJGVRApKyXtYRsz3dUu3hh6m1D3aV/FDLuc 5kTGo76yLOToUIkfah4MesLpykWiMCPTMWniNo5l7Xqq+RRgkb65A2L+Wt5HeW/m5HLs cG3A== X-Gm-Message-State: AOAM533vNh5WKvKzS0hrvdzxMSG3PShG6mEAJ2+BvPfySeHSgqK8yQBw eIHFbRw50cBGn3D2GPuTkxLDIQ== X-Google-Smtp-Source: ABdhPJy+XB9KHA35L5KIcgyH8Y+GaTXYvt2kl0/zackCdS6suLdzG8cg7LKDJkfhiNoNuu0cLhDNPw== X-Received: by 2002:a63:4145:: with SMTP id o66mr7648691pga.4.1622854697107; Fri, 04 Jun 2021 17:58:17 -0700 (PDT) Received: from google.com ([2409:10:2e40:5100:5981:261e:350c:bb45]) by smtp.gmail.com with ESMTPSA id v11sm2662358pfm.143.2021.06.04.17.58.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Jun 2021 17:58:16 -0700 (PDT) Date: Sat, 5 Jun 2021 09:58:10 +0900 From: Sergey Senozhatsky 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 Subject: Re: [RFC][PATCH] kvm: add suspend pm-notifier Message-ID: References: <20210603164315.682994-1-senozhatsky@chromium.org> <87v96uyq2v.wl-maz@kernel.org> <87tumeymih.wl-maz@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87tumeymih.wl-maz@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-mips@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. 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=-4.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no 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 EDFD9C4743D for ; Sat, 5 Jun 2021 01:03:19 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id B54ED6120A for ; Sat, 5 Jun 2021 01:03:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B54ED6120A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=EnJn0LReXoFvjn4B4pjXtLJD4vrb5jewLxKIv9aQkJI=; b=UlW974Y9GXUHIB JRQDJsSF7qtGQGP7B6ewJ9o5Qd3Vs5xDoiHhuwusjcA/wlLjg2LAWX9ENmuKqYO8rdqUDMeKO352K UdiCFhl7W9nmFEzOmrzrao48khWWFU4EFgAXGEi1maEnY4V+L1zSnTzuEleYf8gaPac0UW0iswhzt dUx44It4NdzxUOD1ykXI23ul+P6lHO8LlMUPMVndtj2aEsYKnSBGG+zFg7KmMnbFi1dAzAIG4bSM1 xdpusXEbr1vk8aXvhaGCaM3lvnm/xHwCyWEZRiTAgLrWCopg1ESIee5VsPua1PVBiIwbol7WeP8LV ZVnXHIG4il8TM6BPuIag==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lpKes-00Fgrj-6l; Sat, 05 Jun 2021 00:59:26 +0000 Received: from mail-pg1-f178.google.com ([209.85.215.178]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lpKel-00FgrN-Dq for linux-arm-kernel@lists.infradead.org; Sat, 05 Jun 2021 00:59:23 +0000 Received: by mail-pg1-f178.google.com with SMTP id 6so9170537pgk.5 for ; Fri, 04 Jun 2021 17:59:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=osHu87SZoZXOMS0NS84nF9iOOHnrmeoNqfJAhUD9Nl8=; b=Pa2JkyxLSE1rRGXabDLfYGJX/e+p4npDVCtYeuxRukmJiFGdGIs7Vo8XKOzfnQzs/h pbb10ZmPwg85W0Dj/cd2W3ynNa33DRRMiaarmlMcQH7ryJSk8MkcmDQypI8DrMcWoYol 7goaClgk0qO6BplZ0Ao8y/pEzN0c96DZijxn0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=osHu87SZoZXOMS0NS84nF9iOOHnrmeoNqfJAhUD9Nl8=; b=EJmu1h+HPv6Kq4PO7IIfixQ6q6UQIUxr6YCg8jADf9T5O/ukH0omguSKWi5m8tDjhF B5RJm9EW2UPw0Hq1hyDPM7bxyo+TevxL+tgIo91JZQ1QpGcd9EX0W3hB3SSVSyFiPaqg 5rRc7QVTJUk9yGWIhuxNeyW3vKWpXAHWQSfJF10yQCB3OJABYWSPLb3ZP1kd+Y15wogj BeSTyEA28K+M3sowWooxlliIBmHopn9Uxk875w/tAq44M3944vBpdFZMvVQB/C/fhtVu JqanB4wKYnN79n8fT7DdnL//NYffjL+bzEhxuWJu9gsOLaX7a0zksBgl6KEUMvGhJoIF QjSw== X-Gm-Message-State: AOAM533ALCG0RFsAJoTzLGnjEU6e5j9VQ2eufDbsIeIhJLJCF1IH7e2O 9zQSsv9qbrDpp0nBHvGJjJ9m1Q== X-Google-Smtp-Source: ABdhPJy+XB9KHA35L5KIcgyH8Y+GaTXYvt2kl0/zackCdS6suLdzG8cg7LKDJkfhiNoNuu0cLhDNPw== X-Received: by 2002:a63:4145:: with SMTP id o66mr7648691pga.4.1622854697107; Fri, 04 Jun 2021 17:58:17 -0700 (PDT) Received: from google.com ([2409:10:2e40:5100:5981:261e:350c:bb45]) by smtp.gmail.com with ESMTPSA id v11sm2662358pfm.143.2021.06.04.17.58.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Jun 2021 17:58:16 -0700 (PDT) Date: Sat, 5 Jun 2021 09:58:10 +0900 From: Sergey Senozhatsky 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 Subject: Re: [RFC][PATCH] kvm: add suspend pm-notifier Message-ID: References: <20210603164315.682994-1-senozhatsky@chromium.org> <87v96uyq2v.wl-maz@kernel.org> <87tumeymih.wl-maz@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <87tumeymih.wl-maz@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210604_175919_482173_703BD1F7 X-CRM114-Status: GOOD ( 19.66 ) 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 (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. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel