From: "Jan Beulich" Subject: Re: [PATCH v5 3/9] ioreq-server: centralize access to ioreq structures Date: Tue, 06 May 2014 13:35:15 +0100 Message-ID: <5368F323020000780000F598@mail.emea.novell.com> References: <1398946120-33169-1-git-send-email-paul.durrant@citrix.com> <1398946120-33169-4-git-send-email-paul.durrant@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1398946120-33169-4-git-send-email-paul.durrant@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: Paul Durrant Cc: Keir Fraser , Kevin Tian , EddieDong , Jun Nakajima , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org >>> On 01.05.14 at 14:08, wrote: > To simplify creation of the ioreq server abstraction in a subsequent patch, > this patch centralizes all use of the shared ioreq structure and the > buffered ioreq ring to the source module xen/arch/x86/hvm/hvm.c. > > The patch moves an rmb() from inside hvm_io_assist() to hvm_do_resume() > because the former may now be passed a data structure on stack, in which > case the barrier is unnecessary. > > Signed-off-by: Paul Durrant Acked-by: Jan Beulich with these minor comments: > --- a/xen/arch/x86/hvm/hvm.c > +++ b/xen/arch/x86/hvm/hvm.c > @@ -363,6 +363,26 @@ void hvm_migrate_pirqs(struct vcpu *v) > spin_unlock(&d->event_lock); > } > > +static ioreq_t *get_ioreq(struct vcpu *v) const struct vcpu *? Or was it that this conflicts with a subsequent patch? > +{ > + struct domain *d = v->domain; > + shared_iopage_t *p = d->arch.hvm_domain.ioreq.va; > + > + ASSERT((v == current) || spin_is_locked(&d->arch.hvm_domain.ioreq.lock)); > + > + return p ? &p->vcpu_ioreq[v->vcpu_id] : NULL; > +} > + > +bool_t hvm_io_pending(struct vcpu *v) > +{ > + ioreq_t *p = get_ioreq(v); It would be particularly desirable since this one would logically want its parameter to be const-qualified. > +bool_t hvm_has_dm(struct domain *d) > +{ > + return !!d->arch.hvm_domain.ioreq.va; > +} Pretty certainly const here. Jan