Re: [PATCH 11/19] drivers/hv: set up synic pages for intercept messages

2021-05-28 Thread kernel test robot
Hi Nuno,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on asm-generic/master]
[also build test WARNING on tip/master linux/master linus/master v5.13-rc3 
next-20210528]
[cannot apply to tip/x86/core]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:
https://github.com/0day-ci/linux/commits/Nuno-Das-Neves/Microsoft-Hypervisor-root-partition-ioctl-interface/20210529-064549
base:   https://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic.git 
master
config: x86_64-randconfig-b001-20210528 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 
bc6799f2f79f0ae87e9f1ebf9d25ba799fbd25a9)
reproduce (this is a W=1 build):
wget 
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# 
https://github.com/0day-ci/linux/commit/2761f56915a9f31c98287f68fd2b286b7ec16d41
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review 
Nuno-Das-Neves/Microsoft-Hypervisor-root-partition-ioctl-interface/20210529-064549
git checkout 2761f56915a9f31c98287f68fd2b286b7ec16d41
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot 

All warnings (new ones prefixed by >>):

   In file included from :1:
   In file included from ./usr/include/linux/mshv.h:12:
>> ./usr/include/asm/hyperv-tlfs.h:751:14: warning: // comments are not allowed 
>> in this language [-Wcomment]
   __u8 cr8:4; // only set for exo partitions
   ^
   1 warning generated.

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


.config.gz
Description: application/gzip
___
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH 10/19] drivers/hv: get and set vcpu registers ioctls

2021-05-28 Thread kernel test robot
Hi Nuno,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on asm-generic/master]
[also build test WARNING on tip/master linux/master linus/master v5.13-rc3]
[cannot apply to tip/x86/core]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:
https://github.com/0day-ci/linux/commits/Nuno-Das-Neves/Microsoft-Hypervisor-root-partition-ioctl-interface/20210529-064549
base:   https://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic.git 
master
config: x86_64-randconfig-a016-20210528 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 
bc6799f2f79f0ae87e9f1ebf9d25ba799fbd25a9)
reproduce (this is a W=1 build):
wget 
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# 
https://github.com/0day-ci/linux/commit/a5aa61354fa03cbfdeac16d3f06e4a51a7119076
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review 
Nuno-Das-Neves/Microsoft-Hypervisor-root-partition-ioctl-interface/20210529-064549
git checkout a5aa61354fa03cbfdeac16d3f06e4a51a7119076
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot 

All warnings (new ones prefixed by >>):

>> usr/include/asm-generic/hyperv-tlfs.h:25: found __[us]{8,16,32,64} type 
>> without #include 

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


.config.gz
Description: application/gzip
___
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH 03/19] drivers/hv: minimal mshv module (/dev/mshv/)

2021-05-28 Thread Randy Dunlap
On 5/28/21 3:43 PM, Nuno Das Neves wrote:
> Introduce a barebones module file for the mshv API.
> Introduce CONFIG_HYPERV_ROOT_API for controlling compilation of mshv.
> 
> Co-developed-by: Lillian Grassin-Drake 
> Signed-off-by: Lillian Grassin-Drake 
> Signed-off-by: Nuno Das Neves 
> ---

Hi,

> diff --git a/drivers/hv/Kconfig b/drivers/hv/Kconfig
> index 66c794d92391..d618b1fab2bb 100644
> --- a/drivers/hv/Kconfig
> +++ b/drivers/hv/Kconfig
> @@ -27,4 +27,22 @@ config HYPERV_BALLOON
>   help
> Select this option to enable Hyper-V Balloon driver.
>  
> +config HYPERV_ROOT_API
> + tristate "Microsoft Hypervisor root partition interfaces: /dev/mshv"
> + depends on HYPERV
> + help
> +   Provides access to interfaces for managing guest virtual machines
> +   running under the Microsoft Hypervisor.
> +
> +   These interfaces will only work when Linux is running as root
> +   partition on the Microsoft Hypervisor.
> +
> +   The interfaces are provided via a device named /dev/mshv.
> +
> +   To compile this as a module, choose M here.
> +  The module is named mshv.

^

Please follow coding-style for Kconfig files:

(from Documentation/process/coding-style.rst, section 10):

For all of the Kconfig* configuration files throughout the source tree,
the indentation is somewhat different.  Lines under a ``config`` definition
are indented with one tab, while help text is indented an additional two
spaces.

> +
> +   If unsure, say N.
> +
> +
>  endmenu

thanks.
-- 
~Randy

___
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization


Re: [PATCH v3 1/4] virtio_net: move tx vq operation under tx queue lock

2021-05-28 Thread Willem de Bruijn
On Wed, May 26, 2021 at 11:41 PM Jason Wang  wrote:
>
>
> 在 2021/5/26 下午4:24, Michael S. Tsirkin 写道:
> > It's unsafe to operate a vq from multiple threads.
> > Unfortunately this is exactly what we do when invoking
> > clean tx poll from rx napi.
> > Same happens with napi-tx even without the
> > opportunistic cleaning from the receive interrupt: that races
> > with processing the vq in start_xmit.
> >
> > As a fix move everything that deals with the vq to under tx lock.

This patch also disables callbacks during free_old_xmit_skbs
processing on tx interrupt. Should that be a separate commit, with its
own explanation?
> >
> > Fixes: b92f1e6751a6 ("virtio-net: transmit napi")
> > Signed-off-by: Michael S. Tsirkin 
> > ---
> >   drivers/net/virtio_net.c | 22 +-
> >   1 file changed, 21 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> > index ac0c143f97b4..12512d1002ec 100644
> > --- a/drivers/net/virtio_net.c
> > +++ b/drivers/net/virtio_net.c
> > @@ -1508,6 +1508,8 @@ static int virtnet_poll_tx(struct napi_struct *napi, 
> > int budget)
> >   struct virtnet_info *vi = sq->vq->vdev->priv;
> >   unsigned int index = vq2txq(sq->vq);
> >   struct netdev_queue *txq;
> > + int opaque;
> > + bool done;
> >
> >   if (unlikely(is_xdp_raw_buffer_queue(vi, index))) {
> >   /* We don't need to enable cb for XDP */
> > @@ -1517,10 +1519,28 @@ static int virtnet_poll_tx(struct napi_struct 
> > *napi, int budget)
> >
> >   txq = netdev_get_tx_queue(vi->dev, index);
> >   __netif_tx_lock(txq, raw_smp_processor_id());
> > + virtqueue_disable_cb(sq->vq);
> >   free_old_xmit_skbs(sq, true);
> > +
> > + opaque = virtqueue_enable_cb_prepare(sq->vq);
> > +
> > + done = napi_complete_done(napi, 0);
> > +
> > + if (!done)
> > + virtqueue_disable_cb(sq->vq);
> > +
> >   __netif_tx_unlock(txq);
> >
> > - virtqueue_napi_complete(napi, sq->vq, 0);
> > + if (done) {
> > + if (unlikely(virtqueue_poll(sq->vq, opaque))) {

Should this also be inside the lock, as it operates on vq?

Is there anything that is not allowed to run with the lock held?

> > + if (napi_schedule_prep(napi)) {
> > + __netif_tx_lock(txq, raw_smp_processor_id());
> > + virtqueue_disable_cb(sq->vq);
> > + __netif_tx_unlock(txq);
> > + __napi_schedule(napi);
> > + }
> > + }
> > + }
>
>
> Interesting, this looks like somehwo a open-coded version of
> virtqueue_napi_complete(). I wonder if we can simply keep using
> virtqueue_napi_complete() by simply moving the __netif_tx_unlock() after
> that:
>
> netif_tx_lock(txq);
> free_old_xmit_skbs(sq, true);
> virtqueue_napi_complete(napi, sq->vq, 0);
> __netif_tx_unlock(txq);

Agreed. And subsequent block

   if (sq->vq->num_free >= 2 + MAX_SKB_FRAGS)
   netif_tx_wake_queue(txq);

as well

>
> Thanks
>
>
> >
> >   if (sq->vq->num_free >= 2 + MAX_SKB_FRAGS)
> >   netif_tx_wake_queue(txq);
>
___
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization