From: "Jan Beulich" Subject: Re: [PATCH] x86/HVM: Avoid cache flush operations during hvm_load Date: Mon, 01 Jun 2015 17:02:06 +0100 Message-ID: <556C9E1E020000780007FDA9@mail.emea.novell.com> References: <1433172399-23599-1-git-send-email-ross.lagerwall@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1433172399-23599-1-git-send-email-ross.lagerwall@citrix.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: Ross Lagerwall Cc: Andrew Cooper , Keir Fraser , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org >>> On 01.06.15 at 17:26, wrote: > --- a/xen/common/hvm/save.c > +++ b/xen/common/hvm/save.c This being an x86-specific problem I would think this would better be addressed in x86-specific code. If it was to stay here, a proper arch hook should be introduced (even if ARM isn't using this code right now) and ... > @@ -230,13 +233,14 @@ int hvm_load(struct domain *d, hvm_domain_context_t *h) > printk(XENLOG_G_ERR > "HVM%d restore: save did not end with a null entry\n", > d->domain_id); > - return -1; > + ret = -1; > + goto out; > } > > /* Read the typecode of the next entry and check for the end-marker */ > desc = (struct hvm_save_descriptor *)(&h->data[h->cur]); > if ( desc->typecode == 0 ) > - return 0; > + goto out; > > /* Find the handler for this entry */ > if ( (desc->typecode > HVM_SAVE_CODE_MAX) || > @@ -244,7 +248,8 @@ int hvm_load(struct domain *d, hvm_domain_context_t *h) > { > printk(XENLOG_G_ERR "HVM%d restore: unknown entry typecode %u\n", > d->domain_id, desc->typecode); > - return -1; > + ret = -1; > + goto out; > } > > /* Load the entry */ > @@ -254,11 +259,17 @@ int hvm_load(struct domain *d, hvm_domain_context_t *h) > { > printk(XENLOG_G_ERR "HVM%d restore: failed to load entry %u/%u\n", > d->domain_id, desc->typecode, desc->instance); > - return -1; > + ret = -1; > + goto out; > } > } ... all of the goto-s should become break-s, ... > - /* Not reached */ > + ASSERT_UNREACHABLE(); > + > +out: ... eliminating the need for both of these. Jan