From: "Jan Beulich" Subject: Re: [PATCH RFC 3/4] xen: implement SCHEDOP_soft_reset Date: Mon, 08 Jun 2015 15:31:17 +0100 Message-ID: <5575C355020000780008233C@mail.emea.novell.com> References: <1433338522-8422-1-git-send-email-vkuznets@redhat.com> <1433338522-8422-4-git-send-email-vkuznets@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Z1y5D-0007GO-T7 for xen-devel@lists.xenproject.org; Mon, 08 Jun 2015 14:31:24 +0000 In-Reply-To: <1433338522-8422-4-git-send-email-vkuznets@redhat.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Vitaly Kuznetsov Cc: Olaf Hering , Wei Liu , Ian Campbell , Stefano Stabellini , Andrew Cooper , Julien Grall , Ian Jackson , Andrew Jones , Tim Deegan , David Vrabel , xen-devel@lists.xenproject.org, Daniel De Graaf , Keir Fraser List-Id: xen-devel@lists.xenproject.org >>> On 03.06.15 at 15:35, wrote: > --- a/xen/common/domain.c > +++ b/xen/common/domain.c > @@ -1116,12 +1116,12 @@ int map_vcpu_info(struct vcpu *v, unsigned long gfn, unsigned offset) > > /* > * Unmap the vcpu info page if the guest decided to place it somewhere > - * else. This is only used from arch_domain_destroy, so there's no > - * need to do anything clever. > + * else. > */ > void unmap_vcpu_info(struct vcpu *v) Please retain the full comment, extending it by the new caller's name. > @@ -1129,8 +1129,9 @@ void unmap_vcpu_info(struct vcpu *v) > mfn = v->vcpu_info_mfn; > unmap_domain_page_global((void *) > ((unsigned long)v->vcpu_info & PAGE_MASK)); > - > - v->vcpu_info = &dummy_vcpu_info; > + v->vcpu_info = ((v->vcpu_id < XEN_LEGACY_MAX_VCPUS) > + ? (vcpu_info_t *)&shared_info(d, vcpu_info[v->vcpu_id]) Is this cast really needed? > @@ -1446,6 +1447,34 @@ int continue_hypercall_on_cpu( > return 0; > } > > +int domain_soft_reset(struct domain *d) > +{ > + struct vcpu *v; > + int ret = 0; Pointless initializer. > + for_each_vcpu ( d, v ) > + { > + if ( v != current ) > + vcpu_pause(v); > + } > + > + evtchn_reset(d, 1); > + > + ret = grant_table_soft_reset(d); > + if ( ret ) > + goto vcpu_unpause; > + > + for_each_vcpu ( d, v ) > + unmap_vcpu_info(v); Indentation. Jan