lkml.org 
[lkml]   [2009]   [May]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 5/9] xen: enable swiotlb for xen domain 0.
From
On Thu,  7 May 2009 17:17:18 -0700
Jeremy Fitzhardinge <jeremy@goop.org> wrote:

> From: Ian Campbell <ian.campbell@citrix.com>
>
> Impact: Xen DMA support
>
> Enable swiotlb when running as a Xen dom0 domain.
>
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
> Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
> ---
> arch/x86/kernel/pci-swiotlb.c | 5 +++++
> arch/x86/xen/Kconfig | 1 +
> drivers/pci/xen-iommu.c | 5 +++++
> include/xen/swiotlb.h | 9 +++++++++
> 4 files changed, 20 insertions(+), 0 deletions(-)
>
> diff --git a/arch/x86/kernel/pci-swiotlb.c b/arch/x86/kernel/pci-swiotlb.c
> index 861c869..2d8dd35 100644
> --- a/arch/x86/kernel/pci-swiotlb.c
> +++ b/arch/x86/kernel/pci-swiotlb.c
> @@ -11,6 +11,8 @@
> #include <asm/swiotlb.h>
> #include <asm/dma.h>
>
> +#include <xen/swiotlb.h>
> +
> int swiotlb __read_mostly;
>
> static void *x86_swiotlb_alloc_coherent(struct device *hwdev, size_t size,
> @@ -49,6 +51,9 @@ void __init pci_swiotlb_init(void)
> if (!iommu_detected && !no_iommu && max_pfn > MAX_DMA32_PFN)
> swiotlb = 1;
> #endif
> + if (xen_wants_swiotlb())
> + swiotlb = 1;
> +
> if (swiotlb_force)
> swiotlb = 1;
> if (swiotlb) {

Acked-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>

I don't like the patch much though.

The x86 dma startup code is complicated and adding another hook makes
it more complicated.


\
 
 \ /
  Last update: 2009-05-11 05:45    [W:0.112 / U:0.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site