From: "Jan Beulich" Subject: Re: [PATCH v8 1/3] ioreq-server: add support for multiple servers Date: Tue, 20 May 2014 16:28:25 +0100 Message-ID: <537B90B90200007800014370@mail.emea.novell.com> References: <1400507268-5536-1-git-send-email-paul.durrant@citrix.com> <1400507268-5536-2-git-send-email-paul.durrant@citrix.com> <537B88D602000078000142FB@mail.emea.novell.com> <9AAE0902D5BC7E449B7C8E4E778ABCD037E90A@AMSPEX01CL01.citrite.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <9AAE0902D5BC7E449B7C8E4E778ABCD037E90A@AMSPEX01CL01.citrite.net> 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: Ian Jackson , Stefano Stabellini , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org >>> On 20.05.14 at 17:06, wrote: >> -----Original Message----- >> From: Jan Beulich [mailto:JBeulich@suse.com] >> Sent: 20 May 2014 15:55 >> To: Paul Durrant >> Cc: Ian Jackson; Stefano Stabellini; xen-devel@lists.xen.org >> Subject: Re: [PATCH v8 1/3] ioreq-server: add support for multiple servers >> >> >>> On 19.05.14 at 15:47, wrote: >> > +static int hvm_access_cf8( >> > + int dir, uint32_t port, uint32_t bytes, uint32_t *val) >> > +{ >> > + struct domain *d = current->domain; >> > + >> > + if ( dir == IOREQ_WRITE && >> > + bytes == 4 ) >> >> Don't you also need to check port == 0xcf8 here? >> > > I don't think I do because (for AFAICT port IO at least) Xen should ensure > the only possible 4 byte write that can come in here has to be to cf8. Any > access to cf9, cfa, or cfb would have to be less than 4 bytes long. Ah, indeed (and the same for MMIO). In that case if you could make the if() a single line... >> > +static ioservid_t next_ioservid(struct domain *d) >> > +{ >> > + struct hvm_ioreq_server *s; >> > + ioservid_t id; >> > + >> > + ASSERT(spin_is_locked(&d->arch.hvm_domain.ioreq_server.lock)); >> > + >> > + id = d->arch.hvm_domain.ioreq_server.id; >> > + >> > + again: >> > + id++; >> > + >> > + /* Check for uniqueness */ >> > + list_for_each_entry ( s, >> > + &d->arch.hvm_domain.ioreq_server.list, >> > + list_entry ) >> > + { >> > + if (id == s->id) >> >> The beloved coding style remark again. >> > > Unnecessary braces? Ok. No - the braces are a matter of taste. There are missing blanks inside the parentheses. Jan