[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v7 3/7] x86: add xen_iommu_op to query reserved ranges
>>> On 15.10.18 at 12:35, <paul.durrant@xxxxxxxxxx> wrote: > +static int get_reserved(unsigned long s, unsigned long e, void *arg) > +{ > + struct get_reserved_ctxt *ctxt = arg; > + > + if ( ctxt->nr_entries < ctxt->max_entries ) > + { > + xen_iommu_reserved_range_t range = { > + .start_dfn = s, > + .nr_frames = e - s, Iirc rangeset ends are inclusive, so I think you need to add 1 here. > @@ -38,12 +97,20 @@ int do_one_iommu_op(xen_iommu_op_buf_t *buf) > const XEN_GUEST_HANDLE(xen_iommu_op_t) h = > guest_handle_cast(buf->h, xen_iommu_op_t); > xen_iommu_op_t op; > + size_t offset; > + static const size_t op_size[] = { > + [XEN_IOMMUOP_query_reserved] = > + sizeof(struct xen_iommu_op_query_reserved), Perhaps better (and shorter) sizeof(op.u.query_reserved)? > --- a/xen/include/public/iommu_op.h > +++ b/xen/include/public/iommu_op.h > @@ -25,11 +25,50 @@ > > #include "xen.h" > > +typedef uint64_t xen_dfn_t; > + > +/* Structure describing a single range reserved in the IOMMU */ > +struct xen_iommu_reserved_range { > + xen_dfn_t start_dfn; > + uint32_t nr_frames; > + uint32_t pad; > +}; > +typedef struct xen_iommu_reserved_range xen_iommu_reserved_range_t; > +DEFINE_XEN_GUEST_HANDLE(xen_iommu_reserved_range_t); > + > +/* > + * XEN_IOMMUOP_query_reserved: Query ranges reserved in the IOMMU. > + */ Single line comment? Jan _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |