Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1240138
| From | David Gibson <david@gibson.dropbear.id.au> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 1/2] powerpc/iommu: expose IOMMU page shift |
| Date | 2015-10-06 05:30 +0200 |
| Message-ID | <qgr6V-2iB-1@gated-at.bofh.it> (permalink) |
| References | <qfc9X-1mW-5@gated-at.bofh.it> <qfc9Y-1mW-23@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
[Multipart message — attachments visible in raw view] - view raw
On Fri, Oct 02, 2015 at 10:18:00AM -0700, Nishanth Aravamudan wrote: > We will leverage this macro in the NVMe driver, which needs to know the > configured IOMMU page shift to properly configure its device's page > size. > > Signed-off-by: Nishanth Aravamudan <nacc@linux.vnet.ibm.com> > > --- > Given this is available, it seems reasonable to expose -- and it doesn't > really make sense to make the driver do a log2 call on the existing > IOMMU_PAGE_SIZE() value. > > diff --git a/arch/powerpc/include/asm/iommu.h b/arch/powerpc/include/asm/iommu.h > index ca18cff..6fdf857 100644 > --- a/arch/powerpc/include/asm/iommu.h > +++ b/arch/powerpc/include/asm/iommu.h > @@ -36,6 +36,7 @@ > #define IOMMU_PAGE_MASK_4K (~((1 << IOMMU_PAGE_SHIFT_4K) - 1)) > #define IOMMU_PAGE_ALIGN_4K(addr) _ALIGN_UP(addr, IOMMU_PAGE_SIZE_4K) > > +#define IOMMU_PAGE_SHIFT(tblptr) (tblptr)->it_page_shift > #define IOMMU_PAGE_SIZE(tblptr) (ASM_CONST(1) << (tblptr)->it_page_shift) Seems like it would be a touch safer to alter IOMMU_PAGE_SIZE so it uses the new IOMMU_PAGE_SHIFT macro. > #define IOMMU_PAGE_MASK(tblptr) (~((1 << (tblptr)->it_page_shift) - 1)) > #define IOMMU_PAGE_ALIGN(addr, tblptr) _ALIGN_UP(addr, IOMMU_PAGE_SIZE(tblptr)) > -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/2] Fix NVMe driver support on Power with 32-bit DMA Nishanth Aravamudan <nacc@linux.vnet.ibm.com> - 2015-10-02 19:20 +0200
[PATCH 1/2] powerpc/iommu: expose IOMMU page shift Nishanth Aravamudan <nacc@linux.vnet.ibm.com> - 2015-10-02 19:20 +0200
[PATCH 2/2] drivers/nvme: default to the IOMMU page size on Power Nishanth Aravamudan <nacc@linux.vnet.ibm.com> - 2015-10-02 19:30 +0200
Re: [PATCH 2/2] drivers/nvme: default to the IOMMU page size on Power Christoph Hellwig <hch@infradead.org> - 2015-10-02 19:30 +0200
Re: [PATCH 2/2] drivers/nvme: default to the IOMMU page size on Power Nishanth Aravamudan <nacc@linux.vnet.ibm.com> - 2015-10-02 19:50 +0200
Re: [PATCH 2/2] drivers/nvme: default to the IOMMU page size on Power Christoph Hellwig <hch@infradead.org> - 2015-10-02 19:50 +0200
Re: [PATCH 1/2] powerpc/iommu: expose IOMMU page shift David Gibson <david@gibson.dropbear.id.au> - 2015-10-06 05:30 +0200
Re: [PATCH 1/2] powerpc/iommu: expose IOMMU page shift Nishanth Aravamudan <nacc@linux.vnet.ibm.com> - 2015-10-12 18:10 +0200
Re: [PATCH 1/2] powerpc/iommu: expose IOMMU page shift Nishanth Aravamudan <nacc@linux.vnet.ibm.com> - 2015-10-12 23:20 +0200
[PATCH 2/5 v2] powerpc/dma-mapping: override dma_get_page_shift Nishanth Aravamudan <nacc@linux.vnet.ibm.com> - 2015-10-02 22:20 +0200
[PATCH 3/5 v2] powerpc/dma: implement per-platform dma_get_page_shift Nishanth Aravamudan <nacc@linux.vnet.ibm.com> - 2015-10-02 22:20 +0200
[PATCH 4/5 v2] pseries/iommu: implement DDW-aware dma_get_page_shift Nishanth Aravamudan <nacc@linux.vnet.ibm.com> - 2015-10-02 22:30 +0200
[PATCH 5/5 v2] drivers/nvme: default to the IOMMU page size Nishanth Aravamudan <nacc@linux.vnet.ibm.com> - 2015-10-02 22:40 +0200
Re: [PATCH 4/5 v2] pseries/iommu: implement DDW-aware dma_get_page_shift kbuild test robot <lkp@intel.com> - 2015-10-02 22:40 +0200
Re: [PATCH 4/5 v2] pseries/iommu: implement DDW-aware dma_get_page_shift Michael Ellerman <mpe@ellerman.id.au> - 2015-10-06 05:40 +0200
Re: [kbuild-all] [PATCH 4/5 v2] pseries/iommu: implement DDW-aware dma_get_page_shift Fengguang Wu <lkp@intel.com> - 2015-10-07 16:00 +0200
Re: [kbuild-all] [PATCH 4/5 v2] pseries/iommu: implement DDW-aware dma_get_page_shift Michael Ellerman <mpe@ellerman.id.au> - 2015-10-08 02:20 +0200
Re: [kbuild-all] [PATCH 4/5 v2] pseries/iommu: implement DDW-aware dma_get_page_shift Fengguang Wu <lkp@intel.com> - 2015-10-08 03:10 +0200
Re: [kbuild-all] [PATCH 4/5 v2] pseries/iommu: implement DDW-aware dma_get_page_shift Fengguang Wu <lkp@intel.com> - 2015-10-08 03:20 +0200
Re: [kbuild-all] [PATCH 4/5 v2] pseries/iommu: implement DDW-aware dma_get_page_shift Michael Ellerman <mpe@ellerman.id.au> - 2015-10-08 06:10 +0200
Re: [kbuild-all] [PATCH 4/5 v2] pseries/iommu: implement DDW-aware dma_get_page_shift Fengguang Wu <lkp@intel.com> - 2015-10-11 16:30 +0200
Re: [kbuild-all] [PATCH 4/5 v2] pseries/iommu: implement DDW-aware dma_get_page_shift Michael Ellerman <mpe@ellerman.id.au> - 2015-10-12 05:00 +0200
Re: [kbuild-all] [PATCH 4/5 v2] pseries/iommu: implement DDW-aware dma_get_page_shift Christoph Hellwig <hch@infradead.org> - 2015-10-08 09:50 +0200
testing email patches Fengguang Wu <lkp@intel.com> - 2015-10-11 16:30 +0200
[PATCH 1/5 v2] dma-mapping: add generic dma_get_page_shift API Nishanth Aravamudan <nacc@linux.vnet.ibm.com> - 2015-10-02 22:20 +0200
Re: [PATCH 1/5 v2] dma-mapping: add generic dma_get_page_shift API Michael Ellerman <mpe@ellerman.id.au> - 2015-10-06 05:50 +0200
Re: [PATCH 1/5 v2] dma-mapping: add generic dma_get_page_shift API Christoph Hellwig <hch@infradead.org> - 2015-10-06 12:00 +0200
Re: [PATCH 1/5 v2] dma-mapping: add generic dma_get_page_shift API Nishanth Aravamudan <nacc@linux.vnet.ibm.com> - 2015-10-12 18:10 +0200
Re: [PATCH 1/5 v2] dma-mapping: add generic dma_get_page_shift API Nishanth Aravamudan <nacc@linux.vnet.ibm.com> - 2015-10-12 23:10 +0200
Re: [PATCH 1/5 v2] dma-mapping: add generic dma_get_page_shift API Nishanth Aravamudan <nacc@linux.vnet.ibm.com> - 2015-10-14 17:40 +0200
Re: [PATCH 1/5 v2] dma-mapping: add generic dma_get_page_shift API Christoph Hellwig <hch@infradead.org> - 2015-10-14 17:50 +0200
Re: [PATCH 1/5 v2] dma-mapping: add generic dma_get_page_shift API Nishanth Aravamudan <nacc@linux.vnet.ibm.com> - 2015-10-16 01:00 +0200
[PATCH 0/5 v2] Fix NVMe driver support on Power with 32-bit DMA Nishanth Aravamudan <nacc@linux.vnet.ibm.com> - 2015-10-02 22:20 +0200
Re: [PATCH 0/5 v2] Fix NVMe driver support on Power with 32-bit DMA Nishanth Aravamudan <nacc@linux.vnet.ibm.com> - 2015-10-02 23:10 +0200
Re: [PATCH 0/5 v2] Fix NVMe driver support on Power with 32-bit DMA Benjamin Herrenschmidt <benh@kernel.crashing.org> - 2015-10-02 23:40 +0200
Re: [PATCH 0/5 v2] Fix NVMe driver support on Power with 32-bit DMA Nishanth Aravamudan <nacc@linux.vnet.ibm.com> - 2015-10-03 00:00 +0200
Re: [PATCH 0/5 v2] Fix NVMe driver support on Power with 32-bit DMA Benjamin Herrenschmidt <benh@kernel.crashing.org> - 2015-10-02 23:30 +0200
Re: [PATCH 0/5 v2] Fix NVMe driver support on Power with 32-bit DMA Christoph Hellwig <hch@infradead.org> - 2015-10-03 10:30 +0200
csiph-web