diff mbox series

um: use asm-generic/dma-mapping.h

Message ID 20220328094625.662ac14072bc.I1a0d087aeafbbf363b49f149371d67677a33544f@changeid
State Accepted
Headers show
Series um: use asm-generic/dma-mapping.h | expand

Commit Message

Johannes Berg March 28, 2022, 7:46 a.m. UTC
From: Johannes Berg <johannes.berg@intel.com>

If DMA (PCI over virtio) is enabled, then some drivers may
enable CONFIG_DMA_OPS as well, and then we pull in the x86
definition of get_arch_dma_ops(), which uses the dma_ops
symbol, which isn't defined.

Since we don't have real DMA ops nor any kind of IOMMU fix
this in the simplest possible way: pull in the asm-generic
file instead of inheriting the x86 one. It's not clear why
those drivers that do (e.g. VDPA) "select DMA_OPS", and if
they'd even work with this, but chances are nobody will be
wanting to do that anyway, so fixing the build failure is
good enough.

Reported-by: Randy Dunlap <rdunlap@infradead.org>
Fixes: 68f5d3f3b654 ("um: add PCI over virtio emulation driver")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 arch/um/include/asm/Kbuild | 1 +
 1 file changed, 1 insertion(+)

Comments

Randy Dunlap March 28, 2022, 2:59 p.m. UTC | #1
On 3/28/22 00:46, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@intel.com>
> 
> If DMA (PCI over virtio) is enabled, then some drivers may
> enable CONFIG_DMA_OPS as well, and then we pull in the x86
> definition of get_arch_dma_ops(), which uses the dma_ops
> symbol, which isn't defined.
> 
> Since we don't have real DMA ops nor any kind of IOMMU fix
> this in the simplest possible way: pull in the asm-generic
> file instead of inheriting the x86 one. It's not clear why
> those drivers that do (e.g. VDPA) "select DMA_OPS", and if
> they'd even work with this, but chances are nobody will be
> wanting to do that anyway, so fixing the build failure is
> good enough.
> 
> Reported-by: Randy Dunlap <rdunlap@infradead.org>
> Fixes: 68f5d3f3b654 ("um: add PCI over virtio emulation driver")
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Tested-by: Randy Dunlap <rdunlap@infradead.org>
Acked-by: Randy Dunlap <rdunlap@infradead.org>

thanks.

> ---
>  arch/um/include/asm/Kbuild | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/um/include/asm/Kbuild b/arch/um/include/asm/Kbuild
> index e5a7b552bb38..a8c763c296b4 100644
> --- a/arch/um/include/asm/Kbuild
> +++ b/arch/um/include/asm/Kbuild
> @@ -4,6 +4,7 @@ generic-y += bug.h
>  generic-y += compat.h
>  generic-y += current.h
>  generic-y += device.h
> +generic-y += dma-mapping.h
>  generic-y += emergency-restart.h
>  generic-y += exec.h
>  generic-y += extable.h
diff mbox series

Patch

diff --git a/arch/um/include/asm/Kbuild b/arch/um/include/asm/Kbuild
index e5a7b552bb38..a8c763c296b4 100644
--- a/arch/um/include/asm/Kbuild
+++ b/arch/um/include/asm/Kbuild
@@ -4,6 +4,7 @@  generic-y += bug.h
 generic-y += compat.h
 generic-y += current.h
 generic-y += device.h
+generic-y += dma-mapping.h
 generic-y += emergency-restart.h
 generic-y += exec.h
 generic-y += extable.h