Re: [PATCH v1 0/2] Virtio: fix some vq allocation issues

2019-01-02 Thread Wei Wang
On 12/28/2018 03:57 PM, Christian Borntraeger wrote: On 28.12.2018 03:26, Wei Wang wrote: Some vqs don't need to be allocated when the related feature bits are disabled. Callers notice the vq allocation layer by setting the related names[i] to be NULL. This patch series fixes the find_vqs impl

[PATCH v1 2/2] virtio-balloon: improve update_balloon_size_func

2019-01-02 Thread Wei Wang
There is no need to update the balloon actual register when there is no ballooning request. This patch avoids update_balloon_size when diff is 0. Signed-off-by: Wei Wang --- drivers/virtio/virtio_balloon.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/virtio/vir

[PATCH v1 1/2] virtio-balloon: tweak config_changed implementation

2019-01-02 Thread Wei Wang
virtio-ccw has deadlock issues with reading config registers inside the interrupt context, so we tweak the virtballoon_changed implementation by moving the config read operations into the related workqueue contexts. Signed-off-by: Wei Wang --- drivers/virtio/virtio_balloon.c | 54 +++

[PATCH v1 0/2] virtio-balloon: tweak config_changed

2019-01-02 Thread Wei Wang
Since virtio-ccw doesn't work with accessing to the config registers inside an interrupt context, this patch series avoids that issue by moving the config register accesses to the related workqueue contexts. Wei Wang (2): virtio-balloon: tweak config_changed implementation virtio-balloon: impr

Re: [PATCH RFC 0/4] barriers using data dependency

2019-01-02 Thread Michael S. Tsirkin
On Wed, Jan 02, 2019 at 04:36:40PM -0500, Alan Stern wrote: > On Wed, 2 Jan 2019, Michael S. Tsirkin wrote: > > > So as explained in Documentation/memory-barriers.txt e.g. > > a load followed by a store require a full memory barrier, > > to avoid store being ordered before the load. > > Similarly

Re: [PATCH RFC 3/4] barriers: convert a control to a data dependency

2019-01-02 Thread Matthew Wilcox
On Wed, Jan 02, 2019 at 03:57:58PM -0500, Michael S. Tsirkin wrote: > @@ -875,6 +893,8 @@ to the CPU containing it. See the section on "Multicopy > atomicity" > for more information. > > > + > + > In summary: > >(*) Control dependencies can order prior loads against later stores. Was

Re: [PATCH RFC 3/4] barriers: convert a control to a data dependency

2019-01-02 Thread Michael S. Tsirkin
On Wed, Jan 02, 2019 at 01:00:24PM -0800, Matthew Wilcox wrote: > On Wed, Jan 02, 2019 at 03:57:58PM -0500, Michael S. Tsirkin wrote: > > @@ -875,6 +893,8 @@ to the CPU containing it. See the section on > > "Multicopy atomicity" > > for more information. > > > > > > + > > + > > In summary:

[PULL] virtio, vhost: features, fixes, cleanups

2019-01-02 Thread Michael S. Tsirkin
The following changes since commit 7566ec393f4161572ba6f11ad5171fd5d59b0fbd: Linux 4.20-rc7 (2018-12-16 15:46:55 -0800) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git tags/for_linus for you to fetch changes up to a691ffb46edd7cb12a17ff096

[PATCH RFC 4/4] virtio: use dependent_ptr_mb

2019-01-02 Thread Michael S. Tsirkin
Use dependent_ptr_mb which is - on some architectures - more light-weight than an rmb. Signed-off-by: Michael S. Tsirkin --- drivers/virtio/virtio_ring.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index 81

[PATCH RFC 3/4] barriers: convert a control to a data dependency

2019-01-02 Thread Michael S. Tsirkin
It's not uncommon to have two access two unrelated memory locations in a specific order. At the moment one has to use a memory barrier for this. However, if the first access was a read and the second used an address depending on the first one we would have a data dependency and no barrier would b

[PATCH RFC 2/4] include/linux/compiler.h: allow memory operands

2019-01-02 Thread Michael S. Tsirkin
We don't really care whether the variable is in-register or in-memory. Relax the constraint accordingly. Signed-off-by: Michael S. Tsirkin --- include/linux/compiler.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 1a

[PATCH RFC 1/4] include/linux/compiler*.h: fix OPTIMIZER_HIDE_VAR

2019-01-02 Thread Michael S. Tsirkin
Since commit 815f0ddb346c ("include/linux/compiler*.h: make compiler-*.h mutually exclusive") clang no longer reuses the OPTIMIZER_HIDE_VAR macro from compiler-gcc - instead it gets the version in include/linux/compiler.h. Unfortunately that version doesn't actually prevent compiler from optimizin

[PATCH RFC 0/4] barriers using data dependency

2019-01-02 Thread Michael S. Tsirkin
So as explained in Documentation/memory-barriers.txt e.g. a load followed by a store require a full memory barrier, to avoid store being ordered before the load. Similarly load-load requires a read memory barrier. Thinking about it, we can actually create a data dependency by mixing the first load

Re: [RFC PATCH V3 0/5] Hi:

2019-01-02 Thread Michael S. Tsirkin
On Sat, Dec 29, 2018 at 08:46:51PM +0800, Jason Wang wrote: > This series tries to access virtqueue metadata through kernel virtual > address instead of copy_user() friends since they had too much > overheads like checks, spec barriers or even hardware feature > toggling. Will review, thanks! One

Re: [RFC PATCH 1/1] s390/virtio: handle find on invalid queue gracefully

2019-01-02 Thread Cornelia Huck
On Wed, 2 Jan 2019 18:50:20 +0100 Halil Pasic wrote: > A queue with a capacity of zero is clearly not a valid virtio queue. > Some emulators report zero queue size if queried with an invalid queue > index. Instead of crashing in this case let us just return -EINVAL. To > make that work properly,

Re: [virtio-dev] RE: [PATCH v1 0/2] Virtio: fix some vq allocation issues

2019-01-02 Thread Cornelia Huck
On Wed, 2 Jan 2019 16:59:19 +0100 Halil Pasic wrote: > On Wed, 2 Jan 2019 14:23:38 +0100 > Cornelia Huck wrote: > > > On Wed, 2 Jan 2019 10:53:14 +0100 > > Cornelia Huck wrote: > > > > > On Tue, 1 Jan 2019 00:40:19 +0100 > > > Halil Pasic wrote: > > > > AFAICT tweaking the balloon code

Re: [PATCH RFC 1/2] virtio-net: bql support

2019-01-02 Thread Michael S. Tsirkin
On Wed, Jan 02, 2019 at 11:28:43AM +0800, Jason Wang wrote: > > On 2018/12/31 上午2:45, Michael S. Tsirkin wrote: > > On Thu, Dec 27, 2018 at 06:00:36PM +0800, Jason Wang wrote: > > > On 2018/12/26 下午11:19, Michael S. Tsirkin wrote: > > > > On Thu, Dec 06, 2018 at 04:17:36PM +0800, Jason Wang wrote:

Re: [PATCH RFC 1/2] virtio-net: bql support

2019-01-02 Thread Michael S. Tsirkin
On Wed, Jan 02, 2019 at 11:30:11AM +0800, Jason Wang wrote: > > On 2018/12/31 上午2:48, Michael S. Tsirkin wrote: > > On Thu, Dec 27, 2018 at 06:04:53PM +0800, Jason Wang wrote: > > > On 2018/12/26 下午11:22, Michael S. Tsirkin wrote: > > > > On Thu, Dec 06, 2018 at 04:17:36PM +0800, Jason Wang wrote:

Re: [virtio-dev] RE: [PATCH v1 0/2] Virtio: fix some vq allocation issues

2019-01-02 Thread Cornelia Huck
On Wed, 2 Jan 2019 10:53:14 +0100 Cornelia Huck wrote: > On Tue, 1 Jan 2019 00:40:19 +0100 > Halil Pasic wrote: > > As I said, at the moment I don't have a preference regarding the fix, > > partly because I'm not sure if "reading config inside the handler" is OK > > or not. Maybe Connie or Mich

Re: [PATCH net-next 3/3] vhost: access vq metadata through kernel virtual address

2019-01-02 Thread Jason Wang
On 2018/12/31 上午2:30, Michael S. Tsirkin wrote: On Thu, Dec 27, 2018 at 05:39:21PM +0800, Jason Wang wrote: On 2018/12/26 下午11:02, Michael S. Tsirkin wrote: On Wed, Dec 26, 2018 at 11:57:32AM +0800, Jason Wang wrote: On 2018/12/25 下午8:50, Michael S. Tsirkin wrote: On Tue, Dec 25, 2018 at 06:

Re: [virtio-dev] RE: [PATCH v1 0/2] Virtio: fix some vq allocation issues

2019-01-02 Thread Cornelia Huck
On Tue, 1 Jan 2019 00:40:19 +0100 Halil Pasic wrote: > On Mon, 31 Dec 2018 06:03:51 + > "Wang, Wei W" wrote: > > > On Sunday, December 30, 2018 2:06 PM, Halil Pasic wrote: > > > > > > I guess you are the first one trying to read virtio config from within > > > interrupt > > > context. A