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 lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 B9984C352A1 for ; Tue, 6 Dec 2022 20:37:06 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.455529.713012 (Exim 4.92) (envelope-from ) id 1p2egS-0003Zr-L8; Tue, 06 Dec 2022 20:36:56 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 455529.713012; Tue, 06 Dec 2022 20:36:56 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1p2egS-0003Zk-IT; Tue, 06 Dec 2022 20:36:56 +0000 Received: by outflank-mailman (input) for mailman id 455529; Tue, 06 Dec 2022 20:36:55 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1p2egR-0003Ze-8Z for xen-devel@lists.xenproject.org; Tue, 06 Dec 2022 20:36:55 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1p2egO-0001fG-MK; Tue, 06 Dec 2022 20:36:52 +0000 Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.102]) by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1p2egO-0000XG-Hd; Tue, 06 Dec 2022 20:36:52 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org; s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID; bh=TQeE9We7ZtVdlcZH6cDKAsIse3P0yNznHDK8hktbePU=; b=6nZ3ECd2y24wEBVWTS4X6c6kE4 g7fhDsnvSGsl/lggqe0Q38JdKw9OUE0wGgoM92lsGu7y0GESPSqrp4yo0wQCw/iJcJdCXOlLDi1/h JV0lqHIOyR2/9loRcjlVG55TPqjHSCt7fMouLvO/BD79uEbLdHYwLWI6TXUzCsQyPAHY=; Message-ID: <86b15c22-de90-fbbe-43ce-4f500b3ba5af@xen.org> Date: Tue, 6 Dec 2022 20:36:50 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Subject: Re: [PATCH 05/19] xen/x86: Move freeze/thaw_domains into common files To: Mykyta Poturai , "xen-devel@lists.xenproject.org" Cc: Mirela Simonovic , Andrew Cooper , George Dunlap , Ian Jackson , Jan Beulich , Stefano Stabellini , Wei Liu , Saeed Nowshadi References: <931418d761e47eee7847e6bd559e02597cbab1b6.1665137247.git.mykyta_poturai@epam.com> From: Julien Grall In-Reply-To: <931418d761e47eee7847e6bd559e02597cbab1b6.1665137247.git.mykyta_poturai@epam.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi, On 07/10/2022 11:32, Mykyta Poturai wrote: > From: Mirela Simonovic > > These functions will be reused by suspend/resume support for ARM. > > Signed-off-by: Mirela Simonovic > Signed-off-by: Saeed Nowshadi Your Signed-off-by is missing. > --- > xen/common/domain.c | 29 +++++++++++++++++++++++++++++ The title suggests that there will be code movement. However... I only see addition here. Did you intend to remove the functions from arch/x86/acpi/power.c? > xen/include/xen/sched.h | 3 +++ > 2 files changed, 32 insertions(+) > > diff --git a/xen/common/domain.c b/xen/common/domain.c > index 56d47dd664..5e5894c468 100644 > --- a/xen/common/domain.c > +++ b/xen/common/domain.c > @@ -1884,6 +1884,35 @@ int continue_hypercall_on_cpu( > return 0; > } > > + > +void freeze_domains(void) > +{ > + struct domain *d; > + > + rcu_read_lock(&domlist_read_lock); > + /* > + * Note that we iterate in order of domain-id. Hence we will pause dom0 > + * first which is required for correctness (as only dom0 can add domains to > + * the domain list). Otherwise we could miss concurrently-created domains. > + */ > + for_each_domain ( d ) > + domain_pause(d); > + rcu_read_unlock(&domlist_read_lock); > +} > + > +void thaw_domains(void) > +{ > + struct domain *d; > + > + rcu_read_lock(&domlist_read_lock); > + for_each_domain ( d ) > + { > + restore_vcpu_affinity(d); > + domain_unpause(d); > + } > + rcu_read_unlock(&domlist_read_lock); > +} > + > /* > * Local variables: > * mode: C > diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h > index 00a939aa01..c8ddfdd51c 100644 > --- a/xen/include/xen/sched.h > +++ b/xen/include/xen/sched.h > @@ -978,6 +978,9 @@ static inline struct vcpu *domain_vcpu(const struct domain *d, > return vcpu_id >= d->max_vcpus ? NULL : d->vcpu[idx]; > } > > +void freeze_domains(void); > +void thaw_domains(void); > + > void cpu_init(void); > > /* Cheers, -- Julien Grall