[PATCH 09/18] metag/uaccess: fix sparse errors

2014-12-14 Thread Michael S. Tsirkin
virtio wants to read bitwise types from userspace using get_user. At the moment this triggers sparse errors, since the value is passed through an integer. Fix that up using __force. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- arch/metag/include/asm/uaccess.h | 4 ++-- 1 file changed

Re: [PATCH repost 09/16] metag/uaccess: fix sparse errors

2015-01-06 Thread Michael S. Tsirkin
On Mon, Jan 05, 2015 at 02:47:19PM +, James Hogan wrote: On 5 January 2015 at 13:00, Michael S. Tsirkin m...@redhat.com wrote: On Mon, Jan 05, 2015 at 09:44:14AM +, James Hogan wrote: On 04/01/15 10:52, Michael S. Tsirkin wrote: On Fri, Jan 02, 2015 at 03:41:02PM +, James Hogan

Re: [PATCH repost 09/16] metag/uaccess: fix sparse errors

2015-01-05 Thread Michael S. Tsirkin
On Mon, Jan 05, 2015 at 09:44:14AM +, James Hogan wrote: On 04/01/15 10:52, Michael S. Tsirkin wrote: On Fri, Jan 02, 2015 at 03:41:02PM +, James Hogan wrote: Hi, On 25/12/14 09:29, Michael S. Tsirkin wrote: virtio wants to read bitwise types from userspace using get_user

[PATCH v2 09/40] metag/uaccess: fix sparse errors

2015-01-06 Thread Michael S. Tsirkin
virtio wants to read bitwise types from userspace using get_user. At the moment this triggers sparse errors, since the value is passed through an integer. Fix that up using __force. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- arch/metag/include/asm/uaccess.h | 4 ++-- 1 file changed

Re: [PATCH v2 09/40] metag/uaccess: fix sparse errors

2015-01-07 Thread Michael S. Tsirkin
On Wed, Jan 07, 2015 at 09:47:24AM +, James Hogan wrote: Hi Machael, On 06/01/15 15:43, Michael S. Tsirkin wrote: virtio wants to read bitwise types from userspace using get_user. At the moment this triggers sparse errors, since the value is passed through an integer. Fix

Re: [PATCH v2 22/32] s390: define __smp_xxx

2016-01-04 Thread Michael S. Tsirkin
On Mon, Jan 04, 2016 at 02:45:25PM +0100, Peter Zijlstra wrote: > On Thu, Dec 31, 2015 at 09:08:38PM +0200, Michael S. Tsirkin wrote: > > This defines __smp_xxx barriers for s390, > > for use by virtualization. > > > > Some smp_xxx barriers are removed as they are &

Re: [PATCH v2 06/32] s390: reuse asm-generic/barrier.h

2016-01-04 Thread Michael S. Tsirkin
On Mon, Jan 04, 2016 at 02:20:42PM +0100, Peter Zijlstra wrote: > On Thu, Dec 31, 2015 at 09:06:30PM +0200, Michael S. Tsirkin wrote: > > On s390 read_barrier_depends, smp_read_barrier_depends > > smp_store_mb(), smp_mb__before_atomic and smp_mb__after_atomic match the > >

Re: [PATCH v2 17/32] arm: define __smp_xxx

2016-01-04 Thread Michael S. Tsirkin
On Mon, Jan 04, 2016 at 02:36:58PM +0100, Peter Zijlstra wrote: > On Sun, Jan 03, 2016 at 11:12:44AM +0200, Michael S. Tsirkin wrote: > > On Sat, Jan 02, 2016 at 11:24:38AM +, Russell King - ARM Linux wrote: > > > > My only concern is that it gives people an a

[PATCH 0/3] checkpatch: handling of memory barriers

2016-01-04 Thread Michael S. Tsirkin
As part of memory barrier cleanup, this patchset extends checkpatch to make it easier to stop incorrect memory barrier usage. This applies on top of my series arch: barrier cleanup + barriers for virt and will be included in the next version of the series. Michael S. Tsirkin (3

[PATCH 1/3] checkpatch.pl: add missing memory barriers

2016-01-04 Thread Michael S. Tsirkin
SMP-only barriers were missing in checkpatch.pl Refactor code slightly to make adding more variants easier. Signed-off-by: Michael S. Tsirkin <m...@redhat.com> --- scripts/checkpatch.pl | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/checkpatch.pl b/s

Re: [PATCH v2 32/32] virtio_ring: use virt_store_mb

2016-01-03 Thread Michael S. Tsirkin
On Fri, Jan 01, 2016 at 08:23:46PM +0300, Sergei Shtylyov wrote: > Hello. > > On 12/31/2015 10:09 PM, Michael S. Tsirkin wrote: > > >We need a full barrier after writing out event index, using > >virt_store_mb there seems better than open-coding. As usual, we need

Re: [PATCH v2 22/32] s390: define __smp_xxx

2016-01-05 Thread Michael S. Tsirkin
On Tue, Jan 05, 2016 at 04:39:37PM +0100, Christian Borntraeger wrote: > On 01/05/2016 10:30 AM, Michael S. Tsirkin wrote: > > > > > arch/s390/kernel/vdso.c:smp_mb(); > > > > Looking at > > Author: Christian Borntraeger <borntrae...@de.ibm.c

[PATCH v2 24/32] sparc: define __smp_xxx

2015-12-31 Thread Michael S. Tsirkin
This defines __smp_xxx barriers for sparc, for use by virtualization. smp_xxx barriers are removed as they are defined correctly by asm-generic/barriers.h Signed-off-by: Michael S. Tsirkin <m...@redhat.com> Acked-by: Arnd Bergmann <a...@arndb.de> --- arch/sparc/include/asm/barr

[PATCH v2 27/32] x86: define __smp_xxx

2015-12-31 Thread Michael S. Tsirkin
This defines __smp_xxx barriers for x86, for use by virtualization. smp_xxx barriers are removed as they are defined correctly by asm-generic/barriers.h Signed-off-by: Michael S. Tsirkin <m...@redhat.com> Acked-by: Arnd Bergmann <a...@arndb.de> --- arch/x86/include/asm/ba

[PATCH v2 20/32] metag: define __smp_xxx

2015-12-31 Thread Michael S. Tsirkin
between SMP and !SMP. For this reason, this patch introduces a wrapper metag_fence() that doesn't depend on CONFIG_SMP. fence() is then defined using that, depending on CONFIG_SMP. Signed-off-by: Michael S. Tsirkin <m...@redhat.com> Acked-by: Arnd Bergmann <a...@arndb.de> --- arch/metag

[PATCH v2 11/32] mips: reuse asm-generic/barrier.h

2015-12-31 Thread Michael S. Tsirkin
. Signed-off-by: Michael S. Tsirkin <m...@redhat.com> Acked-by: Arnd Bergmann <a...@arndb.de> --- arch/mips/include/asm/barrier.h | 25 ++--- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/arch/mips/include/asm/barrier.h b/arch/mips/include/asm/barrier.h i

[PATCH v2 12/32] x86/um: reuse asm-generic/barrier.h

2015-12-31 Thread Michael S. Tsirkin
On x86/um CONFIG_SMP is never defined. As a result, several macros match the asm-generic variant exactly. Drop the local definitions and pull in asm-generic/barrier.h instead. This is in preparation to refactoring this code area. Signed-off-by: Michael S. Tsirkin <m...@redhat.com>

[PATCH v2 01/32] lcoking/barriers, arch: Use smp barriers in smp_store_release()

2015-12-31 Thread Michael S. Tsirkin
From: Davidlohr Bueso With commit b92b8b35a2e ("locking/arch: Rename set_mb() to smp_store_mb()") it was made clear that the context of this call (and thus set_mb) is strictly for CPU ordering, as opposed to IO. As such all archs should use the smp variant of mb(), respecting

[PATCH v2 10/32] metag: reuse asm-generic/barrier.h

2015-12-31 Thread Michael S. Tsirkin
. Signed-off-by: Michael S. Tsirkin <m...@redhat.com> Acked-by: Arnd Bergmann <a...@arndb.de> --- arch/metag/include/asm/barrier.h | 25 ++--- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/arch/metag/include/asm/barrier.h b/arch/metag/include/asm/bar

[PATCH v2 02/32] asm-generic: guard smp_store_release/load_acquire

2015-12-31 Thread Michael S. Tsirkin
Allow architectures to override smp_store_release and smp_load_acquire by guarding the defines in asm-generic/barrier.h with ifndef directives. This is in preparation to reusing asm-generic/barrier.h on architectures which have their own definition of these macros. Signed-off-by: Michael S

[PATCH v2 08/32] arm: reuse asm-generic/barrier.h

2015-12-31 Thread Michael S. Tsirkin
to refactoring this code area. Signed-off-by: Michael S. Tsirkin <m...@redhat.com> Acked-by: Arnd Bergmann <a...@arndb.de> --- arch/arm/include/asm/barrier.h | 23 +-- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/arch/arm/include/asm/barrier.h b/arch/arm

[PATCH v2 05/32] powerpc: reuse asm-generic/barrier.h

2015-12-31 Thread Michael S. Tsirkin
-by: Michael S. Tsirkin <m...@redhat.com> Acked-by: Arnd Bergmann <a...@arndb.de> --- arch/powerpc/include/asm/barrier.h | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/arch/powerpc/include/asm/barrier.h b/arch/powerpc/include/asm/barrier.h index a7af5fb..98

[PATCH v2 04/32] ia64: reuse asm-generic/barrier.h

2015-12-31 Thread Michael S. Tsirkin
On ia64 smp_rmb, smp_wmb, read_barrier_depends, smp_read_barrier_depends and smp_store_mb() match the asm-generic variants exactly. Drop the local definitions and pull in asm-generic/barrier.h instead. This is in preparation to refactoring this code area. Signed-off-by: Michael S. Tsirkin &l

[PATCH v2 30/32] virtio_ring: update weak barriers to use __smp_xxx

2016-01-01 Thread Michael S. Tsirkin
gt; Cc: Alexander Duyck <alexander.du...@gmail.com> Signed-off-by: Michael S. Tsirkin <m...@redhat.com> --- include/linux/virtio_ring.h | 25 - 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/include/linux/virtio_ring.h b/include/linux/virtio_ring.h inde

Re: [PATCH v2 30/32] virtio_ring: update weak barriers to use __smp_xxx

2016-01-01 Thread Michael S. Tsirkin
On Fri, Jan 01, 2016 at 11:39:40AM +0200, Michael S. Tsirkin wrote: > virtio ring uses smp_wmb on SMP and wmb on !SMP, > the reason for the later being that it might be > talking to another kernel on the same SMP machine. > > This is exactly what __smp_XXX barriers

Re: [PATCH v2 15/32] powerpc: define __smp_xxx

2016-01-06 Thread Michael S. Tsirkin
On Wed, Jan 06, 2016 at 09:51:52AM +0800, Boqun Feng wrote: > On Tue, Jan 05, 2016 at 06:16:48PM +0200, Michael S. Tsirkin wrote: > [snip] > > > > > Another thing is that smp_lwsync() may have a third user(other than > > > > > smp_load_acquire() and smp_store_r

[PATCH 11/34] metag: reuse asm-generic/barrier.h

2015-12-30 Thread Michael S. Tsirkin
. Signed-off-by: Michael S. Tsirkin <m...@redhat.com> --- This is straightforward, but unfortunately untested: I don't have a metag compiler. I would appreciate an ack from someone with a metag compiler. arch/metag/include/asm/barrier.h | 25 ++--- 1 file changed, 2 inse