what is the state about "[v2] ppc64 boot: Wait for boot cpu to show up if nr_cpus limit is about to hit"

2017-11-27 Thread Liu ping fan
Hi, I can not find the history about: https://patchwork.ozlabs.org/patch/577193/ Can we have this patch? Thanks, Pingfan

Re: [PATCH] powerpc/pseries hotplug: prevent the reserved mem from removing

2017-04-27 Thread Liu ping fan
On Fri, Apr 28, 2017 at 2:06 AM, Hari Bathini wrote: > Hi Pingfan, > > > On Thursday 27 April 2017 01:13 PM, Pingfan Liu wrote: >> >> E.g after fadump reserves mem regions, these regions should not be removed >> before fadump explicitly free them. >> Signed-off-by: Pingfan Liu >> --- >> arch/po

Re: a question about powervm

2016-12-19 Thread Liu ping fan
On Mon, Dec 19, 2016 at 5:58 PM, Michal Suchanek wrote: > Hello, > > On 19 December 2016 at 10:09, Liu ping fan wrote: >> Hi guys, >> >> I am using a pSeries. It runs on powerVM. >> My question is whether the cpuX under /sys/devices/system/cpu >> correspo

a question about powervm

2016-12-19 Thread Liu ping fan
Hi guys, I am using a pSeries. It runs on powerVM. My question is whether the cpuX under /sys/devices/system/cpu corresponds to a real cpu or not. I think it is not the same as the cpu on kvm-guest, which is emulated by a linux process. Thx.

Re: fadump: a question about "ibm,configure-kernel-dump"

2016-11-18 Thread Liu ping fan
Thank you very much. I am more clear about it now. On Fri, Nov 18, 2016 at 5:29 PM, Michael Ellerman wrote: > Liu ping fan writes: > >> I have an ibm-p8-garrison machine. But I can not find a node >> "ibm,configure-kernel-dump" under /proc/device-tree. Does garris

fadump: a question about "ibm,configure-kernel-dump"

2016-11-17 Thread Liu ping fan
I have an ibm-p8-garrison machine. But I can not find a node "ibm,configure-kernel-dump" under /proc/device-tree. Does garrison machine support fadump? And normally, which component in open-power presents the "ibm,configure-kernel-dump" ? I had though it was in skiboot gitree or garrison-xml git

Re: [RFC 11/11] powerpc: kvm: Kconfig add an option for enabling secondary hwthread

2014-11-17 Thread Liu ping fan
On Mon, Oct 27, 2014 at 2:44 PM, Preeti U Murthy wrote: > On 10/17/2014 01:00 AM, kernelf...@gmail.com wrote: >> Signed-off-by: Liu Ping Fan >> --- >> arch/powerpc/kvm/Kconfig | 4 >> 1 file changed, 4 insertions(+) >> >> diff --git a/arch/powerpc

Re: [RFC 09/11] powerpc: kvm: handle time base on secondary hwthread

2014-11-17 Thread Liu ping fan
t with elapse >> time. >> >> Signed-off-by: Liu Ping Fan >> --- >> arch/powerpc/kvm/book3s_hv_rmhandlers.S | 6 ++ >> 1 file changed, 6 insertions(+) >> >> diff --git a/arch/powerpc/kvm/book3s_hv_rmhandlers.S >> b/arch/powerpc/kvm/book3s

Re: [RFC 06/11] powerpc: kvm: introduce online in paca to indicate whether cpu is needed by host

2014-11-17 Thread Liu ping fan
behavior for dedicated KVM env. Achieve this by setting >> paca->online as false. >> >> Signed-off-by: Liu Ping Fan >> --- >> arch/powerpc/include/asm/paca.h | 3 +++ >> arch/powerpc/kernel/asm-offsets.c | 3 +++ >> arch/powerpc/kernel/

Re: [RFC 04/11] powerpc: kvm: introduce a kthread on primary thread to anti tickless

2014-11-17 Thread Liu ping fan
thread on primary, the secondary can resort to anti_tickless >> to keep the primary out of tickless mode. >> (I thought that anti_tickless thread can goto NAP, so we can let the >> secondary run). >> >> Signed-off-by: Liu Ping Fan >> --- >> arch/powerpc/kern

Re: [RFC 03/11] powerpc: kvm: add interface to control kvm function on a core

2014-11-17 Thread Liu ping fan
? Isn't this a saner way ? Consider the scene: coreA and coreB, we want to enable KVM on coreA, while keeping coreB unchanged. In fact, I try to acheive something un-symmetric on the platform. Do you think it is an justification? >> >> Signed-of

Re: [RFC 01/11] sched: introduce sys_cpumask in tsk to adapt asymmetric system

2014-11-17 Thread Liu ping fan
; cpus online when running powerKVM to give more power when switching back >> to host, so introduce sys_allowed cpumask to reflect the cpuset which >> the vcpu thread can run on. >> >> Signed-off-by: Liu Ping Fan >> --- >> include/linux/init_task.h | 1 + >

Re: [PATCH] powerpc: kvm: make the setup of hpte under the protection of KVMPPC_RMAP_LOCK_BIT

2014-07-29 Thread Liu ping fan
On Tue, Jul 29, 2014 at 2:57 PM, Benjamin Herrenschmidt wrote: > On Mon, 2014-07-28 at 15:58 +0800, Liu ping fan wrote: >> Hope I am right. Take the following seq as an example >> >> if (hptep[0] & HPTE_V_VALID) { >> /* HPTE was previously valid, so we need to

Re: [PATCH] powerpc: kvm: make the setup of hpte under the protection of KVMPPC_RMAP_LOCK_BIT

2014-07-28 Thread Liu ping fan
emory"); Thx. Fan On Mon, Jul 28, 2014 at 2:42 PM, Benjamin Herrenschmidt wrote: > On Mon, 2014-07-28 at 14:09 +0800, Liu Ping Fan wrote: >> In current code, the setup of hpte is under the risk of race with >> mmu_notifier_invalidate, i.e we may setup a hpte with a invalid pf

[PATCH] powerpc: kvm: make the setup of hpte under the protection of KVMPPC_RMAP_LOCK_BIT

2014-07-27 Thread Liu Ping Fan
In current code, the setup of hpte is under the risk of race with mmu_notifier_invalidate, i.e we may setup a hpte with a invalid pfn. Resolve this issue by sync the two actions by KVMPPC_RMAP_LOCK_BIT. Signed-off-by: Liu Ping Fan --- arch/powerpc/kvm/book3s_64_mmu_hv.c | 15 ++- 1

[PATCH v4] powerpc: kvm: make _PAGE_NUMA take effect

2014-04-15 Thread Liu Ping Fan
f a pte is marked with _PAGE_NUMA, it will NOT be mapped in real mode, instead, it will be mapped in virt mode and have the opportunity to be checked with placement. Signed-off-by: Liu Ping Fan Reviewed-by: Aneesh Kumar K.V --- v4: more detail description --- arch/powerpc/kvm/book3s_hv_rm_mmu.c

Re: [PATCH v3] powerpc: kvm: make _PAGE_NUMA take effect

2014-04-14 Thread liu ping fan
On Mon, Apr 14, 2014 at 2:43 PM, Alexander Graf wrote: > > On 13.04.14 04:27, Liu ping fan wrote: >> >> On Fri, Apr 11, 2014 at 10:03 PM, Alexander Graf wrote: >>> >>> On 11.04.2014, at 13:45, Liu Ping Fan >>> wrote: >>>

Re: [PATCH v3] powerpc: kvm: make _PAGE_NUMA take effect

2014-04-12 Thread Liu ping fan
On Fri, Apr 11, 2014 at 10:03 PM, Alexander Graf wrote: > > On 11.04.2014, at 13:45, Liu Ping Fan wrote: > >> When we mark pte with _PAGE_NUMA we already call >> mmu_notifier_invalidate_range_start >> and mmu_notifier_invalidate_range_end, which will mark exis

[PATCH v3] powerpc: kvm: make _PAGE_NUMA take effect

2014-04-11 Thread Liu Ping Fan
When we mark pte with _PAGE_NUMA we already call mmu_notifier_invalidate_range_start and mmu_notifier_invalidate_range_end, which will mark existing guest hpte entry as HPTE_V_ABSENT. Now we need to do that when we are inserting new guest hpte entries. Signed-off-by: Liu Ping Fan Reviewed-by

Re: [PATCH v2] powernv: kvm: make _PAGE_NUMA take effect

2014-04-09 Thread Liu ping fan
On Mon, Apr 7, 2014 at 4:36 PM, Alexander Graf wrote: > > On 07.04.14 09:42, Aneesh Kumar K.V wrote: >> >> Alexander Graf writes: >> >>> On 03.04.14 04:36, Liu ping fan wrote: >>>> >>>> Hi Alex, could you help to pick up this patch? s

Re: [PATCH v2] powernv: kvm: make _PAGE_NUMA take effect

2014-04-02 Thread Liu ping fan
Hi Alex, could you help to pick up this patch? since v3.14 kernel can enable numa fault for powerpc. Thx, Fan On Mon, Jan 27, 2014 at 5:11 PM, Alexander Graf wrote: > > On 21.01.2014, at 10:42, Aneesh Kumar K.V > wrote: > >> Liu Ping Fan writes: >> >>> To

Re: [PATCH] mm: numa: bugfix for LAST_CPUPID_NOT_IN_PAGE_FLAGS

2014-02-27 Thread liu ping fan
On Fri, Feb 28, 2014 at 12:47 PM, Aneesh Kumar K.V wrote: > Andrew Morton writes: > >> On Wed, 26 Feb 2014 13:22:16 +0530 "Aneesh Kumar K.V" >> wrote: >> >>> Andrew Morton writes: >>> >>> > On Wed, 5 Feb 2014 09:25:46 +0800 Liu

Re: [PATCH] mm: numa: bugfix for LAST_CPUPID_NOT_IN_PAGE_FLAGS

2014-02-27 Thread liu ping fan
On Fri, Feb 28, 2014 at 7:41 AM, Andrew Morton wrote: > On Wed, 26 Feb 2014 13:22:16 +0530 "Aneesh Kumar K.V" > wrote: > >> Andrew Morton writes: >> >> > On Wed, 5 Feb 2014 09:25:46 +0800 Liu Ping Fan wrote: >> > >> >> When doin

Re: [PATCH] powerpc: ftrace: bugfix for test_24bit_addr

2014-02-25 Thread Liu ping fan
On Wed, Feb 26, 2014 at 12:35 PM, Ananth N Mavinakayanahalli wrote: > On Wed, Feb 26, 2014 at 10:23:01AM +0800, Liu Ping Fan wrote: >> The branch target should be the func addr, not the addr of func_descr_t. >> So using ppc_function_entry() to generate the right target addr. >

Re: [PATCH 0/4] powernv: kvm: numa fault improvement

2014-02-25 Thread Liu ping fan
munmap(pmap, PAGE_SIZE); shm_unlink(SHM_FNAME); } On Mon, Jan 20, 2014 at 10:48 PM, Alexander Graf wrote: > > On 15.01.2014, at 07:36, Liu ping fan wrote: > >> On Thu, Jan 9, 2014 at 8:08 PM, Alexander Graf wrote: >>> >>> On 11.12.2013, at 09:4

[PATCH] powerpc: ftrace: bugfix for test_24bit_addr

2014-02-25 Thread Liu Ping Fan
The branch target should be the func addr, not the addr of func_descr_t. So using ppc_function_entry() to generate the right target addr. Signed-off-by: Liu Ping Fan --- This bug will make ftrace fail to work. It can be triggered when the kernel size grows up. --- arch/powerpc/kernel/ftrace.c

Re: [PATCH 0/4] powernv: kvm: numa fault improvement

2014-01-22 Thread Liu ping fan
On Wed, Jan 22, 2014 at 1:18 PM, Aneesh Kumar K.V wrote: > Paul Mackerras writes: > >> On Mon, Jan 20, 2014 at 03:48:36PM +0100, Alexander Graf wrote: >>> >>> On 15.01.2014, at 07:36, Liu ping fan wrote: >>> >>> > On Thu, Jan 9, 2014

Re: [PATCH 0/4] powernv: kvm: numa fault improvement

2014-01-21 Thread Liu ping fan
On Tue, Jan 21, 2014 at 5:07 PM, Liu ping fan wrote: > On Tue, Jan 21, 2014 at 11:40 AM, Aneesh Kumar K.V > wrote: >> Liu ping fan writes: >> >>> On Mon, Jan 20, 2014 at 11:45 PM, Aneesh Kumar K.V >>> wrote: >>>> Liu ping fan writes: >>&

Re: [PATCH 0/4] powernv: kvm: numa fault improvement

2014-01-21 Thread Liu ping fan
On Tue, Jan 21, 2014 at 11:40 AM, Aneesh Kumar K.V wrote: > Liu ping fan writes: > >> On Mon, Jan 20, 2014 at 11:45 PM, Aneesh Kumar K.V >> wrote: >>> Liu ping fan writes: >>> >>>> On Thu, Jan 9, 2014 at 8:08 PM, Alexander Graf wrote: >>

[PATCH v2] powernv: kvm: make _PAGE_NUMA take effect

2014-01-21 Thread Liu Ping Fan
To make sure that on host, the pages marked with _PAGE_NUMA result in a fault when guest access them, we should force the checking when guest uses hypercall to setup hpte. Signed-off-by: Liu Ping Fan --- v2: It should be the reply to "[PATCH 2/4] powernv: kvm: make _PAGE_NUMA take e

Re: [PATCH 0/4] powernv: kvm: numa fault improvement

2014-01-20 Thread Liu ping fan
On Mon, Jan 20, 2014 at 11:45 PM, Aneesh Kumar K.V wrote: > Liu ping fan writes: > >> On Thu, Jan 9, 2014 at 8:08 PM, Alexander Graf wrote: >>> >>> On 11.12.2013, at 09:47, Liu Ping Fan wrote: >>> >>>> This series is based on Aneesh's

Re: [PATCH 0/4] powernv: kvm: numa fault improvement

2014-01-14 Thread Liu ping fan
On Thu, Jan 9, 2014 at 8:08 PM, Alexander Graf wrote: > > On 11.12.2013, at 09:47, Liu Ping Fan wrote: > >> This series is based on Aneesh's series "[PATCH -V2 0/5] powerpc: mm: Numa >> faults support for ppc64" >> >> For this series, I apply th

Re: [PATCH 1/3] powerpc: mm: make _PAGE_NUMA take effect

2013-12-11 Thread Liu ping fan
On Wed, Dec 11, 2013 at 5:50 PM, Benjamin Herrenschmidt wrote: > On Wed, 2013-12-11 at 16:50 +0800, Liu ping fan wrote: >> > why ? , All the hash routines do check for _PAGE_PRESENT via access >> > variable. >> > >> Going through __hash_page_4K(4k on 4k HW

Re: [PATCH 1/3] powerpc: mm: make _PAGE_NUMA take effect

2013-12-11 Thread Liu ping fan
On Thu, Dec 5, 2013 at 6:53 PM, Aneesh Kumar K.V wrote: > Liu Ping Fan writes: > >> To enable the do_numa_page(), we should not fix _PAGE_NUMA in >> hash_page(), so bail out for the case of pte_numa(). >> >> Signed-off-by: Liu Ping Fan >> --- >> ar

[PATCH 4/4] powernv: kvm: make the handling of _PAGE_NUMA faster for guest

2013-12-11 Thread Liu Ping Fan
The period check of _PAGE_NUMA can probably happen on the correctly placed page. For this case, when guest try to setup hpte in real mode, we try to resolve the numa fault in real mode, since the switch between guest context and host context costs too much. Signed-off-by: Liu Ping Fan --- arch

[PATCH 3/4] powernv: kvm: extend input param for lookup_linux_pte

2013-12-11 Thread Liu Ping Fan
It will be helpful for next patch Signed-off-by: Liu Ping Fan --- Can it be merged with the next patch? --- arch/powerpc/kvm/book3s_hv_rm_mmu.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/kvm/book3s_hv_rm_mmu.c b/arch/powerpc/kvm

[PATCH 2/4] powernv: kvm: make _PAGE_NUMA take effect

2013-12-11 Thread Liu Ping Fan
To make _PAGE_NUMA take effect, we should force the checking when guest uses hypercall to setup hpte. Signed-off-by: Liu Ping Fan --- arch/powerpc/kvm/book3s_hv_rm_mmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/kvm/book3s_hv_rm_mmu.c b/arch/powerpc/kvm

[PATCH 1/4] mm: export numa_migrate_prep()

2013-12-11 Thread Liu Ping Fan
powerpc will use it in fast path. Signed-off-by: Liu Ping Fan --- include/linux/mm.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/linux/mm.h b/include/linux/mm.h index 5ab0e22..420fb77 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -1092,6 +1092,8 @@ extern

[PATCH 0/4] powernv: kvm: numa fault improvement

2013-12-11 Thread Liu Ping Fan
) But for this series, I think that I have a good justification -- the fact of heavy cost when switching context between guest and host, which is well known. If my suppose is correct, will CCing k...@vger.kernel.org from next version. Liu Ping Fan (4): mm: export numa_migrate_prep() powernv:

Re: [PATCH 1/3] powerpc: mm: make _PAGE_NUMA take effect

2013-12-08 Thread Liu ping fan
On Mon, Dec 9, 2013 at 8:31 AM, Benjamin Herrenschmidt wrote: > On Thu, 2013-12-05 at 16:23 +0530, Aneesh Kumar K.V wrote: >> Liu Ping Fan writes: >> >> > To enable the do_numa_page(), we should not fix _PAGE_NUMA in >> > hash_page(), so bail out for the case of

Re: [PATCH 3/3] powerpc: mm: optimize for the correctly placed page

2013-12-05 Thread Liu ping fan
On Thu, Dec 5, 2013 at 6:58 PM, Aneesh Kumar K.V wrote: > Liu Ping Fan writes: > >> The period check of _PAGE_NUMA can probably trigger the check on >> the correctly placed page. For this case, we can just insert hpte and >> do fast exception return. > > I still d

[PATCH 3/3] powerpc: mm: optimize for the correctly placed page

2013-12-03 Thread Liu Ping Fan
The period check of _PAGE_NUMA can probably trigger the check on the correctly placed page. For this case, we can just insert hpte and do fast exception return. Signed-off-by: Liu Ping Fan --- arch/powerpc/mm/hash_utils_64.c | 34 +- 1 file changed, 33 insertions

[PATCH 2/3] mm: export numa_migrate_prep()

2013-12-03 Thread Liu Ping Fan
powerpc will use it in fast path. Signed-off-by: Liu Ping Fan --- include/linux/mm.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/linux/mm.h b/include/linux/mm.h index 5ab0e22..420fb77 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -1092,6 +1092,8 @@ extern

[PATCH 1/3] powerpc: mm: make _PAGE_NUMA take effect

2013-12-03 Thread Liu Ping Fan
To enable the do_numa_page(), we should not fix _PAGE_NUMA in hash_page(), so bail out for the case of pte_numa(). Signed-off-by: Liu Ping Fan --- arch/powerpc/mm/hash_utils_64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc

[PATCH 0/3] optimize for powerpc _PAGE_NUMA

2013-12-03 Thread Liu Ping Fan
I saw Aneesh had implemented Numa faults on ppc64. Most of them have been reviewed-by. So I just diff mine and his to form some trivial modification. Based on Aneesh's series "[PATCH -V2 0/5] powerpc: mm: Numa faults support for ppc64" Liu Ping Fan (3): powerpc: mm: make

[PATCH 2/2] powerpc: mm: change pgtable index size for 64K page

2013-11-20 Thread Liu Ping Fan
For 64K page, we waste half of the pte_t page. With this patch, after changing PGD_INDEX_SIZE from 12 to 11, PTE_INDEX_SIZE from 8 to 9, we can improve the usage of pte_t page and shrink the continuous phys size for pgd_t. Signed-off-by: Liu Ping Fan --- arch/powerpc/include/asm/pgtable-ppc64

[PATCH 1/2] powerpc: mm: use macro PGTABLE_EADDR_SIZE instead of digital

2013-11-20 Thread Liu Ping Fan
In case of extending the eaddr in future, use this macro PGTABLE_EADDR_SIZE to ease the maintenance of the code. Signed-off-by: Liu Ping Fan --- arch/powerpc/mm/slb_low.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/mm/slb_low.S b/arch/powerpc/mm/slb_low.S

Re: [PATCH RESEND v4] powerpc: kvm: fix rare but potential deadlock scene

2013-11-19 Thread Liu ping fan
On Tue, Nov 19, 2013 at 6:39 PM, Alexander Graf wrote: > > On 19.11.2013, at 07:12, 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: >

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

2013-11-18 Thread Liu Ping Fan
In some scene, e.g openstack CI, PR guest can trigger "sc 1" frequently, this patch optimizes the path by directly delivering BOOK3S_INTERRUPT_SYSCALL to HV guest, so powernv can return to HV guest without heavy exit, i.e, no need to swap TLB, HTAB,.. etc Signed-off-by: Liu Ping Fan -

[PATCH RESEND v4] powerpc: kvm: fix rare but potential deadlock scene

2013-11-18 Thread Liu Ping Fan
! deadlock happens Signed-off-by: Liu Ping Fan --- arch/powerpc/kvm/book3s_64_mmu_hv.c | 6 +- arch/powerpc/kvm/book3s_hv_rm_mmu.c | 4 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kvm/book3s_64_mmu_hv.c b/arch/powerpc/kvm/book3s_64_mmu_hv.c index 842f081

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

2013-11-17 Thread Liu Ping Fan
In some scene, e.g openstack CI, PR guest can trigger "sc 1" frequently, this patch optimizes the path by directly delivering BOOK3S_INTERRUPT_SYSCALL to HV guest, so powernv can return to HV guest without heavy exit, i.e, no need to swap TLB, HTAB,.. etc Signed-off-by: Liu Ping Fan

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

2013-11-17 Thread liu ping fan
On Sat, Nov 16, 2013 at 3:00 PM, Paul Mackerras wrote: > On Fri, Nov 15, 2013 at 04:35:01PM +0800, Liu Ping Fan wrote: >> >> +sc_1_fast_return: >> + mtspr SPRN_SRR0,r10 >> + mtspr SPRN_SRR1,r11 >> + li r10, BOOK3S_INTERRUPT_SYSCALL >&g

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

2013-11-15 Thread Liu Ping Fan
In some scene, e.g openstack CI, PR guest can trigger "sc 1" frequently, this patch optimizes the path by directly delivering BOOK3S_INTERRUPT_SYSCALL to HV guest, so powernv can return to HV guest without heavy exit, i.e, no need to swap TLB, HTAB,.. etc Signed-off-by: Liu Ping Fan

[PATCH v4] powerpc: kvm: fix rare but potential deadlock scene

2013-11-15 Thread Liu Ping Fan
! deadlock happens Signed-off-by: Liu Ping Fan --- v4: remove the over-engineered part and keep it simple, also add some notes. --- arch/powerpc/kvm/book3s_64_mmu_hv.c | 6 +- arch/powerpc/kvm/book3s_hv_rm_mmu.c | 4 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/arch

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

2013-11-10 Thread Liu ping fan
On Fri, Nov 8, 2013 at 7:12 PM, Paul Mackerras wrote: > On Fri, Nov 08, 2013 at 10:44:16AM +0800, 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 re

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

2013-11-10 Thread Liu ping fan
On Fri, Nov 8, 2013 at 6:58 PM, Paul Mackerras wrote: > On Fri, Nov 08, 2013 at 03:29:52PM +0800, Liu Ping Fan wrote: >> 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

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

2013-11-08 Thread Liu ping fan
On Fri, Nov 8, 2013 at 12:19 PM, Liu ping fan wrote: > 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 >>>

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

2013-11-07 Thread Liu Ping Fan
! deadlock happens Signed-off-by: Liu Ping Fan --- arch/powerpc/include/asm/kvm_book3s.h | 4 ++-- arch/powerpc/kvm/book3s_64_mmu_hv.c | 5 +++-- arch/powerpc/kvm/book3s_hv_rm_mmu.c | 20 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/arch/powerpc

[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 a

[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: >> > >> > > s

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

[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

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

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: >

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

2013-11-06 Thread Liu Ping Fan
ret is assigned twice with the same value, so remove the later one. Signed-off-by: Liu Ping Fan Acked-by: Paul Mackerras --- arch/powerpc/kvm/book3s_64_mmu_hv.c | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/powerpc/kvm/book3s_64_mmu_hv.c b/arch/powerpc/kvm/book3s_64_mmu_hv.c index

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

2013-11-06 Thread Liu Ping Fan
! deadlock happens Signed-off-by: Liu Ping Fan --- arch/powerpc/kvm/book3s_64_mmu_hv.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kvm/book3s_64_mmu_hv.c b/arch/powerpc/kvm/book3s_64_mmu_hv.c index 043eec8..dbc1478 100644 --- a/arch/powerpc/kvm

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

2013-11-06 Thread Liu ping fan
On Wed, Nov 6, 2013 at 7:18 PM, Paul Mackerras wrote: > On Wed, Nov 06, 2013 at 02:02:07PM +0800, Liu ping fan wrote: >> On Wed, Nov 6, 2013 at 1:04 PM, Paul Mackerras wrote: >> > On Tue, Nov 05, 2013 at 03:42:43PM +0800, Liu Ping Fan wrote: >> >> Since kvmppc_hv_f

Re: [PATCH 1/3] powerpc/kvm: simplify the entering logic for secondary thread

2013-11-05 Thread Liu ping fan
On Wed, Nov 6, 2013 at 1:01 PM, Paul Mackerras wrote: > On Tue, Nov 05, 2013 at 03:42:42PM +0800, Liu Ping Fan wrote: >> After the primary vcpu changes vcore_state to VCORE_RUNNING, there is >> very little chance to schedule to secondary vcpu. So if we change the > > Why do

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

2013-11-05 Thread Liu ping fan
On Wed, Nov 6, 2013 at 1:04 PM, Paul Mackerras wrote: > On Tue, Nov 05, 2013 at 03:42:43PM +0800, Liu Ping Fan wrote: >> Since kvmppc_hv_find_lock_hpte() is called from both virtmode and >> realmode, so it can trigger the deadlock. > > Good catch, we should have preemption d

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

2013-11-04 Thread Liu Ping Fan
Signed-off-by: Liu Ping Fan --- arch/powerpc/kvm/book3s_64_mmu_hv.c | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/powerpc/kvm/book3s_64_mmu_hv.c b/arch/powerpc/kvm/book3s_64_mmu_hv.c index 28160ac..7682837 100644 --- a/arch/powerpc/kvm/book3s_64_mmu_hv.c +++ b/arch/powerpc/kvm

[PATCH 1/3] powerpc/kvm: simplify the entering logic for secondary thread

2013-11-04 Thread Liu Ping Fan
primary vcpu runs, the secondary vcpu can not be scheduled. Signed-off-by: Liu Ping Fan --- arch/powerpc/kvm/book3s_hv.c | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c index 62a2b5a..38b1fc0 100644 --- a/arch

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

2013-11-04 Thread Liu Ping Fan
! deadlock happens Signed-off-by: Liu Ping Fan --- arch/powerpc/kvm/book3s_64_mmu_hv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/powerpc/kvm/book3s_64_mmu_hv.c b/arch/powerpc/kvm/book3s_64_mmu_hv.c index 043eec8..28160ac 100644 --- a/arch/powerpc/kvm/book3s_64_mmu_hv.c +++ b/arch