From: "Jan Beulich" Subject: Re: [PATCH v2 1/1] evtchn: make EVTCHNOP_reset suitable for kexec Date: Wed, 30 Jul 2014 15:05:33 +0100 Message-ID: <53D917CD0200007800027B21@mail.emea.novell.com> References: <1406726810-2557-1-git-send-email-vkuznets@redhat.com> <1406726810-2557-2-git-send-email-vkuznets@redhat.com> <53D912470200007800027A90@mail.emea.novell.com><53D912470200007800027A90@mail.emea.novell.com> (Jan Beulich's message of "Wed, 30 Jul 2014 14:41:59 +0100") <87zjfrc5h1.fsf@vitty.brq.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XCUVc-00085q-39 for xen-devel@lists.xenproject.org; Wed, 30 Jul 2014 14:05:36 +0000 In-Reply-To: <87zjfrc5h1.fsf@vitty.brq.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: Andrew Jones , Ian Campbell , Andrew Cooper , David Vrabel , xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org >>> On 30.07.14 at 15:59, wrote: > "Jan Beulich" writes: > >>>>> On 30.07.14 at 15:26, wrote: >>> --- a/xen/common/event_channel.c >>> +++ b/xen/common/event_channel.c >>> @@ -957,6 +957,17 @@ static long evtchn_reset(evtchn_reset_t *r) >>> for ( i = 0; port_is_valid(d, i); i++ ) >>> (void)__evtchn_close(d, i); >>> >>> + if ( (d == current->domain) && d->evtchn_fifo ) >>> + { >>> + /* >>> + * Guest domain called EVTCHNOP_reset with DOMID_SELF, destroying >>> + * FIFO event array and control blocks, resetting evtchn_port_ops > to >>> + * evtchn_port_ops_2l. >>> + */ >> >> At the very least comment and code should match. In the case here I >> think you want to change the code: Replace "d == current->domain" >> with "dom == DOMID_SELF", leaving the unaltered behavior still >> available when a domain passes its own ID. > > Thanks, missed that case. Is there a reason why unaltered behavior is > better in that case? I understand it gives a choice but it would look > very unobvious... No, it's indeed solely for the caller to have a way to pick between both behaviors. Jan