> -----Original Message-----
> From: Roger Pau Monne
> Sent: 18 September 2017 17:18
> To: Paul Durrant <paul.durr...@citrix.com>
> Cc: xen-de...@lists.xenproject.org; Stefano Stabellini
> <sstabell...@kernel.org>; Andrew Cooper <andrew.coop...@citrix.com>;
> Ian Jackson <ian.jack...@citrix.com>; Tim (Xen.org) <t...@xen.org>; Jan
> Beulich <jbeul...@suse.com>
> Subject: Re: [Xen-devel] [PATCH v7 12/12] x86/hvm/ioreq: add a new
> mappable resource type...
> 
> On Mon, Sep 18, 2017 at 04:31:26PM +0100, Paul Durrant wrote:
> > ... XENMEM_resource_ioreq_server
> >
> > This patch adds support for a new resource type that can be mapped using
> > the XENMEM_acquire_resource memory op.
> >
> > If an emulator makes use of this resource type then, instead of mapping
> > gfns, the IOREQ server will allocate pages from the heap. These pages
> > will never be present in the P2M of the guest at any point and so are
> > not vulnerable to any direct attack by the guest. They are only ever
> > accessible by Xen and any domain that has mapping privilege over the
> > guest (which may or may not be limited to the domain running the
> emulator).
> >
> > NOTE: Use of the new resource type is not compatible with use of
> >       XEN_DMOP_get_ioreq_server_info unless the XEN_DMOP_no_gfns
> flag is
> >       set.
> >
> > Signed-off-by: Paul Durrant <paul.durr...@citrix.com>
> > Acked-by: George Dunlap <george.dun...@eu.citrix.com>
> > Reviewed-by: Wei Liu <wei.l...@citrix.com>
> 
> Reviewed-by: Roger Pau Monné <roger....@citrix.com>
> 
> Just one nit below.
> 
> > --- a/xen/arch/x86/hvm/ioreq.c
> > +++ b/xen/arch/x86/hvm/ioreq.c
> > +mfn_t hvm_get_ioreq_server_frame(struct domain *d, ioservid_t id,
> > +                                 unsigned int idx)
> > +{
> > +    struct hvm_ioreq_server *s;
> > +    mfn_t mfn = INVALID_MFN;
> > +
> > +    spin_lock_recursive(&d->arch.hvm_domain.ioreq_server.lock);
> > +
> > +    s = get_ioreq_server(d, id);
> > +
> > +    if ( id >= MAX_NR_IOREQ_SERVERS || !s || IS_DEFAULT(s) )
> 
> If you use get_ioreq_server the id >= MAX_NR_IOREQ_SERVERS check is
> pointless, get_ioreq_server will already return NULL in that case.

True. Possibly not worth a v8 in itself, but if there are any more changes 
needed I'll fix it up.

Thanks,

  Paul

> 
> Thanks, Roger.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

Reply via email to