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: <20081201113451.GA24323@8bytes.org>
Date:	Mon, 1 Dec 2008 12:34:51 +0100
From:	Joerg Roedel <joro@...tes.org>
To:	Thomas Bogendoerfer <tsbogend@...ha.franken.de>
Cc:	linux-kernel@...r.kernel.org, mingo@...e.hu
Subject: Re: [PATCH v3] Fix dma_mapping_error for 32bit x86

On Sat, Nov 29, 2008 at 01:46:27PM +0100, Thomas Bogendoerfer wrote:
> Devices like b44 ethernet can't dma from addresses above 1GB. The driver
> handles this cases by falling back to GFP_DMA allocation. But for detecting
> the problem it needs to get an indication from dma_mapping_error.
> The bug is triggered by using a VMSPLIT option of 2G/2G.

Looks like your system uses swiotlb as the dma_ops backend. Its the only
implementation providing the ops->mapping_error callback and does not
use bad_dma_address as the error value.

> Signed-off-by: Thomas Bogendoerfer <tsbogend@...ha.franken.de>

Acked-by: Joerg Roedel <joro@...tes.org>

> 
> diff -ru orig/linux-2.6.27.4/include/asm-x86/dma-mapping.h linux-2.6.27.4/include/asm-x86/dma-mapping.h
> --- orig/linux-2.6.27.4/include/asm-x86/dma-mapping.h	2008-10-26 00:05:07.000000000 +0200
> +++ linux-2.6.27.4/include/asm-x86/dma-mapping.h	2008-10-26 11:06:14.000000000 +0100
> @@ -74,15 +74,13 @@
>  /* Make sure we keep the same behaviour */
>  static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
>  {
> -#ifdef CONFIG_X86_32
> -	return 0;
> -#else
> +#ifdef CONFIG_X86_64
>  	struct dma_mapping_ops *ops = get_dma_ops(dev);
>  	if (ops->mapping_error)
>  		return ops->mapping_error(dev, dma_addr);
>  
> -	return (dma_addr == bad_dma_address);
>  #endif
> +	return (dma_addr == bad_dma_address);
>  }
>  
>  #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ