Hello Alexey,

On Tue, 2021-03-23 at 18:41 +1100, Alexey Kardashevskiy wrote:
[...]
> > +#define IOMMU_PAGE_SHIFT_16G       34
> > +#define IOMMU_PAGE_SHIFT_256M      28
> > +#define IOMMU_PAGE_SHIFT_128M      27
> > +#define IOMMU_PAGE_SHIFT_64M       26
> > +#define IOMMU_PAGE_SHIFT_32M       25
> > +#define IOMMU_PAGE_SHIFT_16M       24
> > +#define IOMMU_PAGE_SHIFT_64K       16
> 
> 
> These are not very descriptive, these are just normal shifts, could be 
> as simple as __builtin_ctz(SZ_4K) (gcc will optimize this) and so on.
> 
> OTOH the PAPR page sizes need macros as they are the ones which are 
> weird and screaming for macros.
> 
> I'd steal/rework spapr_page_mask_to_query_mask() from QEMU. Thanks,
> 

Thanks for this feedback!
I just sent a v2 applying your suggestions.

Best regards,
Leonardo Bras


Reply via email to