virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] vdpa-sim: depend on HAS_DMA
@ 2020-04-05  8:14 Michael S. Tsirkin
  2020-04-06  0:34 ` Jason Wang
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Michael S. Tsirkin @ 2020-04-05  8:14 UTC (permalink / raw)
  To: linux-kernel; +Cc: virtualization

set_dma_ops isn't available on all architectures:

        make ARCH=um
...

   drivers/vdpa/vdpa_sim/vdpa_sim.c: In function 'vdpasim_create':
>> drivers/vdpa/vdpa_sim/vdpa_sim.c:324:2: error: implicit declaration of function 'set_dma_ops'; did you mean 'set_groups'?
+[-Werror=implicit-function-declaration]
     set_dma_ops(dev, &vdpasim_dma_ops);
     ^~~~~~~~~~~
     set_groups

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 drivers/vdpa/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/vdpa/Kconfig b/drivers/vdpa/Kconfig
index 08b615f2da39..d0cb0e583a5d 100644
--- a/drivers/vdpa/Kconfig
+++ b/drivers/vdpa/Kconfig
@@ -14,7 +14,7 @@ if VDPA_MENU
 
 config VDPA_SIM
 	tristate "vDPA device simulator"
-	depends on RUNTIME_TESTING_MENU
+	depends on RUNTIME_TESTING_MENU && HAS_DMA
 	select VDPA
 	select VHOST_RING
 	select VHOST_IOTLB
-- 
MST

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] vdpa-sim: depend on HAS_DMA
  2020-04-05  8:14 [PATCH] vdpa-sim: depend on HAS_DMA Michael S. Tsirkin
@ 2020-04-06  0:34 ` Jason Wang
  2020-04-06 13:09 ` Christoph Hellwig
  2020-04-10  9:51 ` Geert Uytterhoeven
  2 siblings, 0 replies; 7+ messages in thread
From: Jason Wang @ 2020-04-06  0:34 UTC (permalink / raw)
  To: Michael S. Tsirkin, linux-kernel; +Cc: virtualization


On 2020/4/5 下午4:14, Michael S. Tsirkin wrote:
> set_dma_ops isn't available on all architectures:
>
>          make ARCH=um
> ...
>
>     drivers/vdpa/vdpa_sim/vdpa_sim.c: In function 'vdpasim_create':
>>> drivers/vdpa/vdpa_sim/vdpa_sim.c:324:2: error: implicit declaration of function 'set_dma_ops'; did you mean 'set_groups'?
> +[-Werror=implicit-function-declaration]
>       set_dma_ops(dev, &vdpasim_dma_ops);
>       ^~~~~~~~~~~
>       set_groups
>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ---
>   drivers/vdpa/Kconfig | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/vdpa/Kconfig b/drivers/vdpa/Kconfig
> index 08b615f2da39..d0cb0e583a5d 100644
> --- a/drivers/vdpa/Kconfig
> +++ b/drivers/vdpa/Kconfig
> @@ -14,7 +14,7 @@ if VDPA_MENU
>   
>   config VDPA_SIM
>   	tristate "vDPA device simulator"
> -	depends on RUNTIME_TESTING_MENU
> +	depends on RUNTIME_TESTING_MENU && HAS_DMA
>   	select VDPA
>   	select VHOST_RING
>   	select VHOST_IOTLB


Acked-by: Jason Wang <jasowang@redhat.com>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] vdpa-sim: depend on HAS_DMA
  2020-04-05  8:14 [PATCH] vdpa-sim: depend on HAS_DMA Michael S. Tsirkin
  2020-04-06  0:34 ` Jason Wang
@ 2020-04-06 13:09 ` Christoph Hellwig
  2020-04-06 14:02   ` Michael S. Tsirkin
  2020-04-10  9:51 ` Geert Uytterhoeven
  2 siblings, 1 reply; 7+ messages in thread
From: Christoph Hellwig @ 2020-04-06 13:09 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: linux-kernel, Jason Wang, virtualization

Pleae just drop the code - we should not add new drivers with custom
DMA ops.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] vdpa-sim: depend on HAS_DMA
  2020-04-06 13:09 ` Christoph Hellwig
@ 2020-04-06 14:02   ` Michael S. Tsirkin
  2020-04-06 14:12     ` Jason Wang
  0 siblings, 1 reply; 7+ messages in thread
From: Michael S. Tsirkin @ 2020-04-06 14:02 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: linux-kernel, Jason Wang, virtualization

On Mon, Apr 06, 2020 at 06:09:27AM -0700, Christoph Hellwig wrote:
> Pleae just drop the code - we should not add new drivers with custom
> DMA ops.

I'm not sure there's another way to do this: this not a driver, it's a
software emulator that pretends to be an actual device. We can't
have the platform supply DMA ops here since the platform is a regular
x86 or whatever.

-- 
MST

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] vdpa-sim: depend on HAS_DMA
  2020-04-06 14:02   ` Michael S. Tsirkin
@ 2020-04-06 14:12     ` Jason Wang
  2020-04-06 15:50       ` Michael S. Tsirkin
  0 siblings, 1 reply; 7+ messages in thread
From: Jason Wang @ 2020-04-06 14:12 UTC (permalink / raw)
  To: Michael S. Tsirkin, Christoph Hellwig; +Cc: linux-kernel, virtualization


On 2020/4/6 下午10:02, Michael S. Tsirkin wrote:
> On Mon, Apr 06, 2020 at 06:09:27AM -0700, Christoph Hellwig wrote:
>> Pleae just drop the code - we should not add new drivers with custom
>> DMA ops.
> I'm not sure there's another way to do this: this not a driver, it's a
> software emulator that pretends to be an actual device. We can't
> have the platform supply DMA ops here since the platform is a regular
> x86 or whatever.


Yes, actually vdpa-sim does not depends on HAS_DMA. Maybe we can do 
shortcut like dev->dma_ops = vdpasim_dma_ops;

Thanks


>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] vdpa-sim: depend on HAS_DMA
  2020-04-06 14:12     ` Jason Wang
@ 2020-04-06 15:50       ` Michael S. Tsirkin
  0 siblings, 0 replies; 7+ messages in thread
From: Michael S. Tsirkin @ 2020-04-06 15:50 UTC (permalink / raw)
  To: Jason Wang; +Cc: Christoph Hellwig, linux-kernel, virtualization

On Mon, Apr 06, 2020 at 10:12:56PM +0800, Jason Wang wrote:
> 
> On 2020/4/6 下午10:02, Michael S. Tsirkin wrote:
> > On Mon, Apr 06, 2020 at 06:09:27AM -0700, Christoph Hellwig wrote:
> > > Pleae just drop the code - we should not add new drivers with custom
> > > DMA ops.
> > I'm not sure there's another way to do this: this not a driver, it's a
> > software emulator that pretends to be an actual device. We can't
> > have the platform supply DMA ops here since the platform is a regular
> > x86 or whatever.
> 
> 
> Yes, actually vdpa-sim does not depends on HAS_DMA. Maybe we can do shortcut
> like dev->dma_ops = vdpasim_dma_ops;
> 
> Thanks
> 

We can do that - does it them actually work - and not just compile?

-- 
MST

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] vdpa-sim: depend on HAS_DMA
  2020-04-05  8:14 [PATCH] vdpa-sim: depend on HAS_DMA Michael S. Tsirkin
  2020-04-06  0:34 ` Jason Wang
  2020-04-06 13:09 ` Christoph Hellwig
@ 2020-04-10  9:51 ` Geert Uytterhoeven
  2 siblings, 0 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2020-04-10  9:51 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: Linux Kernel Mailing List, Jason Wang, virtualization,
	Christoph Hellwig

Hi Michael,

On Sun, Apr 5, 2020 at 10:17 AM Michael S. Tsirkin <mst@redhat.com> wrote:
>
> set_dma_ops isn't available on all architectures:
>
>         make ARCH=um
> ...
>
>    drivers/vdpa/vdpa_sim/vdpa_sim.c: In function 'vdpasim_create':
> >> drivers/vdpa/vdpa_sim/vdpa_sim.c:324:2: error: implicit declaration of function 'set_dma_ops'; did you mean 'set_groups'?
> +[-Werror=implicit-function-declaration]
>      set_dma_ops(dev, &vdpasim_dma_ops);
>      ^~~~~~~~~~~
>      set_groups
>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

As this fixes the Sun-3 all{mod,yes}-config build, which has NO_DMA=y:
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>

However, you may want to follow Christoph's suggestion instead.

> --- a/drivers/vdpa/Kconfig
> +++ b/drivers/vdpa/Kconfig
> @@ -14,7 +14,7 @@ if VDPA_MENU
>
>  config VDPA_SIM
>         tristate "vDPA device simulator"
> -       depends on RUNTIME_TESTING_MENU
> +       depends on RUNTIME_TESTING_MENU && HAS_DMA
>         select VDPA
>         select VHOST_RING
>         select VHOST_IOTLB

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-04-10  9:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-05  8:14 [PATCH] vdpa-sim: depend on HAS_DMA Michael S. Tsirkin
2020-04-06  0:34 ` Jason Wang
2020-04-06 13:09 ` Christoph Hellwig
2020-04-06 14:02   ` Michael S. Tsirkin
2020-04-06 14:12     ` Jason Wang
2020-04-06 15:50       ` Michael S. Tsirkin
2020-04-10  9:51 ` Geert Uytterhoeven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).