All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ronny.Hegewald@online.de
To: xen-devel@lists.xensource.com
Cc: jeremy@goop.org
Subject: [PVOPS][PATCH] xen-swiotlb: don't allocate DMA-memory beyond 32-bit
Date: Mon, 01 Feb 2010 22:30:11 +0100	[thread overview]
Message-ID: <28767599.3850891265059811952.JavaMail.servlet@kundenserver> (raw)

[-- Attachment #1: Type: text/plain, Size: 1035 bytes --]

When running 32-bit pvops-dom0 and a driver tries to allocate a coherent DMA-memory the xen swiotlb-implementation returned memory beyond 4GB.

This caused for example not working sound on a system with 4 GB and a 64-bit compatible sound-card with sets the DMA-mask to 64bit. 

On bare-metal and the forward-ported xen-dom0 patches from OpenSuse a coherent DMA-memory is always allocated inside the 32-bit address-range by calling dma_alloc_coherent_mask. 

The attached patch adds the same functionality to xen swiotlb.

Signed-off-by: Ronny Hegewald <Ronny.Hegewald@online.de>

--- arch/x86/xen/pci-swiotlb.c-org      2010-02-01 23:04:42.000000000 +0100
+++ arch/x86/xen/pci-swiotlb.c  2010-02-01 23:20:42.000000000 +0100
@@ -602,7 +602,7 @@ xen_swiotlb_alloc_coherent(struct device
        ret = (void *)vstart;

        if (hwdev != NULL && hwdev->coherent_dma_mask)
-               mask = hwdev->coherent_dma_mask;
+               mask = dma_alloc_coherent_mask(hwdev, flags);
        else
                mask = DMA_BIT_MASK(32);

[-- Attachment #2: swiotlb-32bit-range.patch --]
[-- Type: application/octet-stream, Size: 396 bytes --]

--- arch/x86/xen/pci-swiotlb.c-org	2010-02-01 23:04:42.000000000 +0100
+++ arch/x86/xen/pci-swiotlb.c	2010-02-01 23:20:42.000000000 +0100
@@ -602,7 +602,7 @@ xen_swiotlb_alloc_coherent(struct device
 	ret = (void *)vstart;
 
 	if (hwdev != NULL && hwdev->coherent_dma_mask)
-		mask = hwdev->coherent_dma_mask;
+		mask = dma_alloc_coherent_mask(hwdev, flags);
 	else
 		mask = DMA_BIT_MASK(32);
 

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

                 reply	other threads:[~2010-02-01 21:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=28767599.3850891265059811952.JavaMail.servlet@kundenserver \
    --to=ronny.hegewald@online.de \
    --cc=jeremy@goop.org \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.