All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] vhost: drop vring dependency on iotlb
@ 2020-04-02 14:46 Michael S. Tsirkin
  2020-04-02 15:01 ` Jason Wang
  2020-04-13 15:31 ` kbuild test robot
  0 siblings, 2 replies; 5+ messages in thread
From: Michael S. Tsirkin @ 2020-04-02 14:46 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>
---

Applies on top of my vhost tree.
Changes from v1:
	VDPA_SIM needs VHOST_IOTLB

 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 f0404ce255d1..cb6b17323eb2 100644
--- a/drivers/vhost/Kconfig
+++ b/drivers/vhost/Kconfig
@@ -8,7 +8,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 v2] vhost: drop vring dependency on iotlb
  2020-04-02 14:46 [PATCH v2] vhost: drop vring dependency on iotlb Michael S. Tsirkin
@ 2020-04-02 15:01 ` Jason Wang
  2020-04-02 16:27   ` Michael S. Tsirkin
  2020-04-13 15:31 ` kbuild test robot
  1 sibling, 1 reply; 5+ messages in thread
From: Jason Wang @ 2020-04-02 15:01 UTC (permalink / raw)
  To: Michael S. Tsirkin, linux-kernel; +Cc: virtualization, kvm, netdev


On 2020/4/2 下午10:46, 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>
> ---
>
> Applies on top of my vhost tree.
> Changes from v1:
> 	VDPA_SIM needs VHOST_IOTLB


It looks to me the patch is identical to v1.

Thanks


>
>   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 f0404ce255d1..cb6b17323eb2 100644
> --- a/drivers/vhost/Kconfig
> +++ b/drivers/vhost/Kconfig
> @@ -8,7 +8,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.

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

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

On Thu, Apr 02, 2020 at 11:01:13PM +0800, Jason Wang wrote:
> 
> On 2020/4/2 下午10:46, 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>
> > ---
> > 
> > Applies on top of my vhost tree.
> > Changes from v1:
> > 	VDPA_SIM needs VHOST_IOTLB
> 
> 
> It looks to me the patch is identical to v1.
> 
> Thanks


you are right. I squashed the description into
    virtio/test: fix up after IOTLB changes
take a look at it in the vhost tree.

> 
> > 
> >   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 f0404ce255d1..cb6b17323eb2 100644
> > --- a/drivers/vhost/Kconfig
> > +++ b/drivers/vhost/Kconfig
> > @@ -8,7 +8,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.

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

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


On 2020/4/3 上午12:27, Michael S. Tsirkin wrote:
> On Thu, Apr 02, 2020 at 11:01:13PM +0800, Jason Wang wrote:
>> On 2020/4/2 下午10:46, 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>
>>> ---
>>>
>>> Applies on top of my vhost tree.
>>> Changes from v1:
>>> 	VDPA_SIM needs VHOST_IOTLB
>> It looks to me the patch is identical to v1.
>>
>> Thanks
> you are right. I squashed the description into
>      virtio/test: fix up after IOTLB changes
> take a look at it in the vhost tree.


Looks fine.

Thanks


>

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

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

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

Hi "Michael,

I love your patch! Yet something to improve:

[auto build test ERROR on vhost/linux-next]
[also build test ERROR on linus/master v5.7-rc1]
[cannot apply to linux/master next-20200413]
[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-234646
base:   https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git linux-next
config: sparc-randconfig-a001-20200413 (attached as .config)
compiler: sparc-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=sparc 

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

All errors (new ones prefixed by >>):

   arch/sparc/kernel/head_32.o: in function `current_pc':
   arch/sparc/kernel/head_32.S:121:(.head.text+0x2040): relocation truncated to fit: R_SPARC_WDISP22 against `.init.text'
   arch/sparc/kernel/head_32.o: in function `halt_notsup':
   arch/sparc/kernel/head_32.S:198:(.head.text+0x2100): relocation truncated to fit: R_SPARC_WDISP22 against `.init.text'
   arch/sparc/kernel/process_32.o:(.fixup+0x4): relocation truncated to fit: R_SPARC_WDISP22 against `.text'
   arch/sparc/kernel/process_32.o:(.fixup+0xc): relocation truncated to fit: R_SPARC_WDISP22 against `.text'
   arch/sparc/kernel/signal_32.o:(.fixup+0x0): relocation truncated to fit: R_SPARC_WDISP22 against `.text'
   arch/sparc/kernel/signal_32.o:(.fixup+0x8): relocation truncated to fit: R_SPARC_WDISP22 against `.text'
   arch/sparc/kernel/signal_32.o:(.fixup+0x10): relocation truncated to fit: R_SPARC_WDISP22 against `.text'
   arch/sparc/kernel/signal_32.o:(.fixup+0x18): relocation truncated to fit: R_SPARC_WDISP22 against `.text'
   arch/sparc/kernel/signal_32.o:(.fixup+0x20): relocation truncated to fit: R_SPARC_WDISP22 against `.text'
   arch/sparc/kernel/signal_32.o:(.fixup+0x28): relocation truncated to fit: R_SPARC_WDISP22 against `.text'
   arch/sparc/kernel/signal_32.o:(.fixup+0x30): additional relocation overflows omitted from the output
   sparc-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

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

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

end of thread, other threads:[~2020-04-13 15:31 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:46 [PATCH v2] vhost: drop vring dependency on iotlb Michael S. Tsirkin
2020-04-02 15:01 ` Jason Wang
2020-04-02 16:27   ` Michael S. Tsirkin
2020-04-03  6:38     ` Jason Wang
2020-04-13 15:31 ` 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.