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:	Fri, 22 May 2009 20:13:16 +0900
From:	FUJITA Tomonori <fujita.tomonori@....ntt.co.jp>
To:	ian.campbell@...rix.com
Cc:	fujita.tomonori@....ntt.co.jp, jeremy@...p.org,
	beckyb@...nel.crashing.org, okir@...e.de, mingo@...e.hu,
	gregkh@...e.de, xendevel@...ts.xensource.com, x86@...nel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] swiotlb: make swiotlb phys<->bus translations
 architecture-specific

On Thu, 21 May 2009 17:15:27 +0100
Ian Campbell <ian.campbell@...rix.com> wrote:

> This moves swiotlb_bus_to_phys() and swiotlb_phys_to_bus() from
> lib/swiotlb.c to arch/*/include/asm/dma-mapping.h. On x86 gart_to_phys
> and phys_to_gart translations need an exported function for use from
> drivers so introduce common x86_ variants to implement the interface
> required by both.
> 
> The __weak swiotlb_bus_to_virt is not currently overriden by any
> architecture therefore it can be made static again. I imagine the
> ability to override phys<->bus translations will be sufficient for any
> potential users anyhow, otherwise we can revisit this aspect.
> 
> Signed-off-by: Ian Campbell <ian.campbell@...rix.com>
> Cc: FUJITA Tomonori <fujita.tomonori@....ntt.co.jp>
> Cc: Jeremy Fitzhardinge <jeremy@...p.org>
> Cc: Becky Bruce <beckyb@...nel.crashing.org>
> Cc: Olaf Kirch <okir@...e.de>
> Cc: Ingo Molnar <mingo@...e.hu>
> Cc: Greg KH <gregkh@...e.de>
> Cc: xen-devel <xendevel@...ts.xensource.com>
> Cc: x86 maintainers <x86@...nel.org>
> Cc: lkml <linux-kernel@...r.kernel.org>
> ---
>  arch/ia64/include/asm/dma-mapping.h |   13 +++++++++++++
>  arch/x86/include/asm/agp.h          |    4 ++--
>  arch/x86/include/asm/dma-mapping.h  |   15 +++++++++++++++
>  arch/x86/kernel/pci-swiotlb.c       |   18 ++++++++++++++++++
>  arch/x86/xen/pci-swiotlb.c          |   15 ---------------
>  include/linux/swiotlb.h             |    5 -----
>  lib/swiotlb.c                       |   14 +-------------
>  7 files changed, 49 insertions(+), 35 deletions(-)
> 
> diff --git a/arch/ia64/include/asm/dma-mapping.h b/arch/ia64/include/asm/dma-mapping.h
> index 9f9994d..667d04e 100644
> --- a/arch/ia64/include/asm/dma-mapping.h
> +++ b/arch/ia64/include/asm/dma-mapping.h
> @@ -190,4 +190,17 @@ static inline int swiotlb_force_mapping(phys_addr_t paddr, size_t size)
>  extern void *swiotlb_alloc_boot(size_t size, unsigned long nslabs);
>  extern void *swiotlb_alloc(unsigned order, unsigned long nslabs);
>  
> +static inline dma_addr_t swiotlb_phys_to_bus(struct device *hwdev,
> +					     phys_addr_t paddr)
> +{
> +	return paddr;
> +}
> +
> +static inline phys_addr_t swiotlb_bus_to_phys(struct device *hwdev,
> +					      dma_addr_t baddr)
> +{
> +	return baddr;
> +}
> +
> +

As I wrote in another mail, adding swiotlb specific code in
dma-mapping.h is wrong.
--
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