All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] vhost: drop vring dependency on iotlb
@ 2020-04-02 14:12 Michael S. Tsirkin
  2020-04-02 14:28 ` Jason Wang
  2020-04-03 15:22 ` kbuild test robot
  0 siblings, 2 replies; 5+ messages in thread
From: Michael S. Tsirkin @ 2020-04-02 14:12 UTC (permalink / raw)
  To: linux-kernel; +Cc: Jason Wang, virtualization, kvm, netdev

vringh can now be built without IOTLB.
Select IOTLB directly where it's used.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---

This is on top of my previous patch (in vhost tree now).

 drivers/vdpa/Kconfig  | 1 +
 drivers/vhost/Kconfig | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/vdpa/Kconfig b/drivers/vdpa/Kconfig
index 7db1460104b7..08b615f2da39 100644
--- a/drivers/vdpa/Kconfig
+++ b/drivers/vdpa/Kconfig
@@ -17,6 +17,7 @@ config VDPA_SIM
 	depends on RUNTIME_TESTING_MENU
 	select VDPA
 	select VHOST_RING
+	select VHOST_IOTLB
 	default n
 	help
 	  vDPA networking device simulator which loop TX traffic back
diff --git a/drivers/vhost/Kconfig b/drivers/vhost/Kconfig
index 21feea0d69c9..bdd270fede26 100644
--- a/drivers/vhost/Kconfig
+++ b/drivers/vhost/Kconfig
@@ -6,7 +6,6 @@ config VHOST_IOTLB
 
 config VHOST_RING
 	tristate
-	select VHOST_IOTLB
 	help
 	  This option is selected by any driver which needs to access
 	  the host side of a virtio ring.
-- 
MST


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

* Re: [PATCH] vhost: drop vring dependency on iotlb
  2020-04-02 14:12 [PATCH] vhost: drop vring dependency on iotlb Michael S. Tsirkin
@ 2020-04-02 14:28 ` Jason Wang
  2020-04-02 14:36   ` Michael S. Tsirkin
  2020-04-03 15:22 ` kbuild test robot
  1 sibling, 1 reply; 5+ messages in thread
From: Jason Wang @ 2020-04-02 14:28 UTC (permalink / raw)
  To: Michael S. Tsirkin, linux-kernel; +Cc: virtualization, kvm, netdev


On 2020/4/2 下午10:12, Michael S. Tsirkin wrote:
> vringh can now be built without IOTLB.
> Select IOTLB directly where it's used.
>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ---
>
> This is on top of my previous patch (in vhost tree now).
>
>   drivers/vdpa/Kconfig  | 1 +
>   drivers/vhost/Kconfig | 1 -
>   2 files changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/vdpa/Kconfig b/drivers/vdpa/Kconfig
> index 7db1460104b7..08b615f2da39 100644
> --- a/drivers/vdpa/Kconfig
> +++ b/drivers/vdpa/Kconfig
> @@ -17,6 +17,7 @@ config VDPA_SIM
>   	depends on RUNTIME_TESTING_MENU
>   	select VDPA
>   	select VHOST_RING
> +	select VHOST_IOTLB
>   	default n
>   	help
>   	  vDPA networking device simulator which loop TX traffic back
> diff --git a/drivers/vhost/Kconfig b/drivers/vhost/Kconfig
> index 21feea0d69c9..bdd270fede26 100644
> --- a/drivers/vhost/Kconfig
> +++ b/drivers/vhost/Kconfig
> @@ -6,7 +6,6 @@ config VHOST_IOTLB
>   
>   config VHOST_RING
>   	tristate
> -	select VHOST_IOTLB
>   	help
>   	  This option is selected by any driver which needs to access
>   	  the host side of a virtio ring.


Do we need to mention driver need to select VHOST_IOTLB by itself here?

Thanks




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

* Re: [PATCH] vhost: drop vring dependency on iotlb
  2020-04-02 14:28 ` Jason Wang
@ 2020-04-02 14:36   ` Michael S. Tsirkin
  2020-04-02 14:59     ` Jason Wang
  0 siblings, 1 reply; 5+ messages in thread
From: Michael S. Tsirkin @ 2020-04-02 14:36 UTC (permalink / raw)
  To: Jason Wang; +Cc: linux-kernel, virtualization, kvm, netdev

On Thu, Apr 02, 2020 at 10:28:28PM +0800, Jason Wang wrote:
> 
> On 2020/4/2 下午10:12, Michael S. Tsirkin wrote:
> > vringh can now be built without IOTLB.
> > Select IOTLB directly where it's used.
> > 
> > Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> > ---
> > 
> > This is on top of my previous patch (in vhost tree now).
> > 
> >   drivers/vdpa/Kconfig  | 1 +
> >   drivers/vhost/Kconfig | 1 -
> >   2 files changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/vdpa/Kconfig b/drivers/vdpa/Kconfig
> > index 7db1460104b7..08b615f2da39 100644
> > --- a/drivers/vdpa/Kconfig
> > +++ b/drivers/vdpa/Kconfig
> > @@ -17,6 +17,7 @@ config VDPA_SIM
> >   	depends on RUNTIME_TESTING_MENU
> >   	select VDPA
> >   	select VHOST_RING
> > +	select VHOST_IOTLB
> >   	default n
> >   	help
> >   	  vDPA networking device simulator which loop TX traffic back
> > diff --git a/drivers/vhost/Kconfig b/drivers/vhost/Kconfig
> > index 21feea0d69c9..bdd270fede26 100644
> > --- a/drivers/vhost/Kconfig
> > +++ b/drivers/vhost/Kconfig
> > @@ -6,7 +6,6 @@ config VHOST_IOTLB
> >   config VHOST_RING
> >   	tristate
> > -	select VHOST_IOTLB
> >   	help
> >   	  This option is selected by any driver which needs to access
> >   	  the host side of a virtio ring.
> 
> 
> Do we need to mention driver need to select VHOST_IOTLB by itself here?
> 
> Thanks
> 

OK but I guess it's best to do it near where VHOST_IOTLB is defined.
Like this?


diff --git a/drivers/vhost/Kconfig b/drivers/vhost/Kconfig
index bdd270fede26..ce51126f51e7 100644
--- a/drivers/vhost/Kconfig
+++ b/drivers/vhost/Kconfig
@@ -3,6 +3,8 @@ config VHOST_IOTLB
 	tristate
 	help
 	  Generic IOTLB implementation for vhost and vringh.
+	  This option is selected by any driver which needs to support
+	  an IOMMU in software.
 
 config VHOST_RING
 	tristate


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

* Re: [PATCH] vhost: drop vring dependency on iotlb
  2020-04-02 14:36   ` Michael S. Tsirkin
@ 2020-04-02 14:59     ` Jason Wang
  0 siblings, 0 replies; 5+ messages in thread
From: Jason Wang @ 2020-04-02 14:59 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: linux-kernel, virtualization, kvm, netdev


On 2020/4/2 下午10:36, Michael S. Tsirkin wrote:
> On Thu, Apr 02, 2020 at 10:28:28PM +0800, Jason Wang wrote:
>> On 2020/4/2 下午10:12, Michael S. Tsirkin wrote:
>>> vringh can now be built without IOTLB.
>>> Select IOTLB directly where it's used.
>>>
>>> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
>>> ---
>>>
>>> This is on top of my previous patch (in vhost tree now).
>>>
>>>    drivers/vdpa/Kconfig  | 1 +
>>>    drivers/vhost/Kconfig | 1 -
>>>    2 files changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/vdpa/Kconfig b/drivers/vdpa/Kconfig
>>> index 7db1460104b7..08b615f2da39 100644
>>> --- a/drivers/vdpa/Kconfig
>>> +++ b/drivers/vdpa/Kconfig
>>> @@ -17,6 +17,7 @@ config VDPA_SIM
>>>    	depends on RUNTIME_TESTING_MENU
>>>    	select VDPA
>>>    	select VHOST_RING
>>> +	select VHOST_IOTLB
>>>    	default n
>>>    	help
>>>    	  vDPA networking device simulator which loop TX traffic back
>>> diff --git a/drivers/vhost/Kconfig b/drivers/vhost/Kconfig
>>> index 21feea0d69c9..bdd270fede26 100644
>>> --- a/drivers/vhost/Kconfig
>>> +++ b/drivers/vhost/Kconfig
>>> @@ -6,7 +6,6 @@ config VHOST_IOTLB
>>>    config VHOST_RING
>>>    	tristate
>>> -	select VHOST_IOTLB
>>>    	help
>>>    	  This option is selected by any driver which needs to access
>>>    	  the host side of a virtio ring.
>>
>> Do we need to mention driver need to select VHOST_IOTLB by itself here?
>>
>> Thanks
>>
> OK but I guess it's best to do it near where VHOST_IOTLB is defined.
> Like this?
>
>
> diff --git a/drivers/vhost/Kconfig b/drivers/vhost/Kconfig
> index bdd270fede26..ce51126f51e7 100644
> --- a/drivers/vhost/Kconfig
> +++ b/drivers/vhost/Kconfig
> @@ -3,6 +3,8 @@ config VHOST_IOTLB
>   	tristate
>   	help
>   	  Generic IOTLB implementation for vhost and vringh.
> +	  This option is selected by any driver which needs to support
> +	  an IOMMU in software.
>   
>   config VHOST_RING
>   	tristate
>

Yes, probably.

Thanks



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

* Re: [PATCH] vhost: drop vring dependency on iotlb
  2020-04-02 14:12 [PATCH] vhost: drop vring dependency on iotlb Michael S. Tsirkin
  2020-04-02 14:28 ` Jason Wang
@ 2020-04-03 15:22 ` kbuild test robot
  1 sibling, 0 replies; 5+ messages in thread
From: kbuild test robot @ 2020-04-03 15:22 UTC (permalink / raw)
  To: kbuild-all

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

Hi "Michael,

I love your patch! Yet something to improve:

[auto build test ERROR on vhost/linux-next]
[also build test ERROR on next-20200403]
[cannot apply to linus/master linux/master v5.6]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Michael-S-Tsirkin/vhost-drop-vring-dependency-on-iotlb/20200403-203000
base:   https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git linux-next
config: s390-randconfig-a001-20200403 (attached as .config)
compiler: s390-linux-gcc (GCC) 9.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=9.3.0 make.cross ARCH=s390 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   s390-linux-ld: drivers/vhost/vringh.o: in function `iotlb_translate':
>> drivers/vhost/vringh.c:1079: undefined reference to `vhost_iotlb_itree_first'

vim +1079 drivers/vhost/vringh.c

f558a845c3a043d Dave Jones 2013-05-03  1061  
9ad9c49cfe970b0 Jason Wang 2020-03-26  1062  static int iotlb_translate(const struct vringh *vrh,
9ad9c49cfe970b0 Jason Wang 2020-03-26  1063  			   u64 addr, u64 len, struct bio_vec iov[],
9ad9c49cfe970b0 Jason Wang 2020-03-26  1064  			   int iov_size, u32 perm)
9ad9c49cfe970b0 Jason Wang 2020-03-26  1065  {
9ad9c49cfe970b0 Jason Wang 2020-03-26  1066  	struct vhost_iotlb_map *map;
9ad9c49cfe970b0 Jason Wang 2020-03-26  1067  	struct vhost_iotlb *iotlb = vrh->iotlb;
9ad9c49cfe970b0 Jason Wang 2020-03-26  1068  	int ret = 0;
9ad9c49cfe970b0 Jason Wang 2020-03-26  1069  	u64 s = 0;
9ad9c49cfe970b0 Jason Wang 2020-03-26  1070  
9ad9c49cfe970b0 Jason Wang 2020-03-26  1071  	while (len > s) {
9ad9c49cfe970b0 Jason Wang 2020-03-26  1072  		u64 size, pa, pfn;
9ad9c49cfe970b0 Jason Wang 2020-03-26  1073  
9ad9c49cfe970b0 Jason Wang 2020-03-26  1074  		if (unlikely(ret >= iov_size)) {
9ad9c49cfe970b0 Jason Wang 2020-03-26  1075  			ret = -ENOBUFS;
9ad9c49cfe970b0 Jason Wang 2020-03-26  1076  			break;
9ad9c49cfe970b0 Jason Wang 2020-03-26  1077  		}
9ad9c49cfe970b0 Jason Wang 2020-03-26  1078  
9ad9c49cfe970b0 Jason Wang 2020-03-26 @1079  		map = vhost_iotlb_itree_first(iotlb, addr,
9ad9c49cfe970b0 Jason Wang 2020-03-26  1080  					      addr + len - 1);
9ad9c49cfe970b0 Jason Wang 2020-03-26  1081  		if (!map || map->start > addr) {
9ad9c49cfe970b0 Jason Wang 2020-03-26  1082  			ret = -EINVAL;
9ad9c49cfe970b0 Jason Wang 2020-03-26  1083  			break;
9ad9c49cfe970b0 Jason Wang 2020-03-26  1084  		} else if (!(map->perm & perm)) {
9ad9c49cfe970b0 Jason Wang 2020-03-26  1085  			ret = -EPERM;
9ad9c49cfe970b0 Jason Wang 2020-03-26  1086  			break;
9ad9c49cfe970b0 Jason Wang 2020-03-26  1087  		}
9ad9c49cfe970b0 Jason Wang 2020-03-26  1088  
9ad9c49cfe970b0 Jason Wang 2020-03-26  1089  		size = map->size - addr + map->start;
9ad9c49cfe970b0 Jason Wang 2020-03-26  1090  		pa = map->addr + addr - map->start;
9ad9c49cfe970b0 Jason Wang 2020-03-26  1091  		pfn = pa >> PAGE_SHIFT;
9ad9c49cfe970b0 Jason Wang 2020-03-26  1092  		iov[ret].bv_page = pfn_to_page(pfn);
9ad9c49cfe970b0 Jason Wang 2020-03-26  1093  		iov[ret].bv_len = min(len - s, size);
9ad9c49cfe970b0 Jason Wang 2020-03-26  1094  		iov[ret].bv_offset = pa & (PAGE_SIZE - 1);
9ad9c49cfe970b0 Jason Wang 2020-03-26  1095  		s += size;
9ad9c49cfe970b0 Jason Wang 2020-03-26  1096  		addr += size;
9ad9c49cfe970b0 Jason Wang 2020-03-26  1097  		++ret;
9ad9c49cfe970b0 Jason Wang 2020-03-26  1098  	}
9ad9c49cfe970b0 Jason Wang 2020-03-26  1099  
9ad9c49cfe970b0 Jason Wang 2020-03-26  1100  	return ret;
9ad9c49cfe970b0 Jason Wang 2020-03-26  1101  }
9ad9c49cfe970b0 Jason Wang 2020-03-26  1102  

:::::: The code at line 1079 was first introduced by commit
:::::: 9ad9c49cfe970b053bb0ef323b682dd1b4d4f8a0 vringh: IOTLB support

:::::: TO: Jason Wang <jasowang@redhat.com>
:::::: CC: Michael S. Tsirkin <mst@redhat.com>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 23597 bytes --]

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

end of thread, other threads:[~2020-04-03 15:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-02 14:12 [PATCH] vhost: drop vring dependency on iotlb Michael S. Tsirkin
2020-04-02 14:28 ` Jason Wang
2020-04-02 14:36   ` Michael S. Tsirkin
2020-04-02 14:59     ` Jason Wang
2020-04-03 15:22 ` kbuild test robot

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.