> -----Original Message----- > From: Jan Beulich [mailto:jbeul...@suse.com] > Sent: 25 September 2017 17:00 > To: Paul Durrant <paul.durr...@citrix.com> > Cc: Andrew Cooper <andrew.coop...@citrix.com>; George Dunlap > <george.dun...@citrix.com>; Ian Jackson <ian.jack...@citrix.com>; > Stefano Stabellini <sstabell...@kernel.org>; xen-de...@lists.xenproject.org; > Konrad Rzeszutek Wilk <konrad.w...@oracle.com>; Tim (Xen.org) > <t...@xen.org> > Subject: Re: [PATCH v7 11/12] x86/hvm/ioreq: defer mapping gfns until they > are actually requsted > > >>> On 18.09.17 at 17:31, <paul.durr...@citrix.com> wrote: > > --- a/xen/arch/x86/hvm/ioreq.c > > +++ b/xen/arch/x86/hvm/ioreq.c > > @@ -354,6 +354,9 @@ static void hvm_update_ioreq_evtchn(struct > hvm_ioreq_server *s, > > } > > } > > > > +#define HANDLE_BUFIOREQ(s) \ > > + (s->bufioreq_handling != HVM_IOREQSRV_BUFIOREQ_OFF) > > (s) > > > @@ -762,11 +755,20 @@ int hvm_get_ioreq_server_info(struct domain > *d, ioservid_t id, > > if ( IS_DEFAULT(s) ) > > goto out; > > > > + if ( ioreq_gfn || bufioreq_gfn ) > > This conditional together with ... > > > + { > > + rc = hvm_ioreq_server_map_pages(s); > > + if ( rc ) > > + goto out; > > + } > > + > > *ioreq_gfn = gfn_x(s->ioreq.gfn); > > ... this unconditional dereference is suspicious.
True, it should be protected. > > > --- a/xen/include/asm-x86/hvm/domain.h > > +++ b/xen/include/asm-x86/hvm/domain.h > > @@ -68,8 +68,8 @@ struct hvm_ioreq_server { > > spinlock_t bufioreq_lock; > > evtchn_port_t bufioreq_evtchn; > > struct rangeset *range[NR_IO_RANGE_TYPES]; > > + int bufioreq_handling; > > Does this need to be plain int (i.e. signed and 32 bits wide)? No, I can shrink it. Paul > > Jan _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel