lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAFQd5DP4b-Cmm+=e01SXanbMwNXfGkeTFvKMY4OV0n1y7rOTA@mail.gmail.com>
Date:   Wed, 26 Jul 2017 18:26:39 +0900
From:   Tomasz Figa <tfiga@...omium.org>
To:     Joerg Roedel <joro@...tes.org>
Cc:     "open list:IOMMU DRIVERS" <iommu@...ts.linux-foundation.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Robin Murphy <robin.murphy@....com>
Subject: Re: [PATCH v2 1/2] iommu/dma: Respect __GFP_DMA and __GFP_DMA32 in
 incoming GFP flags

Hi Joerg,

On Wed, Jul 26, 2017 at 6:15 PM, Joerg Roedel <joro@...tes.org> wrote:
> On Tue, Jul 04, 2017 at 10:55:55PM +0900, Tomasz Figa wrote:
>> Current implementation of __iommu_dma_alloc_pages() keeps adding
>> __GFP_HIGHMEM to GFP flags regardless of whether other zone flags are
>> already included in the incoming flags. If __GFP_DMA or __GFP_DMA32 is
>> set at the same time as __GFP_HIGHMEM, the allocation fails due to
>> invalid zone flag combination.
>>
>> Fix this by checking for __GFP_DMA and __GFP_DMA32 in incoming GFP flags
>> and adding __GFP_HIGHMEM only if they are not present.
>>
>> Signed-off-by: Tomasz Figa <tfiga@...omium.org>
>
> Isn't it better to mask out __GFP_DMA and __GFP_DMA32 in the allocation
> flags and only take them into account for iova allocation?
>
> When the IOMMU re-maps the DMA to this memory it doesn't matter where it
> is in system memory.

It's a platform specific knowledge and I'd say the generic helper is
not where it should be decided. Please see my reply to Robin for v1
[1].

[1] https://patchwork.kernel.org/patch/9810921/

Best regards.
Tomasz

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ