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]
Date:   Thu, 15 Mar 2018 13:47:48 -0400
From:   Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
To:     Christoph Hellwig <hch@....de>
Cc:     x86@...nel.org, Tom Lendacky <thomas.lendacky@....com>,
        David Woodhouse <dwmw2@...radead.org>,
        Muli Ben-Yehuda <mulix@...ix.org>,
        Jon Mason <jdmason@...zu.us>, Joerg Roedel <joro@...tes.org>,
        iommu@...ts.linux-foundation.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 05/14] x86/amd_gart: look at coherent_dma_mask instead of
 GFP_DMA

On Wed, Mar 14, 2018 at 06:52:04PM +0100, Christoph Hellwig wrote:
> We want to phase out looking at the magic GFP_DMA flag in the dma mapping
> routines, so switch the gart driver to use the coherent_dma_mask instead,
> which is used to select the GFP_DMA flag in the caller.
> 
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>

> Signed-off-by: Christoph Hellwig <hch@....de>
> ---
>  arch/x86/kernel/amd_gart_64.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/x86/kernel/amd_gart_64.c b/arch/x86/kernel/amd_gart_64.c
> index 52e3abcf3e70..79ac6caaaabb 100644
> --- a/arch/x86/kernel/amd_gart_64.c
> +++ b/arch/x86/kernel/amd_gart_64.c
> @@ -484,7 +484,7 @@ gart_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_addr,
>  	unsigned long align_mask;
>  	struct page *page;
>  
> -	if (force_iommu && !(flag & GFP_DMA)) {
> +	if (force_iommu && dev->coherent_dma_mask > DMA_BIT_MASK(24)) {
>  		flag &= ~(__GFP_DMA | __GFP_HIGHMEM | __GFP_DMA32);
>  		page = alloc_pages(flag | __GFP_ZERO, get_order(size));
>  		if (!page)
> -- 
> 2.14.2
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ