Re: [PATCH v2 31/32] sh: support a 2-byte smp_store_mb

2016-01-06 Thread Rich Felker
On Wed, Jan 06, 2016 at 10:23:12PM +0200, Michael S. Tsirkin wrote: > On Wed, Jan 06, 2016 at 01:23:50PM -0500, Rich Felker wrote: > > On Wed, Jan 06, 2016 at 03:32:18PM +0100, Peter Zijlstra wrote: > > > On Wed, Jan 06, 2016 at 01:52:17PM +0200, Michael S. Tsirkin wrote: > > > > > > Peter, what

Re: [PATCH v2 31/32] sh: support a 2-byte smp_store_mb

2016-01-06 Thread Michael S. Tsirkin
On Wed, Jan 06, 2016 at 01:23:50PM -0500, Rich Felker wrote: > On Wed, Jan 06, 2016 at 03:32:18PM +0100, Peter Zijlstra wrote: > > On Wed, Jan 06, 2016 at 01:52:17PM +0200, Michael S. Tsirkin wrote: > > > > > Peter, what do you think? How about I leave this patch as is for now? > > > > > > > >

Re: [PATCH v2 31/32] sh: support a 2-byte smp_store_mb

2016-01-06 Thread Michael S. Tsirkin
On Wed, Jan 06, 2016 at 01:23:50PM -0500, Rich Felker wrote: > On Wed, Jan 06, 2016 at 03:32:18PM +0100, Peter Zijlstra wrote: > > On Wed, Jan 06, 2016 at 01:52:17PM +0200, Michael S. Tsirkin wrote: > > > > > Peter, what do you think? How about I leave this patch as is for now? > > > > > > > >

Re: [PATCH v2 31/32] sh: support a 2-byte smp_store_mb

2016-01-06 Thread Rob Landley
On 01/06/2016 10:57 AM, Peter Zijlstra wrote: > On Wed, Jan 06, 2016 at 09:42:35AM -0600, Rob Landley wrote: >> (I would have thought the presence of working QEMU support would tide us >> over providing an easy basic regression testing environment, but people >> keep insisting that's not real

Re: [PATCH v2 31/32] sh: support a 2-byte smp_store_mb

2016-01-06 Thread Geert Uytterhoeven
On Wed, Jan 6, 2016 at 4:42 PM, Rob Landley wrote: > That said, if you'd ack a submission, Rich already has my Acked-by line > on a maintainers patch (AND one to remove the extra cc's from the sh > kernel list, and I acked Chen Gang's syscall addition patch back in >

Re: [PATCH v2 31/32] sh: support a 2-byte smp_store_mb

2016-01-06 Thread Rich Felker
On Wed, Jan 06, 2016 at 03:32:18PM +0100, Peter Zijlstra wrote: > On Wed, Jan 06, 2016 at 01:52:17PM +0200, Michael S. Tsirkin wrote: > > > > Peter, what do you think? How about I leave this patch as is for now? > > > > > > No, and I object to removing the single byte implementation too. Either >

Re: [PATCH v2 31/32] sh: support a 2-byte smp_store_mb

2016-01-06 Thread Peter Zijlstra
On Wed, Jan 06, 2016 at 09:42:35AM -0600, Rob Landley wrote: > (I would have thought the presence of working QEMU support would tide us > over providing an easy basic regression testing environment, but people > keep insisting that's not real and doesn't count. But if we can keep it > 99% working

Re: [PATCH v2 31/32] sh: support a 2-byte smp_store_mb

2016-01-06 Thread Rob Landley
On 01/06/2016 08:32 AM, Peter Zijlstra wrote: > On Wed, Jan 06, 2016 at 01:52:17PM +0200, Michael S. Tsirkin wrote: > SH's cmpxchg() is equally incomplete and does not provide 1 and 2 byte > versions. We added a new cmpxchg() in j-core (smp on sh2 was not previously a thing), but still need to

Re: [PATCH v2 31/32] sh: support a 2-byte smp_store_mb

2016-01-06 Thread Peter Zijlstra
On Wed, Jan 06, 2016 at 01:52:17PM +0200, Michael S. Tsirkin wrote: > > > Peter, what do you think? How about I leave this patch as is for now? > > > > No, and I object to removing the single byte implementation too. Either > > remove the full arch or fix xchg() to conform. xchg() should work on

Re: [PATCH v2 31/32] sh: support a 2-byte smp_store_mb

2016-01-06 Thread Michael S. Tsirkin
On Wed, Jan 06, 2016 at 12:40:23PM +0100, Peter Zijlstra wrote: > On Wed, Jan 06, 2016 at 01:19:44PM +0200, Michael S. Tsirkin wrote: > > On Tue, Jan 05, 2016 at 06:27:35PM -0500, Rich Felker wrote: > > > On Thu, Dec 31, 2015 at 09:09:47PM +0200, Michael S. Tsirkin wrote: > > > > At the moment,

Re: [PATCH v2 31/32] sh: support a 2-byte smp_store_mb

2016-01-06 Thread Peter Zijlstra
On Wed, Jan 06, 2016 at 01:19:44PM +0200, Michael S. Tsirkin wrote: > On Tue, Jan 05, 2016 at 06:27:35PM -0500, Rich Felker wrote: > > On Thu, Dec 31, 2015 at 09:09:47PM +0200, Michael S. Tsirkin wrote: > > > At the moment, xchg on sh only supports 4 and 1 byte values, so using it > > > from

Re: [PATCH v2 31/32] sh: support a 2-byte smp_store_mb

2016-01-06 Thread Michael S. Tsirkin
On Tue, Jan 05, 2016 at 06:27:35PM -0500, Rich Felker wrote: > On Thu, Dec 31, 2015 at 09:09:47PM +0200, Michael S. Tsirkin wrote: > > At the moment, xchg on sh only supports 4 and 1 byte values, so using it > > from smp_store_mb means attempts to store a 2 byte value using this > > macro fail. >

Re: [PATCH v2 31/32] sh: support a 2-byte smp_store_mb

2016-01-06 Thread Michael S. Tsirkin
On Tue, Jan 05, 2016 at 06:27:35PM -0500, Rich Felker wrote: > On Thu, Dec 31, 2015 at 09:09:47PM +0200, Michael S. Tsirkin wrote: > > At the moment, xchg on sh only supports 4 and 1 byte values, so using it > > from smp_store_mb means attempts to store a 2 byte value using this > > macro fail. >

Re: [PATCH v2 31/32] sh: support a 2-byte smp_store_mb

2016-01-06 Thread Peter Zijlstra
On Wed, Jan 06, 2016 at 01:19:44PM +0200, Michael S. Tsirkin wrote: > On Tue, Jan 05, 2016 at 06:27:35PM -0500, Rich Felker wrote: > > On Thu, Dec 31, 2015 at 09:09:47PM +0200, Michael S. Tsirkin wrote: > > > At the moment, xchg on sh only supports 4 and 1 byte values, so using it > > > from

Re: [PATCH v2 31/32] sh: support a 2-byte smp_store_mb

2016-01-06 Thread Michael S. Tsirkin
On Wed, Jan 06, 2016 at 12:40:23PM +0100, Peter Zijlstra wrote: > On Wed, Jan 06, 2016 at 01:19:44PM +0200, Michael S. Tsirkin wrote: > > On Tue, Jan 05, 2016 at 06:27:35PM -0500, Rich Felker wrote: > > > On Thu, Dec 31, 2015 at 09:09:47PM +0200, Michael S. Tsirkin wrote: > > > > At the moment,

Re: [PATCH v2 31/32] sh: support a 2-byte smp_store_mb

2016-01-06 Thread Peter Zijlstra
On Wed, Jan 06, 2016 at 01:52:17PM +0200, Michael S. Tsirkin wrote: > > > Peter, what do you think? How about I leave this patch as is for now? > > > > No, and I object to removing the single byte implementation too. Either > > remove the full arch or fix xchg() to conform. xchg() should work on

Re: [PATCH v2 31/32] sh: support a 2-byte smp_store_mb

2016-01-06 Thread Rob Landley
On 01/06/2016 08:32 AM, Peter Zijlstra wrote: > On Wed, Jan 06, 2016 at 01:52:17PM +0200, Michael S. Tsirkin wrote: > SH's cmpxchg() is equally incomplete and does not provide 1 and 2 byte > versions. We added a new cmpxchg() in j-core (smp on sh2 was not previously a thing), but still need to

Re: [PATCH v2 31/32] sh: support a 2-byte smp_store_mb

2016-01-06 Thread Rich Felker
On Wed, Jan 06, 2016 at 03:32:18PM +0100, Peter Zijlstra wrote: > On Wed, Jan 06, 2016 at 01:52:17PM +0200, Michael S. Tsirkin wrote: > > > > Peter, what do you think? How about I leave this patch as is for now? > > > > > > No, and I object to removing the single byte implementation too. Either >

Re: [PATCH v2 31/32] sh: support a 2-byte smp_store_mb

2016-01-06 Thread Geert Uytterhoeven
On Wed, Jan 6, 2016 at 4:42 PM, Rob Landley wrote: > That said, if you'd ack a submission, Rich already has my Acked-by line > on a maintainers patch (AND one to remove the extra cc's from the sh > kernel list, and I acked Chen Gang's syscall addition patch back in >

Re: [PATCH v2 31/32] sh: support a 2-byte smp_store_mb

2016-01-06 Thread Peter Zijlstra
On Wed, Jan 06, 2016 at 09:42:35AM -0600, Rob Landley wrote: > (I would have thought the presence of working QEMU support would tide us > over providing an easy basic regression testing environment, but people > keep insisting that's not real and doesn't count. But if we can keep it > 99% working

Re: [PATCH v2 31/32] sh: support a 2-byte smp_store_mb

2016-01-06 Thread Michael S. Tsirkin
On Wed, Jan 06, 2016 at 01:23:50PM -0500, Rich Felker wrote: > On Wed, Jan 06, 2016 at 03:32:18PM +0100, Peter Zijlstra wrote: > > On Wed, Jan 06, 2016 at 01:52:17PM +0200, Michael S. Tsirkin wrote: > > > > > Peter, what do you think? How about I leave this patch as is for now? > > > > > > > >

Re: [PATCH v2 31/32] sh: support a 2-byte smp_store_mb

2016-01-06 Thread Rich Felker
On Wed, Jan 06, 2016 at 10:23:12PM +0200, Michael S. Tsirkin wrote: > On Wed, Jan 06, 2016 at 01:23:50PM -0500, Rich Felker wrote: > > On Wed, Jan 06, 2016 at 03:32:18PM +0100, Peter Zijlstra wrote: > > > On Wed, Jan 06, 2016 at 01:52:17PM +0200, Michael S. Tsirkin wrote: > > > > > > Peter, what

Re: [PATCH v2 31/32] sh: support a 2-byte smp_store_mb

2016-01-06 Thread Michael S. Tsirkin
On Wed, Jan 06, 2016 at 01:23:50PM -0500, Rich Felker wrote: > On Wed, Jan 06, 2016 at 03:32:18PM +0100, Peter Zijlstra wrote: > > On Wed, Jan 06, 2016 at 01:52:17PM +0200, Michael S. Tsirkin wrote: > > > > > Peter, what do you think? How about I leave this patch as is for now? > > > > > > > >

Re: [PATCH v2 31/32] sh: support a 2-byte smp_store_mb

2016-01-06 Thread Rob Landley
On 01/06/2016 10:57 AM, Peter Zijlstra wrote: > On Wed, Jan 06, 2016 at 09:42:35AM -0600, Rob Landley wrote: >> (I would have thought the presence of working QEMU support would tide us >> over providing an easy basic regression testing environment, but people >> keep insisting that's not real

Re: [PATCH v2 31/32] sh: support a 2-byte smp_store_mb

2016-01-05 Thread Rich Felker
On Thu, Dec 31, 2015 at 09:09:47PM +0200, Michael S. Tsirkin wrote: > At the moment, xchg on sh only supports 4 and 1 byte values, so using it > from smp_store_mb means attempts to store a 2 byte value using this > macro fail. > > And happens to be exactly what virtio drivers want to do. > >

Re: [PATCH v2 31/32] sh: support a 2-byte smp_store_mb

2016-01-05 Thread Rich Felker
On Thu, Dec 31, 2015 at 09:09:47PM +0200, Michael S. Tsirkin wrote: > At the moment, xchg on sh only supports 4 and 1 byte values, so using it > from smp_store_mb means attempts to store a 2 byte value using this > macro fail. > > And happens to be exactly what virtio drivers want to do. > >

Re: [PATCH v2 31/32] sh: support a 2-byte smp_store_mb

2016-01-04 Thread Peter Zijlstra
On Thu, Dec 31, 2015 at 09:09:47PM +0200, Michael S. Tsirkin wrote: > At the moment, xchg on sh only supports 4 and 1 byte values, so using it > from smp_store_mb means attempts to store a 2 byte value using this > macro fail. > > And happens to be exactly what virtio drivers want to do. > >

Re: [PATCH v2 31/32] sh: support a 2-byte smp_store_mb

2016-01-04 Thread Peter Zijlstra
On Thu, Dec 31, 2015 at 09:09:47PM +0200, Michael S. Tsirkin wrote: > At the moment, xchg on sh only supports 4 and 1 byte values, so using it > from smp_store_mb means attempts to store a 2 byte value using this > macro fail. > > And happens to be exactly what virtio drivers want to do. > >

[PATCH v2 31/32] sh: support a 2-byte smp_store_mb

2015-12-31 Thread Michael S. Tsirkin
At the moment, xchg on sh only supports 4 and 1 byte values, so using it from smp_store_mb means attempts to store a 2 byte value using this macro fail. And happens to be exactly what virtio drivers want to do. Check size and fall back to a slower, but safe, WRITE_ONCE+smp_mb. Signed-off-by:

[PATCH v2 31/32] sh: support a 2-byte smp_store_mb

2015-12-31 Thread Michael S. Tsirkin
At the moment, xchg on sh only supports 4 and 1 byte values, so using it from smp_store_mb means attempts to store a 2 byte value using this macro fail. And happens to be exactly what virtio drivers want to do. Check size and fall back to a slower, but safe, WRITE_ONCE+smp_mb. Signed-off-by: