Re: [PATCH 01/10] IB/ehca: Support for multiple event queues

2007-07-16 Thread Michael S. Tsirkin
I still haven't seen much code using the feature or even any anecdotal information about the performance impact. Here's some anecdotal evidence :) http://lists.openfabrics.org/pipermail/general/2007-May/035758.html -- MST ___ Linuxppc-dev mailing

Re: [PATCH 01/10] IB/ehca: Support for multiple event queues

2007-07-17 Thread Michael S. Tsirkin
Quoting Roland Dreier [EMAIL PROTECTED]: Subject: Re: [PATCH 01/10] IB/ehca: Support for multiple event queues Here's some anecdotal evidence :) http://lists.openfabrics.org/pipermail/general/2007-May/035758.html Right, but then we went on to say that we probably want to use multiple

Re: [RFC 0/2] Reenable might_sleep() checks for might_fault() when atomic

2014-11-25 Thread Michael S. Tsirkin
On Tue, Nov 25, 2014 at 12:43:24PM +0100, David Hildenbrand wrote: I recently discovered that commit 662bbcb2747c2422cf98d3d97619509379eee466 removed/skipped all might_sleep checks for might_fault() calls when in atomic. Yes. You can add e.g. might_sleep in your code if, for some reason, it is

Re: [RFC 0/2] Reenable might_sleep() checks for might_fault() when atomic

2014-11-26 Thread Michael S. Tsirkin
On Wed, Nov 26, 2014 at 11:05:04AM +0100, David Hildenbrand wrote: What's the path you are trying to debug? Well, we had a problem where we held a spin_lock and called copy_(from|to)_user(). We experienced very random deadlocks that took some guy almost a week to debug. The simple

Re: [RFC 0/2] Reenable might_sleep() checks for might_fault() when atomic

2014-11-26 Thread Michael S. Tsirkin
Hmm you sent same mail to me off-list, and I replied there. Now there's a copy on list - I'm just going to assume it's exactly identical, pasting my response here as well. If there are more questions I missed, let me know. On Wed, Nov 26, 2014 at 09:23:31AM +0100, David Hildenbrand wrote: Sorry

Re: [RFC 0/2] Reenable might_sleep() checks for might_fault() when atomic

2014-11-26 Thread Michael S. Tsirkin
On Wed, Nov 26, 2014 at 05:17:29PM +0200, Michael S. Tsirkin wrote: On Wed, Nov 26, 2014 at 11:05:04AM +0100, David Hildenbrand wrote: What's the path you are trying to debug? Well, we had a problem where we held a spin_lock and called copy_(from|to)_user(). We experienced very random

Re: [RFC 0/2] Reenable might_sleep() checks for might_fault() when atomic

2014-11-26 Thread Michael S. Tsirkin
On Wed, Nov 26, 2014 at 04:30:32PM +0100, Christian Borntraeger wrote: Am 26.11.2014 um 16:17 schrieb Michael S. Tsirkin: On Wed, Nov 26, 2014 at 11:05:04AM +0100, David Hildenbrand wrote: What's the path you are trying to debug? Well, we had a problem where we held a spin_lock and called

Re: [RFC 0/2] Reenable might_sleep() checks for might_fault() when atomic

2014-11-26 Thread Michael S. Tsirkin
On Wed, Nov 26, 2014 at 04:32:07PM +0100, David Hildenbrand wrote: On Wed, Nov 26, 2014 at 05:17:29PM +0200, Michael S. Tsirkin wrote: On Wed, Nov 26, 2014 at 11:05:04AM +0100, David Hildenbrand wrote: What's the path you are trying to debug? Well, we had a problem where we held

Re: [RFC 0/2] Reenable might_sleep() checks for might_fault() when atomic

2014-11-26 Thread Michael S. Tsirkin
On Wed, Nov 26, 2014 at 05:02:23PM +0100, David Hildenbrand wrote: This is what happened on our side (very recent kernel): spin_lock(lock) copy_to_user(...) spin_unlock(lock) That's a deadlock even without copy_to_user - it's enough for the thread to be preempted and another

Re: [RFC 0/2] Reenable might_sleep() checks for might_fault() when atomic

2014-11-26 Thread Michael S. Tsirkin
On Wed, Nov 26, 2014 at 05:07:13PM +0100, Christian Borntraeger wrote: Am 26.11.2014 um 16:47 schrieb Michael S. Tsirkin: On Wed, Nov 26, 2014 at 04:32:07PM +0100, David Hildenbrand wrote: On Wed, Nov 26, 2014 at 05:17:29PM +0200, Michael S. Tsirkin wrote: On Wed, Nov 26, 2014 at 11:05:04AM

Re: [RFC 0/2] Reenable might_sleep() checks for might_fault() when atomic

2014-11-26 Thread Michael S. Tsirkin
On Wed, Nov 26, 2014 at 05:30:35PM +0100, Christian Borntraeger wrote: Am 26.11.2014 um 17:19 schrieb Michael S. Tsirkin: On Wed, Nov 26, 2014 at 05:02:23PM +0100, David Hildenbrand wrote: This is what happened on our side (very recent kernel): spin_lock(lock) copy_to_user

Re: [RFC 0/2] Reenable might_sleep() checks for might_fault() when atomic

2014-11-26 Thread Michael S. Tsirkin
On Wed, Nov 26, 2014 at 05:51:08PM +0100, Christian Borntraeger wrote: But this one was giving users in field false positives. So lets try to fix those, ok? If we cant, then tough luck. Sure. I think the simplest way might be to make spinlock disable premption when CONFIG_DEBUG_ATOMIC_SLEEP

Re: [RFC 0/2] Reenable might_sleep() checks for might_fault() when atomic

2014-11-26 Thread Michael S. Tsirkin
On Wed, Nov 26, 2014 at 07:04:47PM +0200, Michael S. Tsirkin wrote: On Wed, Nov 26, 2014 at 05:51:08PM +0100, Christian Borntraeger wrote: But this one was giving users in field false positives. So lets try to fix those, ok? If we cant, then tough luck. Sure. I think the simplest way

Re: [RFC 0/2] Reenable might_sleep() checks for might_fault() when atomic

2014-11-26 Thread Michael S. Tsirkin
On Thu, Nov 27, 2014 at 08:09:19AM +0100, Heiko Carstens wrote: On Wed, Nov 26, 2014 at 07:04:47PM +0200, Michael S. Tsirkin wrote: On Wed, Nov 26, 2014 at 05:51:08PM +0100, Christian Borntraeger wrote: But this one was giving users in field false positives. So lets try to fix those

Re: [PATCH RFC 2/2] mm, sched: trigger might_sleep() in might_fault() when pagefaults are disabled

2014-11-27 Thread Michael S. Tsirkin
On Thu, Nov 27, 2014 at 06:10:17PM +0100, David Hildenbrand wrote: Commit 662bbcb2747c2422cf98d3d97619509379eee466 removed might_sleep() checks for all user access code (that uses might_fault()). The reason was to disable wrong sleep in atomic warnings in the following scenario:

Re: [PATCH RFC 2/2] mm, sched: trigger might_sleep() in might_fault() when pagefaults are disabled

2014-11-27 Thread Michael S. Tsirkin
On Thu, Nov 27, 2014 at 07:24:49PM +0200, Michael S. Tsirkin wrote: On Thu, Nov 27, 2014 at 06:10:17PM +0100, David Hildenbrand wrote: Commit 662bbcb2747c2422cf98d3d97619509379eee466 removed might_sleep() checks for all user access code (that uses might_fault()). The reason

Re: [PATCH RFC 2/2] mm, sched: trigger might_sleep() in might_fault() when pagefaults are disabled

2014-11-27 Thread Michael S. Tsirkin
On Thu, Nov 27, 2014 at 07:08:42PM +0100, David Hildenbrand wrote: - - __might_sleep(__FILE__, __LINE__, 0); + if (unlikely(!pagefault_disabled())) + __might_sleep(__FILE__, __LINE__, 0); Same here: so maybe make might_fault a wrapper around

[PATCH v2 00/10] uaccess: better might_sleep/might_fault behavior

2013-05-16 Thread Michael S. Tsirkin
/might_sleep/might_fault/ Changes from v1: add more architectures fix might_fault() scheduling differently depending on CONFIG_PROVE_LOCKING, as suggested by Ingo Michael S. Tsirkin (10): asm-generic: uaccess s/might_sleep/might_fault/ arm64: uaccess s/might_sleep

[PATCH v2 02/10] arm64: uaccess s/might_sleep/might_fault/

2013-05-16 Thread Michael S. Tsirkin
The only reason uaccess routines might sleep is if they fault. Make this explicit. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- arch/arm64/include/asm/uaccess.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/include/asm/uaccess.h b/arch/arm64/include

[PATCH v2 03/10] frv: uaccess s/might_sleep/might_fault/

2013-05-16 Thread Michael S. Tsirkin
The only reason uaccess routines might sleep is if they fault. Make this explicit. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- arch/frv/include/asm/uaccess.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/frv/include/asm/uaccess.h b/arch/frv/include/asm

[PATCH v2 04/10] m32r: uaccess s/might_sleep/might_fault/

2013-05-16 Thread Michael S. Tsirkin
The only reason uaccess routines might sleep is if they fault. Make this explicit. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- arch/m32r/include/asm/uaccess.h | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/m32r/include/asm/uaccess.h b/arch/m32r

[PATCH v2 05/10] microblaze: uaccess s/might_sleep/might_fault/

2013-05-16 Thread Michael S. Tsirkin
The only reason uaccess routines might sleep is if they fault. Make this explicit. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- arch/microblaze/include/asm/uaccess.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/microblaze/include/asm/uaccess.h b/arch

[PATCH v2 06/10] mn10300: uaccess s/might_sleep/might_fault/

2013-05-16 Thread Michael S. Tsirkin
The only reason uaccess routines might sleep is if they fault. Make this explicit. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- arch/mn10300/include/asm/uaccess.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/mn10300/include/asm/uaccess.h b/arch/mn10300

[PATCH v2 01/10] asm-generic: uaccess s/might_sleep/might_fault/

2013-05-16 Thread Michael S. Tsirkin
The only reason uaccess routines might sleep is if they fault. Make this explicit. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- include/asm-generic/uaccess.h | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/asm-generic/uaccess.h b/include/asm

[PATCH v2 07/10] powerpc: uaccess s/might_sleep/might_fault/

2013-05-16 Thread Michael S. Tsirkin
The only reason uaccess routines might sleep is if they fault. Make this explicit. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- arch/powerpc/include/asm/uaccess.h | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/arch/powerpc/include/asm/uaccess.h b

[PATCH v2 08/10] tile: uaccess s/might_sleep/might_fault/

2013-05-16 Thread Michael S. Tsirkin
The only reason uaccess routines might sleep is if they fault. Make this explicit. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- arch/tile/include/asm/uaccess.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/tile/include/asm/uaccess.h b/arch/tile/include/asm

[PATCH v2 09/10] x86: uaccess s/might_sleep/might_fault/

2013-05-16 Thread Michael S. Tsirkin
The only reason uaccess routines might sleep is if they fault. Make this explicit. Signed-off-by: Michael S. Tsirkin m...@redhat.com Acked-by: Ingo Molnar mi...@kernel.org --- arch/x86/include/asm/uaccess_64.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/include

[PATCH v2 10/10] kernel: might_fault does not imply might_sleep

2013-05-16 Thread Michael S. Tsirkin
- checking for pagefault_disable() in the CONFIG_PROVE_LOCKING implementation Signed-off-by: Michael S. Tsirkin m...@redhat.com --- include/linux/kernel.h | 1 - mm/memory.c| 14 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/include

Re: [PATCH v2 10/10] kernel: might_fault does not imply might_sleep

2013-05-19 Thread Michael S. Tsirkin
On Thu, May 16, 2013 at 08:40:41PM +0200, Peter Zijlstra wrote: On Thu, May 16, 2013 at 02:16:10PM +0300, Michael S. Tsirkin wrote: There are several ways to make sure might_fault calling function does not sleep. One is to use it on kernel or otherwise locked memory - apparently nfs

Re: [PATCH v2 10/10] kernel: might_fault does not imply might_sleep

2013-05-19 Thread Michael S. Tsirkin
On Sun, May 19, 2013 at 08:34:04AM -0400, Steven Rostedt wrote: On Sun, 2013-05-19 at 12:35 +0300, Michael S. Tsirkin wrote: No, I was not assuming that. What I'm trying to say is that a caller that does something like this under a spinlock: preempt_disable pagefault_disable

Re: [PATCH v2 10/10] kernel: might_fault does not imply might_sleep

2013-05-19 Thread Michael S. Tsirkin
On Sun, May 19, 2013 at 12:06:19PM -0400, Steven Rostedt wrote: On Sun, 2013-05-19 at 16:34 +0300, Michael S. Tsirkin wrote: Right but we need to keep it working on upstream as well. If I do preempt_enable under a spinlock upstream won't it try to sleep under spinlock? No it wont

Re: [PATCH v2 10/10] kernel: might_fault does not imply might_sleep

2013-05-19 Thread Michael S. Tsirkin
On Sun, May 19, 2013 at 04:23:22PM -0400, Steven Rostedt wrote: On Sun, 2013-05-19 at 19:40 +0300, Michael S. Tsirkin wrote: OK I get it. So let me correct myself. The simple code that does something like this under a spinlock: preempt_disable pagefault_disable

Re: [PATCH v2 10/10] kernel: might_fault does not imply might_sleep

2013-05-22 Thread Michael S. Tsirkin
On Tue, May 21, 2013 at 01:57:34PM +0200, Peter Zijlstra wrote: On Sun, May 19, 2013 at 12:35:26PM +0300, Michael S. Tsirkin wrote: --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -198,7 +198,6 @@ void might_fault(void); #else static inline void might_fault(void

Re: [PATCH v2 00/10] uaccess: better might_sleep/might_fault behavior

2013-05-22 Thread Michael S. Tsirkin
On Wed, May 22, 2013 at 11:25:36AM +0200, Arnd Bergmann wrote: On Thursday 16 May 2013, Michael S. Tsirkin wrote: This improves the might_fault annotations used by uaccess routines: 1. The only reason uaccess routines might sleep is if they fault. Make this explicit for all

Re: [PATCH v2 00/10] uaccess: better might_sleep/might_fault behavior

2013-05-22 Thread Michael S. Tsirkin
On Wed, May 22, 2013 at 12:19:16PM +0200, Peter Zijlstra wrote: On Wed, May 22, 2013 at 11:25:36AM +0200, Arnd Bergmann wrote: Calling might_fault() for every __get_user/__put_user is rather expensive because it turns what should be a single instruction (plus fixup) into an external

Re: [PATCH v2 07/10] powerpc: uaccess s/might_sleep/might_fault/

2013-05-22 Thread Michael S. Tsirkin
On Wed, May 22, 2013 at 03:59:01PM +0200, Arnd Bergmann wrote: On Thursday 16 May 2013, Michael S. Tsirkin wrote: @@ -178,7 +178,7 @@ do { \ long __pu_err; \ __typeof__

Re: [PATCH v2 00/10] uaccess: better might_sleep/might_fault behavior

2013-05-22 Thread Michael S. Tsirkin
On Wed, May 22, 2013 at 04:04:48PM +0200, Arnd Bergmann wrote: On Wednesday 22 May 2013, Russell King - ARM Linux wrote: On Wed, May 22, 2013 at 11:25:36AM +0200, Arnd Bergmann wrote: Given the most commonly used functions and a couple of architectures I'm familiar with, these are the

Re: [PATCH v2 10/10] kernel: might_fault does not imply might_sleep

2013-05-22 Thread Michael S. Tsirkin
On Thu, May 16, 2013 at 08:40:41PM +0200, Peter Zijlstra wrote: On Thu, May 16, 2013 at 02:16:10PM +0300, Michael S. Tsirkin wrote: There are several ways to make sure might_fault calling function does not sleep. One is to use it on kernel or otherwise locked memory - apparently nfs

Re: [PATCH v2 10/10] kernel: might_fault does not imply might_sleep

2013-05-22 Thread Michael S. Tsirkin
On Tue, May 21, 2013 at 01:57:34PM +0200, Peter Zijlstra wrote: On Sun, May 19, 2013 at 12:35:26PM +0300, Michael S. Tsirkin wrote: --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -198,7 +198,6 @@ void might_fault(void); #else static inline void might_fault(void

Re: [PATCH v2 07/10] powerpc: uaccess s/might_sleep/might_fault/

2013-05-24 Thread Michael S. Tsirkin
On Wed, May 22, 2013 at 03:59:01PM +0200, Arnd Bergmann wrote: On Thursday 16 May 2013, Michael S. Tsirkin wrote: @@ -178,7 +178,7 @@ do { \ long __pu_err; \ __typeof__

Re: [PATCH v2 07/10] powerpc: uaccess s/might_sleep/might_fault/

2013-05-24 Thread Michael S. Tsirkin
On Fri, May 24, 2013 at 04:00:32PM +0300, Michael S. Tsirkin wrote: On Wed, May 22, 2013 at 03:59:01PM +0200, Arnd Bergmann wrote: On Thursday 16 May 2013, Michael S. Tsirkin wrote: @@ -178,7 +178,7 @@ do { \ long

[PATCH v3 07/11] powerpc: uaccess s/might_sleep/might_fault/

2013-05-24 Thread Michael S. Tsirkin
the kernel addr check. Will be considered as a further optimization in future. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- arch/powerpc/include/asm/uaccess.h | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/arch/powerpc/include/asm/uaccess.h b/arch

[PATCH v3-resend 07/11] powerpc: uaccess s/might_sleep/might_fault/

2013-05-26 Thread Michael S. Tsirkin
the kernel addr check. Will be considered as a further optimization in future. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- arch/powerpc/include/asm/uaccess.h | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/arch/powerpc/include/asm/uaccess.h b/arch

[PATCH-RFC 01/10] lib: move GENERIC_IOMAP to lib/Kconfig

2011-11-24 Thread Michael S. Tsirkin
define GENERIC_IOMAP in a central location instead of all architectures. This will be helpful for the follow-up patch which makes it select other configs. Code is also a bit shorter this way. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- arch/alpha/Kconfig |4 arch

[PATCH-RFC 02/10] lib: add GENERIC_PCI_IOMAP

2011-11-24 Thread Michael S. Tsirkin
Many architectures want a generic pci_iomap but not the rest of iomap.c. Split that to a separate .c file and add a new config symbol. select automatically by GENERIC_IOMAP. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- include/asm-generic/io.h|5 +-- include/asm-generic

[PATCH-RFC 03/10] alpha: switch to GENERIC_PCI_IOMAP

2011-11-24 Thread Michael S. Tsirkin
/io.h defines ioremap_nocache same as ioremap. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- arch/alpha/Kconfig |1 + arch/alpha/kernel/pci.c | 26 +- 2 files changed, 2 insertions(+), 25 deletions(-) diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig

[PATCH-RFC 04/10] arm: switch to GENERIC_PCI_IOMAP

2011-11-24 Thread Michael S. Tsirkin
arm copied pci_iomap from generic code, probably to avoid pulling the rest of iomap.c in. Since that's in a separate file now, we can reuse the common implementation. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- arch/arm/Kconfig |1 + arch/arm/include/asm/io.h |2

[PATCH-RFC 05/10] microblaze: switch to GENERIC_PCI_IOMAP

2011-11-24 Thread Michael S. Tsirkin
/microblaze/include/asm/io.h defines ioremap_nocache same as ioremap. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- arch/microblaze/Kconfig |1 + arch/microblaze/pci/iomap.c | 19 --- 2 files changed, 1 insertions(+), 19 deletions(-) diff --git a/arch/microblaze/Kconfig

[PATCH-RFC 06/10] mips: switch to GENERIC_PCI_IOMAP

2011-11-24 Thread Michael S. Tsirkin
mips copied pci_iomap from generic code, probably to avoid pulling the rest of iomap.c in. Since that's in a separate file now, we can reuse the common implementation. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- arch/mips/Kconfig |1 + arch/mips/lib/iomap-pci.c | 26

[PATCH-RFC 07/10] parisc: switch to GENERIC_PCI_IOMAP

2011-11-24 Thread Michael S. Tsirkin
parisc copied pci_iomap from generic code, probably to avoid pulling the rest of iomap.c in. Since that's in a separate file now, we can reuse the common implementation. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- arch/parisc/Kconfig |1 + arch/parisc/lib/iomap.c | 23

[PATCH-RFC 09/10] sh: switch to GENERIC_PCI_IOMAP

2011-11-24 Thread Michael S. Tsirkin
sh copied pci_iomap from generic code, probably to avoid pulling the rest of iomap.c in. Since that's in a separate file now, we can reuse the common implementation. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- arch/sh/Kconfig |1 + arch/sh/drivers/pci/pci.c | 23

[PATCH-RFC 10/10] sparc: switch to GENERIC_PCI_IOMAP

2011-11-24 Thread Michael S. Tsirkin
sparc copied pci_iomap from generic code, probably to avoid pulling the rest of iomap.c in. Since that's in a separate file now, we can reuse the common implementation. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- arch/sparc/Kconfig |1 + arch/sparc/include/asm/io_32.h

Re: [PATCH-RFC 02/10] lib: add GENERIC_PCI_IOMAP

2011-11-27 Thread Michael S. Tsirkin
On Fri, Nov 25, 2011 at 11:54:55AM +1100, Stephen Rothwell wrote: Hi Michael, On Thu, 24 Nov 2011 22:17:02 +0200 Michael S. Tsirkin m...@redhat.com wrote: diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h index 9120887..c8a67345 100644 --- a/include/asm-generic/io.h

Re: [PATCH-RFC 08/10] powerpc: switch to GENERIC_PCI_IOMAP

2011-12-04 Thread Michael S. Tsirkin
On Thu, Nov 24, 2011 at 10:19:54PM +0200, Michael S. Tsirkin wrote: powerpc copied pci_iomap from generic code, probably to avoid pulling the rest of iomap.c in. Since that's in a separate file now, we can reuse the common implementation. The only difference is handling of nocache flag

Re: [PATCH-RFC 08/10] powerpc: switch to GENERIC_PCI_IOMAP

2011-12-04 Thread Michael S. Tsirkin
On Mon, Dec 05, 2011 at 07:52:01AM +1100, Benjamin Herrenschmidt wrote: On Sun, 2011-12-04 at 12:48 +0200, Michael S. Tsirkin wrote: On Thu, Nov 24, 2011 at 10:19:54PM +0200, Michael S. Tsirkin wrote: powerpc copied pci_iomap from generic code, probably to avoid pulling the rest

Re: [PATCH-RFC 06/10] mips: switch to GENERIC_PCI_IOMAP

2012-01-29 Thread Michael S. Tsirkin
On Sat, Jan 28, 2012 at 02:38:10PM -0800, Kevin Cernekee wrote: On Thu, Nov 24, 2011 at 12:18 PM, Michael S. Tsirkin m...@redhat.com wrote: mips copied pci_iomap from generic code, probably to avoid pulling the rest of iomap.c in.  Since that's in a separate file now, we can reuse

[PATCH 13/18] powerpc/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/powerpc/include/asm/uaccess.h | 6 +++--- 1 file

Re: [PATCH 13/18] powerpc/uaccess: fix sparse errors

2014-12-16 Thread Michael S. Tsirkin
On Sun, Dec 14, 2014 at 06:52:51PM +0200, 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 that up using __force. Signed-off-by: Michael S. Tsirkin m

[PATCH 04/86] powerpc/pci: use uapi/linux/pci_ids.h directly

2015-03-29 Thread Michael S. Tsirkin
Header moved from linux/pci_ids.h to uapi/linux/pci_ids.h, use the new header directly so we can drop the wrapper in include/linux/pci_ids.h. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- arch/powerpc/platforms/embedded6xx/mpc10x.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions

[PATCH 51/86] cxl: use uapi/linux/pci_ids.h directly

2015-03-29 Thread Michael S. Tsirkin
Header moved from linux/pci_ids.h to uapi/linux/pci_ids.h, use the new header directly so we can drop the wrapper in include/linux/pci_ids.h. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- drivers/misc/cxl/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers

[PATCH 33/86] edac/pasemi: use uapi/linux/pci_ids.h directly

2015-03-29 Thread Michael S. Tsirkin
Header moved from linux/pci_ids.h to uapi/linux/pci_ids.h, use the new header directly so we can drop the wrapper in include/linux/pci_ids.h. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- drivers/edac/pasemi_edac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH 43/86] macintosh: use uapi/linux/pci_ids.h directly

2015-03-29 Thread Michael S. Tsirkin
Header moved from linux/pci_ids.h to uapi/linux/pci_ids.h, use the new header directly so we can drop the wrapper in include/linux/pci_ids.h. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- drivers/macintosh/macio_asic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

Re: [PATCH v2 2/2] powerpc/PCI: Disable MSI/MSI-X interrupts at PCI probe time in OF case

2015-09-06 Thread Michael S. Tsirkin
On Fri, Sep 04, 2015 at 08:17:12PM -0300, Guilherme G. Piccoli wrote: > Hello Bjorn, > > >of_create_pci_dev() already has a lot of code that duplicates > >pci_setup_device(), and it's a shame to add more. There's also a sparc > >version of of_create_pci_dev() that presumably has the same problem

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

2016-01-04 Thread Michael S. Tsirkin
On Mon, Jan 04, 2016 at 04:03:39PM +0100, Martin Schwidefsky wrote: > On Mon, 4 Jan 2016 14:20:42 +0100 > Peter Zijlstra <pet...@infradead.org> wrote: > > > On Thu, Dec 31, 2015 at 09:06:30PM +0200, Michael S. Tsirkin wrote: > > > On s390 read_barrier_dep

Re: [PATCH 3/3] checkpatch: add virt barriers

2016-01-04 Thread Michael S. Tsirkin
On Mon, Jan 04, 2016 at 08:47:53AM -0800, Joe Perches wrote: > On Mon, 2016-01-04 at 13:37 +0200, Michael S. Tsirkin wrote: > > Add virt_ barriers to list of barriers to check for > > presence of a comment. > > Are these virt_ barriers used anywhere? > > I see som

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

2016-01-04 Thread Michael S. Tsirkin
On Mon, Jan 04, 2016 at 02:54:20PM +0100, Peter Zijlstra wrote: > 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 wrot

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 1/3] checkpatch.pl: add missing memory barriers

2016-01-04 Thread Michael S. Tsirkin
On Mon, Jan 04, 2016 at 08:07:40AM -0800, Joe Perches wrote: > On Mon, 2016-01-04 at 13:36 +0200, Michael S. Tsirkin wrote: > > SMP-only barriers were missing in checkpatch.pl > > > > Refactor code slightly to make adding more variants easier. > > > > Sig

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 2/3] checkpatch: check for __smp outside barrier.h

2016-01-04 Thread Michael S. Tsirkin
ch test so it will trigger a warning. Reported-by: Russell King <li...@arm.linux.org.uk> Signed-off-by: Michael S. Tsirkin <m...@redhat.com> --- scripts/checkpatch.pl | 11 +++ 1 file changed, 11 insertions(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 0

[PATCH 3/3] checkpatch: add virt barriers

2016-01-04 Thread Michael S. Tsirkin
Add virt_ barriers to list of barriers to check for presence of a comment. Signed-off-by: Michael S. Tsirkin <m...@redhat.com> --- scripts/checkpatch.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index e3f9ad9..5

[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 15/32] powerpc: define __smp_xxx

2016-01-05 Thread Michael S. Tsirkin
On Tue, Jan 05, 2016 at 09:36:55AM +0800, Boqun Feng wrote: > Hi Michael, > > On Thu, Dec 31, 2015 at 09:07:42PM +0200, Michael S. Tsirkin wrote: > > This defines __smp_xxx barriers for powerpc > > for use by virtualization. > > > > smp_xxx barriers are removed

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

2016-01-05 Thread Michael S. Tsirkin
On Tue, Jan 05, 2016 at 09:13:19AM +0100, Martin Schwidefsky wrote: > On Mon, 4 Jan 2016 22:18:58 +0200 > "Michael S. Tsirkin" <m...@redhat.com> wrote: > > > On Mon, Jan 04, 2016 at 02:45:25PM +0100, Peter Zijlstra wrote: > > > On Thu, Dec 31, 2015 at 09

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 17/32] arm: define __smp_xxx

2016-01-03 Thread Michael S. Tsirkin
On Sat, Jan 02, 2016 at 11:24:38AM +, Russell King - ARM Linux wrote: > On Thu, Dec 31, 2015 at 09:07:59PM +0200, Michael S. Tsirkin wrote: > > This defines __smp_xxx barriers for arm, > > for use by virtualization. > > > > smp_xxx barriers are removed as they are &

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

2016-01-05 Thread Michael S. Tsirkin
On Tue, Jan 05, 2016 at 05:53:41PM +0800, Boqun Feng wrote: > On Tue, Jan 05, 2016 at 10:51:17AM +0200, Michael S. Tsirkin wrote: > > On Tue, Jan 05, 2016 at 09:36:55AM +0800, Boqun Feng wrote: > > > Hi Michael, > > > > > > On Thu, Dec 31, 2015 at 09:07:

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

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

2016-01-05 Thread Michael S. Tsirkin
On Mon, Jan 04, 2016 at 01:59:34PM +, Russell King - ARM Linux wrote: > On Mon, Jan 04, 2016 at 02:54:20PM +0100, Peter Zijlstra wrote: > > 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 wro

[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 14/32] asm-generic: add __smp_xxx wrappers

2015-12-31 Thread Michael S. Tsirkin
ones or barrier() depending on SMP, identically for all architectures. We keep ifndef guards around them for now - once/if all architectures are converted to use the generic code, we'll be able to remove these. Suggested-by: Peter Zijlstra <pet...@infradead.org> Signed-off-by: Michael S. Tsir

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

2015-12-31 Thread Michael S. Tsirkin
As on most architectures, on x86 read_barrier_depends and smp_read_barrier_depends are empty. Drop the local definitions and pull the generic ones from asm-generic/barrier.h instead: they are identical. This is in preparation to refactoring this code area. Signed-off-by: Michael S. Tsirkin &l

[PATCH v2 25/32] tile: define __smp_xxx

2015-12-31 Thread Michael S. Tsirkin
This defines __smp_xxx barriers for tile, for use by virtualization. Some smp_xxx barriers are removed as they are defined correctly by asm-generic/barriers.h Note: for 32 bit, keep smp_mb__after_atomic around since it's faster than the generic implementation. Signed-off-by: Michael S. Tsirkin

[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 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 07/32] sparc: reuse asm-generic/barrier.h

2015-12-31 Thread Michael S. Tsirkin
to the generic version, drop that as well. This is in preparation to refactoring this code area. Note: nop() was in processor.h and not in barrier.h as on other architectures. Nothing seems to depend on it being there though. Signed-off-by: Michael S. Tsirkin <m...@redhat.com> Acked-by: Arnd Be

[PATCH v2 22/32] s390: define __smp_xxx

2015-12-31 Thread Michael S. Tsirkin
This defines __smp_xxx barriers for s390, for use by virtualization. Some smp_xxx barriers are removed as they are defined correctly by asm-generic/barriers.h Note: smp_mb, smp_rmb and smp_wmb are defined as full barriers unconditionally on this architecture. Signed-off-by: Michael S. Tsirkin

[PATCH v2 21/32] mips: define __smp_xxx

2015-12-31 Thread Michael S. Tsirkin
/barriers.h) and smp_mb__before_llsc (for use elsewhere on this architecture). Signed-off-by: Michael S. Tsirkin <m...@redhat.com> Acked-by: Arnd Bergmann <a...@arndb.de> --- arch/mips/include/asm/barrier.h | 26 ++ 1 file changed, 14 insertions(+), 12 deletions(-)

[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 06/32] s390: 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/s390/include/asm/barrier.h | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/arch/s390/include/asm/barrier.h b/arch/s390/include/asm/barrier.h index 7ffd0b1..c358c31 10064

[PATCH v2 19/32] ia64: define __smp_xxx

2015-12-31 Thread Michael S. Tsirkin
This defines __smp_xxx barriers for ia64, for use by virtualization. smp_xxx barriers are removed as they are defined correctly by asm-generic/barriers.h This reduces the amount of arch-specific boiler-plate code. Signed-off-by: Michael S. Tsirkin <m...@redhat.com> Acked-by: Tony Luck &

[PATCH v2 18/32] blackfin: define __smp_xxx

2015-12-31 Thread Michael S. Tsirkin
This defines __smp_xxx barriers for blackfin, 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/blackfin/include/asm/b

[PATCH v2 17/32] arm: define __smp_xxx

2015-12-31 Thread Michael S. Tsirkin
This defines __smp_xxx barriers for arm, for use by virtualization. smp_xxx barriers are removed as they are defined correctly by asm-generic/barriers.h This reduces the amount of arch-specific boiler-plate code. Signed-off-by: Michael S. Tsirkin <m...@redhat.com> Acked-by: Arnd Be

[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 28/32] asm-generic: implement virt_xxx memory barriers

2015-12-31 Thread Michael S. Tsirkin
-by: David Miller <da...@davemloft.net> Signed-off-by: Michael S. Tsirkin <m...@redhat.com> --- include/asm-generic/barrier.h | 11 +++ Documentation/memory-barriers.txt | 28 +++- 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/include

[PATCH v2 29/32] Revert "virtio_ring: Update weak barriers to use dma_wmb/rmb"

2015-12-31 Thread Michael S. Tsirkin
for !SMP. We switch to __smp_XXX barriers in the next patch. Cc: Peter Zijlstra <pet...@infradead.org> Cc: Alexander Duyck <alexander.du...@gmail.com> Signed-off-by: Michael S. Tsirkin <m...@redhat.com> --- include/linux/virtio_ring.h | 23 +++ 1 file changed, 1

[PATCH v2 32/32] virtio_ring: use virt_store_mb

2015-12-31 Thread Michael S. Tsirkin
. Signed-off-by: Michael S. Tsirkin <m...@redhat.com> --- include/linux/virtio_ring.h | 12 drivers/virtio/virtio_ring.c | 15 +-- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/include/linux/virtio_ring.h b/include/linux/virtio_ring.h index f3fa55b..3

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

2015-12-31 Thread Michael S. Tsirkin
-by: Michael S. Tsirkin <m...@redhat.com> --- arch/sh/include/asm/barrier.h | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/arch/sh/include/asm/barrier.h b/arch/sh/include/asm/barrier.h index f887c64..0cc5735 100644 --- a/arch/sh/include/asm/barrier.h +++ b/arch/sh/i

  1   2   3   >