[PATCH v3 2/2] powerpc: kvm: fix rare but potential deadlock scene

2013-11-07 Thread Liu Ping Fan
Since kvmppc_hv_find_lock_hpte() is called from both virtmode and realmode, so it can trigger the deadlock. Suppose the following scene: Two physical cpuM, cpuN, two VM instances A, B, each VM has a group of vcpus. If on cpuM, vcpu_A_1 holds bitlock X (HPTE_V_HVLOCK), then is switched out, and o

[PATCH v3 0/2] powerpc kvm: fix deadlock scene

2013-11-07 Thread Liu Ping Fan
v2->v3: introduce kvmppc_hv_unlock_hpte() to pair with kvmppc_hv_find_lock_hpte() and hide the preemption detail inside this pair from the callers Liu Ping Fan (2): powerpc: kvm: pair kvmppc_hv_find_lock_hpte with _unlock_hpte powerpc: kvm: fix rare but potential deadlock scene arch/powe

[PATCH v3 1/2] powerpc: kvm: pair kvmppc_hv_find_lock_hpte with _unlock_hpte

2013-11-07 Thread Liu Ping Fan
Highlight the lock pair for the reader. (and later it will the place to hide the detail about preemption disable) Signed-off-by: Liu Ping Fan --- arch/powerpc/include/asm/kvm_book3s.h | 1 + arch/powerpc/kvm/book3s_64_mmu_hv.c | 7 ++- arch/powerpc/kvm/book3s_hv_rm_mmu.c | 13 +

Re: [PATCH] powerpc: kvm: optimize "sc 0" as fast return

2013-11-07 Thread Liu ping fan
On Fri, Nov 8, 2013 at 12:11 PM, Benjamin Herrenschmidt wrote: > On Fri, 2013-11-08 at 15:05 +1100, Benjamin Herrenschmidt wrote: >> On Fri, 2013-11-08 at 04:10 +0100, Alexander Graf wrote: >> > On 08.11.2013, at 03:44, Liu Ping Fan wrote: >> > >> > > syscall is a very common behavior inside gues

Re: [PATCH] powerpc: kvm: optimize "sc 0" as fast return

2013-11-07 Thread Liu ping fan
On Fri, Nov 8, 2013 at 11:10 AM, Alexander Graf wrote: > > On 08.11.2013, at 03:44, Liu Ping Fan wrote: > >> syscall is a very common behavior inside guest, and this patch >> optimizes the path for the emulation of BOOK3S_INTERRUPT_SYSCALL, >> so hypervisor can return to guest without heavy exit,

Re: [RFC] arch: Introduce new TSO memory barrier smp_tmb()

2013-11-07 Thread Mathieu Desnoyers
* Peter Zijlstra (pet...@infradead.org) wrote: [...] Hi Peter, Looking at this simplified version of perf's ring buffer synchronization, I get concerned about the following issue: > /* > * One important detail is that the kbuf part and the kbuf_writer() are > * strictly per cpu and we can thu

Re: [PATCH] powerpc: kvm: optimize "sc 0" as fast return

2013-11-07 Thread Benjamin Herrenschmidt
On Fri, 2013-11-08 at 15:05 +1100, Benjamin Herrenschmidt wrote: > On Fri, 2013-11-08 at 04:10 +0100, Alexander Graf wrote: > > On 08.11.2013, at 03:44, Liu Ping Fan wrote: > > > > > syscall is a very common behavior inside guest, and this patch > > > optimizes the path for the emulation of BOOK3

Re: [PATCH] powerpc: kvm: optimize "sc 0" as fast return

2013-11-07 Thread Benjamin Herrenschmidt
On Fri, 2013-11-08 at 04:10 +0100, Alexander Graf wrote: > On 08.11.2013, at 03:44, Liu Ping Fan wrote: > > > syscall is a very common behavior inside guest, and this patch > > optimizes the path for the emulation of BOOK3S_INTERRUPT_SYSCALL, > > so hypervisor can return to guest without heavy ex

Re: [PATCH] powerpc: kvm: optimize "sc 0" as fast return

2013-11-07 Thread Alexander Graf
On 08.11.2013, at 03:44, Liu Ping Fan wrote: > syscall is a very common behavior inside guest, and this patch > optimizes the path for the emulation of BOOK3S_INTERRUPT_SYSCALL, > so hypervisor can return to guest without heavy exit, i.e, no need > to swap TLB, HTAB,.. etc The syscall exit you

Re: [PATCH v11 3/3] DMA: Freescale: update driver to support 8-channel DMA engine

2013-11-07 Thread Dan Williams
On Mon, Nov 4, 2013 at 6:31 PM, Hongbo Zhang wrote: > Hi Vinod Koul and Dan Williams, > Ping? > Not much to review from the dmaengine side, just one question below. It would be helpful if you can send these to the new dmaengine patchwork at dmaeng...@vger.kernel.org with the Acks you have already

[PATCH] powerpc: kvm: optimize "sc 0" as fast return

2013-11-07 Thread Liu Ping Fan
syscall is a very common behavior inside guest, and this patch optimizes the path for the emulation of BOOK3S_INTERRUPT_SYSCALL, so hypervisor can return to guest without heavy exit, i.e, no need to swap TLB, HTAB,.. etc Signed-off-by: Liu Ping Fan --- Compiled, but lack of bare metal, I have not

Re: [PATCH v2 2/2] powerpc/kvm: remove redundant assignment

2013-11-07 Thread Liu ping fan
On Thu, Nov 7, 2013 at 6:06 PM, Alexander Graf wrote: > > On 07.11.2013, at 07:22, Liu Ping Fan wrote: > >> ret is assigned twice with the same value, so remove the later one. >> >> Signed-off-by: Liu Ping Fan >> Acked-by: Paul Mackerras > > I suppose my last request for a patch description was

Re: [PATCH v2 1/2] powerpc/kvm: fix rare but potential deadlock scene

2013-11-07 Thread Liu ping fan
On Thu, Nov 7, 2013 at 5:54 PM, Alexander Graf wrote: > > On 07.11.2013, at 07:22, Liu Ping Fan wrote: > >> Since kvmppc_hv_find_lock_hpte() is called from both virtmode and >> realmode, so it can trigger the deadlock. >> >> Suppose the following scene: >> >> Two physical cpuM, cpuN, two VM insta

Re: [PATCH] powerpc/85xx: don't init the mpic ipi for the SoC which has doorbell support

2013-11-07 Thread Kevin Hao
On Thu, Nov 07, 2013 at 11:34:51AM -0600, Scott Wood wrote: > On Thu, 2013-11-07 at 15:17 +0800, Kevin Hao wrote: > > It makes no sense to initialize the mpic ipi for the SoC which has > > doorbell support. So set the smp_85xx_ops.probe to NULL for this > > case. Since the smp_85xx_ops.probe is als

Re: [PATCHv2 5/8] ASoC: SGTL5000: Enhance the SGTL5000 codec driver about regulator.

2013-11-07 Thread Mark Brown
On Thu, Nov 07, 2013 at 03:01:02AM +, Li Xiubo wrote: > > > The SGTL5000 is based on regulators and when it is disabled, there > > > will be an error returns directly while the SGTL5000 codec is probing. > > What makes you say this? > static int ldo_regulator_register(struct snd_soc_codec *

Re: [PATCH] powerpc/85xx: don't init the mpic ipi for the SoC which has doorbell support

2013-11-07 Thread Scott Wood
On Thu, 2013-11-07 at 15:17 +0800, Kevin Hao wrote: > It makes no sense to initialize the mpic ipi for the SoC which has > doorbell support. So set the smp_85xx_ops.probe to NULL for this > case. Since the smp_85xx_ops.probe is also used in function > smp_85xx_setup_cpu() to check if we need to inv

Re: [PATCH 4/7] IBM Akebono: Add support to the OHCI platform driver for Akebono

2013-11-07 Thread Alan Stern
On Thu, 7 Nov 2013, Alistair Popple wrote: > Thanks. Based on the discussion for the EHCI driver I would like to change > the > compatibility string to "usb-ochi" (instead of "ibm,akebono-ohci"). Are you > still happy for me to add the Acked-by with the alternate compatibility (and > of course

re: powerpc: Hugetlb for BookE

2013-11-07 Thread Dan Carpenter
Hello Becky Bruce, This is a semi-automatic email about new static checker warnings. The patch 41151e77a4d9: "powerpc: Hugetlb for BookE" from Jun 28, 2011, leads to the following Smatch complaint: arch/powerpc/mm/hugetlbpage-book3e.c:120 flush_hugetlb_page() warn: variable dereference

Re: [RFC] arch: Introduce new TSO memory barrier smp_tmb()

2013-11-07 Thread Peter Zijlstra
On Thu, Nov 07, 2013 at 11:17:41AM +, Will Deacon wrote: > Hi Peter, > > Couple of minor fixes on the arm64 side... > > On Wed, Nov 06, 2013 at 01:57:36PM +, Peter Zijlstra wrote: > > --- a/arch/arm64/include/asm/barrier.h > > +++ b/arch/arm64/include/asm/barrier.h > > @@ -35,11 +35,59 @@

[PATCH v2] powerpc: memcpy optimization for 64bit LE

2013-11-07 Thread Philippe Bergheaud
Unaligned stores take alignment exceptions on POWER7 running in little-endian. This is a dumb little-endian base memcpy that prevents unaligned stores. Once booted the feature fixup code switches over to the VMX copy loops (which are already endian safe). The question is what we do before that sw

Re: [PATCH RFC v5 3/5] dma: of: Add common xlate function for matching by channel id

2013-11-07 Thread Alexander Popov
2013/11/1 Arnd Bergmann : > On Friday 01 November 2013, Alexander Popov wrote: >> + * of_dma_xlate_by_chan_id - Translate dt property to DMA channel by >> channel id >> + * @dma_spec:pointer to DMA specifier as found in the device tree >> + * @of_dma: pointer to DMA controller data > > Th

Re: [RFC] arch: Introduce new TSO memory barrier smp_tmb()

2013-11-07 Thread Will Deacon
Hi Peter, Couple of minor fixes on the arm64 side... On Wed, Nov 06, 2013 at 01:57:36PM +, Peter Zijlstra wrote: > --- a/arch/arm64/include/asm/barrier.h > +++ b/arch/arm64/include/asm/barrier.h > @@ -35,11 +35,59 @@ > #define smp_mb() barrier() > #define smp_rmb() barrier() > #

Re: [PATCH v2 2/2] powerpc/kvm: remove redundant assignment

2013-11-07 Thread Alexander Graf
On 07.11.2013, at 07:22, Liu Ping Fan wrote: > ret is assigned twice with the same value, so remove the later one. > > Signed-off-by: Liu Ping Fan > Acked-by: Paul Mackerras I suppose my last request for a patch description was slightly too abbreviated :). Sorry about that. Imagine you are

Re: [PATCH v2 1/2] powerpc/kvm: fix rare but potential deadlock scene

2013-11-07 Thread Alexander Graf
On 07.11.2013, at 07:22, Liu Ping Fan wrote: > Since kvmppc_hv_find_lock_hpte() is called from both virtmode and > realmode, so it can trigger the deadlock. > > Suppose the following scene: > > Two physical cpuM, cpuN, two VM instances A, B, each VM has a group of vcpus. > > If on cpuM, vcpu_

Re: [PATCH 3/3] powerpc/kvm: remove redundant assignment

2013-11-07 Thread Benjamin Herrenschmidt
On Thu, 2013-11-07 at 09:14 +0100, Alexander Graf wrote: > > And ? An explanation isn't going to be clearer than the code in that > > case ... > > It's pretty non-obvious when you do a git show on that patch in 1 year > from now, as the redundancy is out of scope of what the diff shows. And ? How

Re: [PATCH 3/3] powerpc/kvm: remove redundant assignment

2013-11-07 Thread Alexander Graf
Am 07.11.2013 um 08:55 schrieb Benjamin Herrenschmidt : > On Thu, 2013-11-07 at 08:52 +0100, Alexander Graf wrote: >> Am 06.11.2013 um 20:58 schrieb Benjamin Herrenschmidt >> : >> >>> On Wed, 2013-11-06 at 12:24 +0100, Alexander Graf wrote: On 05.11.2013, at 08:42, Liu Ping Fan wrote: >