[PATCH 1/1] powerpc/iommu: Enable remaining IOMMU Pagesizes present in LoPAR

Leonardo Bras leobras.c at gmail.com
Thu Apr 8 05:58:27 AEST 2021


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




More information about the Linuxppc-dev mailing list