> -----Original Message----- > From: Julien Grall <jul...@xen.org> > Sent: 16 October 2020 16:55 > To: Paul Durrant <p...@xen.org>; xen-devel@lists.xenproject.org > Cc: Paul Durrant <pdurr...@amazon.com>; Ian Jackson <i...@xenproject.org>; > Wei Liu <w...@xen.org>; Andrew > Cooper <andrew.coop...@citrix.com>; George Dunlap <george.dun...@citrix.com>; > Jan Beulich > <jbeul...@suse.com>; Stefano Stabellini <sstabell...@kernel.org>; Anthony > PERARD > <anthony.per...@citrix.com>; Volodymyr Babchuk <volodymyr_babc...@epam.com>; > Roger Pau Monné > <roger....@citrix.com> > Subject: Re: [PATCH 3/5] libxl / iommu / domctl: introduce > XEN_DOMCTL_IOMMU_SET_ALLOCATION... > > Hi Paul, > > On 05/10/2020 10:49, Paul Durrant wrote: > > From: Paul Durrant <pdurr...@amazon.com> > > > > ... sub-operation of XEN_DOMCTL_iommu_ctl. > > > > This patch adds a new sub-operation into the domctl. The code in iommu_ctl() > > is extended to call a new arch-specific iommu_set_allocation() function > > which > > will be called with the IOMMU page-table overhead (in 4k pages) in response > > Why 4KB? Wouldn't it be better to use the hypervisor page size instead? >
I think I'll follow the shadow/hap code more closely and just pass a value in MB, then any issue with page size is left inside Xen. > > diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h > > index 75e855625a..6402678838 100644 > > --- a/xen/include/public/domctl.h > > +++ b/xen/include/public/domctl.h > > @@ -1138,8 +1138,16 @@ struct xen_domctl_vuart_op { > > > > #define XEN_DOMCTL_IOMMU_INVALID 0 > > > > +#define XEN_DOMCTL_IOMMU_SET_ALLOCATION 1 > > +struct xen_domctl_iommu_set_allocation { > > + uint32_t nr_pages; > > Shouldn't this be a 64-bit value? If I pass the value in MB then 32-bits will cover it, I think. I do need to add padding though. Paul > > Cheers, > > -- > Julien Grall