Re: [PATCH v4 13/24] iommu/mediatek: Add device link for smi-common and m4u

2020-11-11 Thread Nicolas Boichat
On Wed, Nov 11, 2020 at 8:40 PM Yong Wu wrote: > > In the lastest SoC, M4U has its special power domain. thus, If the engine > begin to work, it should help enable the power for M4U firstly. > Currently if the engine work, it always enable the power/clocks for > smi-larbs/smi-common. This patch

Re: [PATCH 06/21] iommu/io-pgtable-arm-v7s: Use ias to check the valid iova in unmap

2020-07-12 Thread Nicolas Boichat
On Sat, Jul 11, 2020 at 2:50 PM Yong Wu wrote: > > As title. > > Signed-off-by: Yong Wu > --- > drivers/iommu/io-pgtable-arm-v7s.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/iommu/io-pgtable-arm-v7s.c > b/drivers/iommu/io-pgtable-arm-v7s.c > index

Re: [PATCH v3 03/14] iommu/mediatek: Add device_link between the consumer and the larb devices

2020-03-04 Thread Nicolas Boichat
On Tue, Sep 3, 2019 at 5:38 PM Yong Wu wrote: > > MediaTek IOMMU don't have its power-domain. all the consumer connect > with smi-larb, then connect with smi-common. > > M4U > | > smi-common > | > - > | |... > | | > larb1

Re: [V3, 2/2] media: i2c: Add Omnivision OV02A10 camera sensor driver

2019-09-05 Thread Nicolas Boichat
On Fri, Sep 6, 2019 at 12:05 AM Sakari Ailus wrote: > > On Thu, Sep 05, 2019 at 07:53:37PM +0900, Tomasz Figa wrote: > > On Thu, Sep 5, 2019 at 7:45 PM Sakari Ailus > > wrote: > > > > > > Hi Dongchun, > > > > > > On Thu, Sep 05, 2019 at 05:41:05PM +0800, Dongchun Zhu wrote: > > > > > > ... > > >

Re: [PATCH v6 0/3] iommu/io-pgtable-arm-v7s: Use DMA32 zone for page tables

2019-03-19 Thread Nicolas Boichat
On Wed, Mar 20, 2019 at 1:56 AM Andrew Morton wrote: > > On Tue, 19 Mar 2019 15:41:43 +0800 Nicolas Boichat > wrote: > > > On Mon, Feb 25, 2019 at 8:23 AM Nicolas Boichat > > wrote: > > > > > > On Thu, Feb 14, 2019 at 1:12 AM Vlastimil Babka

Re: [PATCH v6 0/3] iommu/io-pgtable-arm-v7s: Use DMA32 zone for page tables

2019-03-19 Thread Nicolas Boichat
On Mon, Feb 25, 2019 at 8:23 AM Nicolas Boichat wrote: > > On Thu, Feb 14, 2019 at 1:12 AM Vlastimil Babka wrote: > > > > On 1/22/19 11:51 PM, Nicolas Boichat wrote: > > > Hi Andrew, > > > > > > On Fri, Jan 11, 2019 at 6:21 PM Joerg Roedel wrote: >

Re: [PATCH v6 0/3] iommu/io-pgtable-arm-v7s: Use DMA32 zone for page tables

2019-02-24 Thread Nicolas Boichat
On Thu, Feb 14, 2019 at 1:12 AM Vlastimil Babka wrote: > > On 1/22/19 11:51 PM, Nicolas Boichat wrote: > > Hi Andrew, > > > > On Fri, Jan 11, 2019 at 6:21 PM Joerg Roedel wrote: > >> > >> On Wed, Jan 02, 2019 at 01:51:45PM +0800, Nicolas Boichat wrote: &

Re: [PATCH] iommu/io-pgtable-arm-v7s: only kmemleak_ignore L2 tables

2019-02-24 Thread Nicolas Boichat
Joerg: Just to make sure, is this patch in your queue? Thanks. On Thu, Jan 31, 2019 at 2:21 AM Will Deacon wrote: > > On Mon, Jan 28, 2019 at 05:43:01PM +0800, Nicolas Boichat wrote: > > L1 tables are allocated with __get_dma_pages, and therefore already > > ignored by kmemlea

[PATCH] iommu/io-pgtable-arm-v7s: only kmemleak_ignore L2 tables

2019-01-28 Thread Nicolas Boichat
[2.863922] arm_v7s_alloc_pgtable+0x114/0x17c [2.868354] alloc_io_pgtable_ops+0x3c/0x78 ... Fixes: e5fc9753b1a8314 ("iommu/io-pgtable: Add ARMv7 short descriptor support") Signed-off-by: Nicolas Boichat --- I only tested this on top of my other series (https://patchwork.kernel.org/patc

Re: [PATCH v6 0/3] iommu/io-pgtable-arm-v7s: Use DMA32 zone for page tables

2019-01-22 Thread Nicolas Boichat
Hi Andrew, On Fri, Jan 11, 2019 at 6:21 PM Joerg Roedel wrote: > > On Wed, Jan 02, 2019 at 01:51:45PM +0800, Nicolas Boichat wrote: > > Does anyone have any further comment on this series? If not, which > > maintainer is going to pick this up? I assume Andrew Morton? > >

Re: [PATCH v5 18/20] iommu/mediatek: Fix VLD_PA_RANGE register backup when suspend

2019-01-01 Thread Nicolas Boichat
On Tue, Jan 1, 2019 at 11:59 AM Yong Wu wrote: > > The register VLD_PA_RNG(0x118) was forgot to backup while adding 4GB > mode support for mt2712. this patch add it. > > Fixes: 30e2fccf9512 ("iommu/mediatek: Enlarge the validate PA range > for 4GB mode") > Signed-off-by: Yong Wu > --- >

Re: [PATCH v5 11/20] iommu/mediatek: Move vld_pa_rng into plat_data

2019-01-01 Thread Nicolas Boichat
On Tue, Jan 1, 2019 at 11:58 AM Yong Wu wrote: > > Both mt8173 and mt8183 don't have this vld_pa_rng(valid physical address > range) register while mt2712 have. Move it into the plat_data. > > Signed-off-by: Yong Wu > --- > drivers/iommu/mtk_iommu.c | 3 ++- > drivers/iommu/mtk_iommu.h | 1 + >

Re: [PATCH v5 10/20] iommu/mediatek: Move reset_axi into plat_data

2019-01-01 Thread Nicolas Boichat
e this property. > > It is a preparing patch for mt8183. > > Signed-off-by: Yong Wu Reviewed-by: Nicolas Boichat > --- > drivers/iommu/mtk_iommu.c | 4 ++-- > drivers/iommu/mtk_iommu.h | 2 +- > 2 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/iommu/mt

Re: [PATCH v5 09/20] iommu/mediatek: Refine protect memory definition

2019-01-01 Thread Nicolas Boichat
On Tue, Jan 1, 2019 at 11:58 AM Yong Wu wrote: > > The protect memory setting is a little different in the different SoCs. > In the register REG_MMU_CTRL_REG(0x110), the TF_PROT(translation fault > protect) shift bit is normally 4 while it shift 5 bits only in the > mt8173. This patch delete the

Re: [PATCH v5 08/20] iommu/mediatek: Add larb-id remapped support

2019-01-01 Thread Nicolas Boichat
, we add a larb-id > remapping relationship in this patch. > > If there is no this larb-id remapping in some SoCs, use the linear > mapping array instead. > > This also is a preparing patch for mt8183. > > Signed-off-by: Yong Wu I think it's a little cleaner this way, thanks. Reviewed-by: Nicolas B

Re: [PATCH v4 10/18] iommu/mediatek: Add mt8183 IOMMU support

2018-12-21 Thread Nicolas Boichat
On Fri, Dec 21, 2018 at 4:02 PM Yong Wu wrote: > > On Fri, 2018-12-21 at 12:43 +0800, Nicolas Boichat wrote: > > On Sat, Dec 8, 2018 at 4:42 PM Yong Wu wrote: > > > > > > The M4U IP blocks in mt8183 is MediaTek's generation2 M4U which use > > > the ARM

Re: [PATCH v4 13/18] memory: mtk-smi: Add bus_sel for mt8183

2018-12-20 Thread Nicolas Boichat
On Sat, Dec 8, 2018 at 4:43 PM Yong Wu wrote: > > There are 2 mmu cells in a M4U HW. we could adjust some larbs entering > mmu0 or mmu1 to balance the bandwidth via the smi-common register > SMI_BUS_SEL(0x220)(Each larb occupy 2 bits). > > In mt8183, For better performance, we switch larb1/2/5/7

Re: [PATCH v4 10/18] iommu/mediatek: Add mt8183 IOMMU support

2018-12-20 Thread Nicolas Boichat
On Sat, Dec 8, 2018 at 4:42 PM Yong Wu wrote: > > The M4U IP blocks in mt8183 is MediaTek's generation2 M4U which use > the ARM Short-descriptor like mt8173, and most of the HW registers > are the same. > > Here list main differences between mt8183 and mt8173/mt2712: > 1) mt8183 has only one M4U

Re: [PATCH v4 08/18] iommu/mediatek: Add larb-id remapped support

2018-12-20 Thread Nicolas Boichat
On Sat, Dec 8, 2018 at 4:42 PM Yong Wu wrote: > > The larb-id may be remapped in the smi-common, this means the > larb-id reported in the mtk_iommu_isr isn't the real larb-id, > > Take mt8183 as a example: >M4U > | >

[PATCH v6 2/3] iommu/io-pgtable-arm-v7s: Request DMA32 memory, and improve debugging

2018-12-09 Thread Nicolas Boichat
in the future. Cc: sta...@vger.kernel.org Fixes: ad67f5a6545f ("arm64: replace ZONE_DMA with ZONE_DMA32") Signed-off-by: Nicolas Boichat --- Changes since v2: - Commit message (v3 used the page_frag approach) Changes since v4: - Do not pass ARM_V7S_TABLE_GFP_DMA to kmem_ca

[PATCH v6 1/3] mm: Add support for kmem caches in DMA32 zone

2018-12-09 Thread Nicolas Boichat
). These calls will continue to trigger a warning, as we keep GFP_DMA32 in GFP_SLAB_BUG_MASK. This implies that calls to kmem_cache_*alloc on a SLAB_CACHE_DMA32 kmem_cache must _not_ use GFP_DMA32 (it is anyway redundant and unnecessary). Cc: sta...@vger.kernel.org Signed-off-by: Nicolas Boichat Acked

[PATCH v6 3/3] mm: Add /sys/kernel/slab/cache/cache_dma32

2018-12-09 Thread Nicolas Boichat
A previous patch in this series adds support for SLAB_CACHE_DMA32 kmem caches. This adds the corresponding /sys/kernel/slab/cache/cache_dma32 entries, and fixes slabinfo tool. Cc: sta...@vger.kernel.org Signed-off-by: Nicolas Boichat --- There were different opinions on whether this sysfs entry

[PATCH v6 0/3] iommu/io-pgtable-arm-v7s: Use DMA32 zone for page tables

2018-12-09 Thread Nicolas Boichat
pped hunks that added cache_dma32 sysfs file, and moved the hunks to PATCH v5 3/3, so that maintainer can decide whether to pick the change independently. Changes since v5: - Rename ARM_V7S_TABLE_SLAB_CACHE to ARM_V7S_TABLE_SLAB_FLAGS. - Add stable@ to cc. Nicolas Boichat (3): mm: Add suppor

Re: [PATCH v5 2/3] iommu/io-pgtable-arm-v7s: Request DMA32 memory, and improve debugging

2018-12-07 Thread Nicolas Boichat
On Fri, Dec 7, 2018 at 4:05 PM Matthew Wilcox wrote: > > On Fri, Dec 07, 2018 at 02:16:19PM +0800, Nicolas Boichat wrote: > > +#ifdef CONFIG_ZONE_DMA32 > > +#define ARM_V7S_TABLE_GFP_DMA GFP_DMA32 > > +#define ARM_V7S_TABLE_SLAB_CACHE SLAB_CACHE_DMA32 > > This nam

[PATCH v5 0/3] iommu/io-pgtable-arm-v7s: Use DMA32 zone for page tables

2018-12-06 Thread Nicolas Boichat
the hunks to PATCH v5 3/3, so that maintainer can decide whether to pick the change independently. Nicolas Boichat (3): mm: Add support for kmem caches in DMA32 zone iommu/io-pgtable-arm-v7s: Request DMA32 memory, and improve debugging mm: Add /sys/kernel/slab/cache/cache_dma32

[PATCH v5 2/3] iommu/io-pgtable-arm-v7s: Request DMA32 memory, and improve debugging

2018-12-06 Thread Nicolas Boichat
in the future. Fixes: ad67f5a6545f ("arm64: replace ZONE_DMA with ZONE_DMA32") Signed-off-by: Nicolas Boichat --- Changes since v2: - Commit message (v3 used the page_frag approach) Changes since v4: - Do not pass ARM_V7S_TABLE_GFP_DMA to kmem_cache_zalloc, as this is u

[PATCH v5 1/3] mm: Add support for kmem caches in DMA32 zone

2018-12-06 Thread Nicolas Boichat
). These calls will continue to trigger a warning, as we keep GFP_DMA32 in GFP_SLAB_BUG_MASK. This implies that calls to kmem_cache_*alloc on a SLAB_CACHE_DMA32 kmem_cache must _not_ use GFP_DMA32 (it is anyway redundant and unnecessary). Signed-off-by: Nicolas Boichat --- Changes since v2: - Clarified

[PATCH v5 3/3] mm: Add /sys/kernel/slab/cache/cache_dma32

2018-12-06 Thread Nicolas Boichat
A previous patch in this series adds support for SLAB_CACHE_DMA32 kmem caches. This adds the corresponding /sys/kernel/slab/cache/cache_dma32 entries, and fixes slabinfo tool. Signed-off-by: Nicolas Boichat --- There were different opinions on whether this sysfs entry should be added, so I'll

Re: [PATCH v4 2/3] mm: Add support for kmem caches in DMA32 zone

2018-12-06 Thread Nicolas Boichat
On Thu, Dec 6, 2018 at 5:37 PM Vlastimil Babka wrote: > > On 12/6/18 4:49 AM, Nicolas Boichat wrote: > >> So it would be fine even unchanged. The check would anyway need some > >> more love to catch the same with __GFP_DMA to be consistent and cover > >> al

Re: [PATCH v4 2/3] mm: Add support for kmem caches in DMA32 zone

2018-12-05 Thread Nicolas Boichat
On Thu, Dec 6, 2018 at 11:32 AM Wei Yang wrote: > > On Thu, Dec 06, 2018 at 08:41:36AM +0800, Nicolas Boichat wrote: > >On Wed, Dec 5, 2018 at 8:18 PM Wei Yang wrote: > >> > >> On Wed, Dec 05, 2018 at 03:39:51PM +0800, Nicolas Boichat wrote: > >> >On W

Re: [PATCH v4 2/3] mm: Add support for kmem caches in DMA32 zone

2018-12-05 Thread Nicolas Boichat
On Wed, Dec 5, 2018 at 10:02 PM Vlastimil Babka wrote: > > On 12/5/18 6:48 AM, Nicolas Boichat wrote: > > In some cases (e.g. IOMMU ARMv7s page allocator), we need to allocate > > data structures smaller than a page with GFP_DMA32 flag. > > > > This change makes

Re: [PATCH v4 2/3] mm: Add support for kmem caches in DMA32 zone

2018-12-05 Thread Nicolas Boichat
On Wed, Dec 5, 2018 at 8:18 PM Wei Yang wrote: > > On Wed, Dec 05, 2018 at 03:39:51PM +0800, Nicolas Boichat wrote: > >On Wed, Dec 5, 2018 at 3:25 PM Wei Yang wrote: > >> > >> On Wed, Dec 05, 2018 at 01:48:27PM +0800, Nicolas Boichat wrote: > >> >In so

Re: [PATCH v4 2/3] mm: Add support for kmem caches in DMA32 zone

2018-12-05 Thread Nicolas Boichat
On Wed, Dec 5, 2018 at 5:56 PM Michal Hocko wrote: > > On Wed 05-12-18 13:48:27, Nicolas Boichat wrote: > > In some cases (e.g. IOMMU ARMv7s page allocator), we need to allocate > > data structures smaller than a page with GFP_DMA32 flag. > > > > This change makes

Re: [PATCH v4 2/3] mm: Add support for kmem caches in DMA32 zone

2018-12-04 Thread Nicolas Boichat
On Wed, Dec 5, 2018 at 3:25 PM Wei Yang wrote: > > On Wed, Dec 05, 2018 at 01:48:27PM +0800, Nicolas Boichat wrote: > >In some cases (e.g. IOMMU ARMv7s page allocator), we need to allocate > >data structures smaller than a page with GFP_DMA32 flag. > > > >This chan

Re: [PATCH v2 0/3] iommu/io-pgtable-arm-v7s: Use DMA32 zone for page tables

2018-12-04 Thread Nicolas Boichat
On Wed, Dec 5, 2018 at 10:04 AM Nicolas Boichat wrote: > > On Tue, Dec 4, 2018 at 10:35 PM Vlastimil Babka wrote: > > > > On 12/4/18 10:37 AM, Nicolas Boichat wrote: > > > On Sun, Nov 11, 2018 at 5:04 PM Nicolas Boichat > > > wrote: > > >> &g

[PATCH v4 3/3] iommu/io-pgtable-arm-v7s: Request DMA32 memory, and improve debugging

2018-12-04 Thread Nicolas Boichat
in SLAB_CACHE_DMA32. Also, print an error when the physical address does not fit in 32-bit, to make debugging easier in the future. Fixes: ad67f5a6545f ("arm64: replace ZONE_DMA with ZONE_DMA32") Signed-off-by: Nicolas Boichat --- Changes since v2: - Commit message (v3 used the

[PATCH v4 1/3] mm: slab/slub: Add check_slab_flags function to check for valid flags

2018-12-04 Thread Nicolas Boichat
Remove duplicated code between slab and slub, and will make it easier to make the test more complicated in the next commits. Fixes: ad67f5a6545f ("arm64: replace ZONE_DMA with ZONE_DMA32") Signed-off-by: Nicolas Boichat --- mm/internal.h | 18 -- mm/slab.c | 8 +-

[PATCH v4 2/3] mm: Add support for kmem caches in DMA32 zone

2018-12-04 Thread Nicolas Boichat
kmalloc cache array, as there are currently no users of kmalloc(..., GFP_DMA32). The new test in check_slab_flags ensures that such calls still fail (as they do before this change). Fixes: ad67f5a6545f ("arm64: replace ZONE_DMA with ZONE_DMA32") Signed-off-by: Nicolas Boichat --- Change

[PATCH v4 0/3] iommu/io-pgtable-arm-v7s: Use DMA32 zone for page tables

2018-12-04 Thread Nicolas Boichat
by the previous commit. - Use DMA or DMA32 depending on the architecture (DMA for arm, DMA32 for arm64). Changes since v2: - Reworded and expanded commit messages - Added cache_dma32 documentation in PATCH 2/3. v3 used the page_frag approach, see [3]. Nicolas Boichat (3): mm

Re: [PATCH v2 0/3] iommu/io-pgtable-arm-v7s: Use DMA32 zone for page tables

2018-12-04 Thread Nicolas Boichat
On Tue, Dec 4, 2018 at 10:35 PM Vlastimil Babka wrote: > > On 12/4/18 10:37 AM, Nicolas Boichat wrote: > > On Sun, Nov 11, 2018 at 5:04 PM Nicolas Boichat > > wrote: > >> > >> This is a follow-up to the discussion in [1], to make sure that the page > >

Re: [PATCH v2 0/3] iommu/io-pgtable-arm-v7s: Use DMA32 zone for page tables

2018-12-04 Thread Nicolas Boichat
On Sun, Nov 11, 2018 at 5:04 PM Nicolas Boichat wrote: > > This is a follow-up to the discussion in [1], to make sure that the page > tables allocated by iommu/io-pgtable-arm-v7s are contained within 32-bit > physical address space. > > [1] > https://lists.linuxfoundatio

[PATCH v3, RFC] iommu/io-pgtable-arm-v7s: Use page_frag to request DMA32 memory

2018-12-04 Thread Nicolas Boichat
debugging easier in the future. Fixes: ad67f5a6545f ("arm64: replace ZONE_DMA with ZONE_DMA32") Signed-off-by: Nicolas Boichat --- As an alternative to the series [1], which adds support for GFP_DMA32 to kmem_cache in mm/. IMHO the solution in [1] is cleaner and more efficient, as it al

Re: [PATCH v2 0/3] iommu/io-pgtable-arm-v7s: Use DMA32 zone for page tables

2018-11-28 Thread Nicolas Boichat
On Mon, Nov 26, 2018 at 4:02 PM Christoph Hellwig wrote: > > On Fri, Nov 23, 2018 at 01:23:41PM +0100, Vlastimil Babka wrote: > > Is this also true for caches created by kmem_cache_create(), that > > debugging options can result in not respecting the alignment passed to > > kmem_cache_create()?

Re: [PATCH v2 0/3] iommu/io-pgtable-arm-v7s: Use DMA32 zone for page tables

2018-11-22 Thread Nicolas Boichat
On Fri, Nov 23, 2018 at 11:04 AM Nicolas Boichat wrote: > > On Thu, Nov 22, 2018 at 4:23 PM Christoph Hellwig wrote: > > > > On Wed, Nov 21, 2018 at 10:26:26PM +, Robin Murphy wrote: > > > TBH, if this DMA32 stuff is going to be contentious we could possibly just

Re: [PATCH v2 0/3] iommu/io-pgtable-arm-v7s: Use DMA32 zone for page tables

2018-11-22 Thread Nicolas Boichat
On Thu, Nov 22, 2018 at 4:23 PM Christoph Hellwig wrote: > > On Wed, Nov 21, 2018 at 10:26:26PM +, Robin Murphy wrote: > > TBH, if this DMA32 stuff is going to be contentious we could possibly just > > rip out the offending kmem_cache - it seemed like good practice for the > > use-case, but

Re: [PATCH v2 0/3] iommu/io-pgtable-arm-v7s: Use DMA32 zone for page tables

2018-11-21 Thread Nicolas Boichat
On Thu, Nov 22, 2018 at 10:36 AM Matthew Wilcox wrote: > > On Wed, Nov 21, 2018 at 10:26:26PM +, Robin Murphy wrote: > > These are IOMMU page tables, rather than CPU ones, so we're already well > > outside arch code - indeed the original motivation of io-pgtable was to be > > entirely

Re: [PATCH v2 3/3] iommu/io-pgtable-arm-v7s: Request DMA32 memory, and improve debugging

2018-11-21 Thread Nicolas Boichat
On Thu, Nov 22, 2018 at 2:02 AM Michal Hocko wrote: > > On Wed 21-11-18 16:46:38, Will Deacon wrote: > > On Sun, Nov 11, 2018 at 05:03:41PM +0800, Nicolas Boichat wrote: > > > For level 1/2 pages, ensure GFP_DMA32 is used if CONFIG_ZONE_DMA32 > > > is de

Re: [PATCH v2 0/3] iommu/io-pgtable-arm-v7s: Use DMA32 zone for page tables

2018-11-21 Thread Nicolas Boichat
On Thu, Nov 22, 2018 at 6:27 AM Robin Murphy wrote: > > On 2018-11-21 9:38 pm, Matthew Wilcox wrote: > > On Wed, Nov 21, 2018 at 06:20:02PM +, Christopher Lameter wrote: > >> On Sun, 11 Nov 2018, Nicolas Boichat wrote: > >> > >>> This is a follow

Re: [PATCH v2 2/3] mm: Add support for SLAB_CACHE_DMA32

2018-11-21 Thread Nicolas Boichat
On Thu, Nov 22, 2018 at 2:32 AM Christopher Lameter wrote: > > On Sun, 11 Nov 2018, Nicolas Boichat wrote: > > > SLAB_CACHE_DMA32 is only available after explicit kmem_cache_create calls, > > no default cache is created for kmalloc. Add a test in check_slab_flags > &

[PATCH v2 2/3] mm: Add support for SLAB_CACHE_DMA32

2018-11-11 Thread Nicolas Boichat
SLAB_CACHE_DMA32 is only available after explicit kmem_cache_create calls, no default cache is created for kmalloc. Add a test in check_slab_flags for this. Fixes: ad67f5a6545f ("arm64: replace ZONE_DMA with ZONE_DMA32") Signed-off-by: Nicolas Boichat --- include/linux/slab.h |

[PATCH v2 3/3] iommu/io-pgtable-arm-v7s: Request DMA32 memory, and improve debugging

2018-11-11 Thread Nicolas Boichat
: ad67f5a6545f ("arm64: replace ZONE_DMA with ZONE_DMA32") Signed-off-by: Nicolas Boichat --- Changes since v1: - Changed approach to use SLAB_CACHE_DMA32 added by the previous commit. - Use DMA or DMA32 depending on the architecture (DMA for arm, DMA32 for arm64). drivers/iommu/io-pgtable

[PATCH v2 1/3] mm: slab/slub: Add check_slab_flags function to check for valid flags

2018-11-11 Thread Nicolas Boichat
Remove duplicated code between slab and slub, and will make it easier to make the test more complicated in the next commits. Fixes: ad67f5a6545f ("arm64: replace ZONE_DMA with ZONE_DMA32") Signed-off-by: Nicolas Boichat --- mm/internal.h | 17 +++-- mm/slab.c | 8 +-

[PATCH v2 0/3] iommu/io-pgtable-arm-v7s: Use DMA32 zone for page tables

2018-11-11 Thread Nicolas Boichat
for SLAB_CACHE_DMA32 in slab and slub (patches 1/2) - iommu/io-pgtable-arm-v7s (patch 3): - Changed approach to use SLAB_CACHE_DMA32 added by the previous commit. - Use DMA or DMA32 depending on the architecture (DMA for arm, DMA32 for arm64). Nicolas Boichat (3): mm: slab/slub: Add

Re: [PATCH RFC 1/3] mm: When CONFIG_ZONE_DMA32 is set, use DMA32 for SLAB_CACHE_DMA

2018-11-09 Thread Nicolas Boichat
On Fri, Nov 9, 2018 at 6:43 PM Vlastimil Babka wrote: > > On 11/9/18 9:24 AM, Nicolas Boichat wrote: > > Some callers, namely iommu/io-pgtable-arm-v7s, expect the physical > > address returned by kmem_cache_alloc with GFP_DMA parameter to be > > a 32-bit address. &

Re: iommu/io-pgtable-arm-v7s: About pagetable 33bit PA

2018-11-09 Thread Nicolas Boichat
er/1009116/ . I'm still a bit uncomfortable with GFP_DMA passed to kmem_cache_alloc suddenly becoming GFP_DMA32 in the underlying call, but I'm not sure if there is a better way (apart from duplicating the caches, and a lot of ifdefs in callers). Thanks, > > > > Robin. > > > > &g

[PATCH RFC 1/3] mm: When CONFIG_ZONE_DMA32 is set, use DMA32 for SLAB_CACHE_DMA

2018-11-09 Thread Nicolas Boichat
allocate SLAB_CACHE_DMA cache in DMA32 region, if CONFIG_ZONE_DMA32 is set. Fixes: ad67f5a6545f ("arm64: replace ZONE_DMA with ZONE_DMA32") Signed-off-by: Nicolas Boichat --- include/linux/slab.h | 13 - mm/slab.c| 2 +- mm/slub.c| 2 +- 3 files c

[PATCH RFC 3/3] iommu/io-pgtable-arm-v7s: Request DMA32 memory, and improve debugging

2018-11-09 Thread Nicolas Boichat
easier in the future. Fixes: ad67f5a6545f ("arm64: replace ZONE_DMA with ZONE_DMA32") Signed-off-by: Nicolas Boichat --- drivers/iommu/io-pgtable-arm-v7s.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/iommu/io-pgtable-arm-v7s.c b/drivers/iommu/io-p

[PATCH RFC 2/3] include/linux/gfp.h: Add __get_dma32_pages macro

2018-11-09 Thread Nicolas Boichat
Some callers (e.g. iommu/io-pgtable-arm-v7s) require DMA32 memory when calling __get_dma_pages. Add a new macro for that purpose. Fixes: ad67f5a6545f ("arm64: replace ZONE_DMA with ZONE_DMA32") Signed-off-by: Nicolas Boichat --- include/linux/gfp.h | 2 ++ 1 file changed, 2 insertion

[PATCH RFC 0/3] iommu/io-pgtable-arm-v7s: Use DMA32 zone for page tables

2018-11-09 Thread Nicolas Boichat
This is a follow-up to the discussion in [1], to make sure that the page tables allocated by iommu/io-pgtable-arm-v7s are contained within 32-bit physical address space. [1] https://lists.linuxfoundation.org/pipermail/iommu/2018-November/030876.html Nicolas Boichat (3): mm: When