kernel-ark/drivers/xen
Ronny Hegewald b5031ed1be xen: Use correct masking in xen_swiotlb_alloc_coherent.
When running 32-bit pvops-dom0 and a driver tries to allocate a coherent
DMA-memory the xen swiotlb-implementation returned memory beyond 4GB.

The underlaying reason is that if the supplied driver passes in a
DMA_BIT_MASK(64) ( hwdev->coherent_dma_mask is set to 0xffffffffffffffff)
our dma_mask will be u64 set to 0xffffffffffffffff even if we set it to
DMA_BIT_MASK(32) previously. Meaning we do not reset the upper bits.
By using the dma_alloc_coherent_mask function - it does the proper casting
and we get 0xfffffffff.

This caused 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.

This patch adds the same functionality to xen swiotlb and is a rebase of the
original patch from Ronny Hegewald which never got upstream b/c the
underlaying reason was not understood until now.

The original email with the original patch is in:
http://old-list-archives.xen.org/archives/html/xen-devel/2010-02/msg00038.html
the original thread from where the discussion started is in:
http://old-list-archives.xen.org/archives/html/xen-devel/2010-01/msg00928.html

Signed-off-by: Ronny Hegewald <ronny.hegewald@online.de>
Signed-off-by: Stefano Panella <stefano.panella@citrix.com>
Acked-By: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
CC: stable@vger.kernel.org
2012-09-05 10:50:27 -04:00
..
xen-pciback PCI: create common pcibios_err_to_errno 2012-06-12 09:21:42 -06:00
xenbus xen/pv-on-hvm kexec: shutdown watches from old kernel 2012-07-19 15:52:02 -04:00
xenfs xen: Add xenbus device driver 2011-12-16 13:29:39 -05:00
acpi.c xen/acpi/sleep: Enable ACPI sleep via the __acpi_os_prepare_sleep 2012-05-07 15:33:18 -04:00
balloon.c xen/balloon: Avoid OOM when requesting highmem 2011-11-16 12:13:43 -05:00
biomerge.c xen: using EXPORT_SYMBOL requires including export.h 2012-01-18 15:37:49 -08:00
cpu_hotplug.c xen/bootup: During bootup suppress XENBUS: Unable to read cpu state 2012-02-03 16:05:30 -05:00
events.c Five bug-fixes: 2012-06-15 17:17:15 -07:00
evtchn.c xen/event: Add reference counting to event channels 2011-11-21 17:14:48 -05:00
features.c
gntalloc.c xen-gntalloc: introduce missing kfree 2012-01-03 13:39:04 -05:00
gntdev.c xen/gntdev: do not set VM_PFNMAP 2012-04-17 13:27:17 -04:00
grant-table.c Features: 2012-05-24 16:02:08 -07:00
Kconfig xen/mce: Add mcelog support for Xen platform 2012-07-19 15:51:36 -04:00
Makefile xen/pcpu: Xen physical cpus online/offline sys interface 2012-07-19 15:51:39 -04:00
manage.c xen/resume: Fix compile warnings. 2012-04-19 15:12:49 -04:00
mcelog.c xen/mce: add .poll method for mcelog device driver 2012-07-19 15:51:41 -04:00
pci.c xen/pci: Check for PCI bridge before using it. 2012-05-30 10:16:35 -04:00
pcpu.c xen/pcpu: Xen physical cpus online/offline sys interface 2012-07-19 15:51:39 -04:00
platform-pci.c Revert "xen PVonHVM: move shared_info to MMIO before kexec" 2012-08-16 13:05:25 -04:00
privcmd.c xen/privcmd: Remove unused support for arch specific privcmp mmap 2011-12-16 13:29:42 -05:00
privcmd.h xen: Add privcmd device driver 2011-12-16 13:29:31 -05:00
swiotlb-xen.c xen: Use correct masking in xen_swiotlb_alloc_coherent. 2012-09-05 10:50:27 -04:00
sys-hypervisor.c xen: constify all instances of "struct attribute_group" 2012-03-14 12:34:19 -04:00
tmem.c frontswap: s/put_page/store/g s/get_page/load 2012-05-15 11:34:08 -04:00
xen-acpi-processor.c xen/acpi: Fix potential memory leak. 2012-07-19 15:51:42 -04:00
xen-balloon.c Features: 2012-03-22 20:16:14 -07:00
xen-selfballoon.c xen: Add selfballoning memory reservation tunable. 2012-05-21 10:52:53 -04:00
xencomm.c