[GIT PULL] Please pull my kvm-ppc-fixes branch

2015-12-09 Thread Paul Mackerras
KVM_BOOK3S_64_HV also enable KVM_BOOK3S_64_PR, as far as I can tell. Thanks, Paul. The following changes since commit 09922076003ad66de41ea14d2f8c3b4a16ec7774: Merge tag 'kvm-arm-for-v4.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into kvm-master (2015-12-04 18:3

Re: [PATCH] KVM: PPC: Increase memslots to 512

2015-12-09 Thread Paul Mackerras
t the value to 512 directly. > > While we're at it, also remove the KVM_MEM_SLOTS_NUM definition > from the powerpc-specific header since this gets defined in the > generic kvm_host.h header anyway. > > Signed-off-by: Thomas Huth Thanks, applied to my kvm-ppc-next branch. Pau

Re: [PATCH] KVM: PPC: Fix emulation of H_SET_DABR/X on POWER8

2015-12-09 Thread Paul Mackerras
cc: sta...@vger.kernel.org. Paul. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH] kvm: remove unused variable 'vcpu_book3s'

2015-12-09 Thread Paul Mackerras
On Tue, Dec 01, 2015 at 08:42:10PM -0300, Geyslan G. Bem wrote: > The vcpu_book3s struct is assigned but never used. So remove it. > > Signed-off-by: Geyslan G. Bem Thanks, applied to my kvm-ppc-next branch. Paul. -- To unsubscribe from this list: send the line "unsubscribe kvm&q

Re: [PATCH 1/1] KVM: PPC: Increase memslots to 320

2015-12-08 Thread Paul Mackerras
s like a good value for the > time being (until we have some code in the future to resize the > memslot array dynamically). > And while we're at it, also remove the KVM_MEM_SLOTS_NUM definition > from the powerpc-specific header since this gets defined in the > generic kvm_host.h

Re: [PATCH kernel 5/9] KVM: PPC: Account TCE-containing pages in locked_vm

2015-11-29 Thread Paul Mackerras
t; +static long kvmppc_account_memlimit(long npages, bool inc) > +{ > + long ret = 0; > + const long bytes = sizeof(struct kvmppc_spapr_tce_table) + > + (abs(npages) * sizeof(struct page *)); Why abs(npages)? Can npages be negative? If so, what does that

Re: [RFC] kvm - possible out of bounds

2015-11-29 Thread Paul Mackerras
moved. > A question, the kvmppc_mmu_book3s_64_init function is accessed by > unconventional way? Because I have not found any calling to it. Try arch/powerpc/kvm/book3s_pr.c line 410: kvmppc_mmu_book3s_64_init(vcpu); Grep (or git grep) is your friend. Paul. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[PATCH 1/2] KVM: PPC: Book3S HV: Prohibit setting illegal transaction state in MSR

2015-11-11 Thread Paul Mackerras
This closes the hole by making kvmppc_set_msr_hv() check for the illegal combination and force the TS field to a safe value (00, meaning non-transactional). Signed-off-by: Paul Mackerras --- arch/powerpc/kvm/book3s_hv.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/arch/powerp

[PATCH 2/2] KVM: PPC: Book3S HV: Handle unexpected traps in guest entry/exit code better

2015-11-11 Thread Paul Mackerras
if the MCE occurred in hypervisor mode, we exit to the host rather than trying to continue the guest. Signed-off-by: Paul Mackerras --- arch/powerpc/kvm/book3s_hv.c| 18 ++ arch/powerpc/kvm/book3s_hv_rmhandlers.S | 2 ++ 2 files changed, 20 insertions(+) diff --git

[GIT PULL] Please pull my kvm-ppc-fixes branch

2015-11-11 Thread Paul Mackerras
configured for static 2-way micro-threading mode. Thanks, Paul. The following changes since commit a3eaa8649e4c6a6afdafaa04b9114fb230617bb1: KVM: VMX: Fix commit which broke PML (2015-11-05 11:34:11 +0100) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/paulus

[PATCH] KVM: PPC: Book3S HV: Don't dynamically split core when already split

2015-11-05 Thread Paul Mackerras
d-off-by: Paul Mackerras --- arch/powerpc/kvm/book3s_hv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c index 2280497..becad3a 100644 --- a/arch/powerpc/kvm/book3s_hv.c +++ b/arch/powerpc/kvm/book3s_hv.c @@ -2

[PATCH] KVM: PPC: Book3S HV: Synthesize segment fault if SLB lookup fails

2015-10-26 Thread Paul Mackerras
. That should cause the guest to reload an appropriate entry into the SLB and retry the faulting instruction. If it still faults, we should find an appropriate SLB entry next time and be able to handle the fault. Signed-off-by: Paul Mackerras --- arch/powerpc/kvm/book3s_hv_rmhandlers.S | 20

Re: [PATCH] KVM: PPC: Implement extension to report number of memslots

2015-10-25 Thread Paul Mackerras
On Fri, Oct 16, 2015 at 08:41:31AM +0200, Thomas Huth wrote: > Yes, we'll likely need this soon! 32 slots are not enough... Would anyone object if I raised the limit for PPC to 512 slots? Would that cause problems on embedded PPC, for instance? Paul. -- To unsubscribe from this list:

[GIT PULL] Please pull my kvm-ppc-next branch

2015-10-25 Thread Paul Mackerras
Paolo, Here is my current patch queue for KVM on PPC. There's nothing much in the way of new features this time; it's mostly bug fixes, plus Nikunj has implemented support for KVM_CAP_NR_MEMSLOTS. These are intended for the "next" branch of the KVM tree. Please pull.

[PATCH] KVM: PPC: Book3S HV: Make H_REMOVE return correct HPTE value for absent HPTEs

2015-10-14 Thread Paul Mackerras
guest's point of view, the HPTE is valid. Signed-off-by: Paul Mackerras --- arch/powerpc/kvm/book3s_hv_rm_mmu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/powerpc/kvm/book3s_hv_rm_mmu.c b/arch/powerpc/kvm/book3s_hv_rm_mmu.c index c1df9bb..97e7f8c 100644 --- a/arch/powerp

[PATCH] KVM: PPC: Book3S HV: Don't fall back to smaller HPT size in allocation ioctl

2015-10-14 Thread Paul Mackerras
where the HPT is allocated at the time the first VCPU is run, if no HPT has been allocated by ioctl by that time. Signed-off-by: Paul Mackerras --- arch/powerpc/kvm/book3s_64_mmu_hv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kvm/book3s_64_mmu_hv.c b

Re: [PATCH 15/19] KVM: PPC: e500: fix handling local_sid_lookup result

2015-10-14 Thread Paul Mackerras
nux.kernel/2046107 > > Signed-off-by: Andrzej Hajda Thanks, applied to my kvm-ppc-next branch. Paul. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH][v2] KVM: PPC: e500: Emulate TMCFG0 TMRN register

2015-10-14 Thread Paul Mackerras
in own function] > Signed-off-by: Laurentiu Tudor Thanks, applied to my kvm-ppc-next branch. Paul. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH] KVM: PPC: e500: fix couple of shift operations on 64 bits

2015-10-14 Thread Paul Mackerras
On Thu, Oct 01, 2015 at 03:58:03PM +0300, Laurentiu Tudor wrote: > Fix couple of cases where we shift left a 32-bit > value thus might get truncated results on 64-bit > targets. > > Signed-off-by: Laurentiu Tudor > Suggested-by: Scott Wood Thanks, applied to my kvm-ppc-

Re: [PATCH] KVM: PPC: Take the kvm->srcu lock in kvmppc_h_logical_ci_load/store()

2015-09-21 Thread Paul Mackerras
;suspicious RCU usage" when > >> lock debugging is enabled. > >> > >> Fixes: 99342cf8044420eebdf9297ca03a14cb6a7085a1 Signed-off-by: > >> Thomas Huth > > > > Nice catch. Looks like I missed this because the places > > kvm_io_bus_{read,write}() are called on x86 are

[PATCH] KVM: PPC: Book3S HV: Fix handling of interrupted VCPUs

2015-09-17 Thread Paul Mackerras
inside the guest, and then remove this vcore from the preempted vcores list. That way, we avoid leaving this vcpu's vcore on the preempted vcores list when the vcpu gets interrupted. Fixes: ec2571650826 Reported-by: Thomas Huth Signed-off-by: Paul Mackerras --- arch/powerpc/kvm/book3s_hv.

Re: [4.2] commit d59cfc09c32 (sched, cgroup: replace signal_struct->group_rwsem with a global percpu_rwsem) causes regression for libvirt/kvm

2015-09-15 Thread Paul E. McKenney
On Tue, Sep 15, 2015 at 09:24:15PM -0400, Tejun Heo wrote: > Hello, Paul. > > On Tue, Sep 15, 2015 at 04:38:18PM -0700, Paul E. McKenney wrote: > > Well, the decision as to what is too big for -stable is owned by the > > -stable maintainers, not by me. > > Is it

Re: [4.2] commit d59cfc09c32 (sched, cgroup: replace signal_struct->group_rwsem with a global percpu_rwsem) causes regression for libvirt/kvm

2015-09-15 Thread Paul E. McKenney
On Tue, Sep 15, 2015 at 06:28:11PM -0400, Tejun Heo wrote: > Hello, > > On Tue, Sep 15, 2015 at 02:38:30PM -0700, Paul E. McKenney wrote: > > I did take a shot at adding the rcu_sync stuff during this past merge > > window, but it did not converge quickly enough to make it

Re: [4.2] commit d59cfc09c32 (sched, cgroup: replace signal_struct->group_rwsem with a global percpu_rwsem) causes regression for libvirt/kvm

2015-09-15 Thread Paul E. McKenney
evant areas, so probably best to just try them and see which works best. Thanx, Paul -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [4.2] commit d59cfc09c32 (sched, cgroup: replace signal_struct->group_rwsem with a global percpu_rwsem) causes regression for libvirt/kvm

2015-09-15 Thread Paul E. McKenney
urrent invocation from all CPUs because multiple concurrent *_expedited() calls will be satisfied by a single expedited grace-period operation. Nevertheless, as Paolo points out, it is still necessary to exercise caution when exposing synchronous grace periods to userspace control.

Re: [PATCH 3/3] KVM: PPC: Book3S HV: Implement H_CLEAR_REF and H_CLEAR_MOD

2015-09-06 Thread Paul Mackerras
On Sun, Sep 06, 2015 at 12:47:12PM -0700, Nathan Whitehorn wrote: > Anything I can do to help move these along? It's a big performance > improvement for FreeBSD guests. These patches are in Paolo's kvm-ppc-next branch and should go into Linus' tree in the next couple

[GIT PULL] Please pull my kvm-ppc-next branch

2015-09-05 Thread Paul Mackerras
). Please let me know if you want me to re-post all the patches. Thanks, Paul. The following changes since commit e3dbc572fe11a5231568e106fa3dcedd1d1bec0f: Merge tag 'signed-kvm-ppc-next' of git://github.com/agraf/linux-2.6 into kvm-queue (2015-08-22 14:57:59 -0700) are available

[PATCH] KVM: PPC: Book3S HV: Exit on H_DOORBELL only if HOST_IPI is set

2015-09-02 Thread Paul Mackerras
core is on the exit path to the host. This patch adds the missing comparison operation which will ensure that when HOST_IPI flag is set, we unconditionally exit to the host. Fixes: 66feed61cdf6 Cc: sta...@vger.kernel.org # v4.1+ Signed-off-by: Gautham R. Shenoy Signed-off-by: Paul Mackerras -

[PATCH] KVM: PPC: Book3S HV: Fix race in starting secondary threads

2015-09-02 Thread Paul Mackerras
when the vcore pointer in its PACA struct is set. Fixes: b4deba5c41e9 Signed-off-by: Gautham R. Shenoy Signed-off-by: Paul Mackerras --- arch/powerpc/kvm/book3s_hv.c| 10 +- arch/powerpc/kvm/book3s_hv_rmhandlers.S | 8 2 files changed, 17 insertions(+), 1 deletio

Re: [PATCH] KVM: ppc: Fix size of the PSPB register

2015-09-01 Thread Paul Mackerras
e fix this on both the source and destination host, then the value will get migrated across correctly. I think Thomas's patch is fine, it just needs a stronger patch description saying that it fixes an actual bug. Paul. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH] KVM: ppc: Fix size of the PSPB register

2015-09-01 Thread Paul Mackerras
he assembly code in book3s_hv_rmhandlers.S, this is actually a bug fix, isn't it? How did you find it? Did you observe a failure of some kind, or did you just find it by code inspection? Paul. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord

Re: [PATCH] vfio: Enable VFIO device for powerpc

2015-08-26 Thread Paul Mackerras
don't define any of the arch_*() hooks, but it will make qemu happy and > > we can extend it in future if we need to. > > > > Signed-off-by: David Gibson > > Reviewed-by: Eric Auger > > Paul is going to take care of the kvm-ppc tree for 4.3. Also, ppc kvm

Re: [PATCH] kvm:powerpc:Fix return statements for wrapper functions in the file book3s_64_mmu_hv.c

2015-08-20 Thread Paul Mackerras
a_range(kvm, start, end, kvm_unmap_rmapp); kvm_handle_hva and kvm_handle_hva_range call the handler function (kvm_unmap_rmapp in this case) one or more times, and return the logical OR of the return values from the handler. Since kvm_unmap_rmapp always returns 0, the return value from kvm_handle_hva

Re: [PATCH 0/2] Two fixes for dynamic micro-threading

2015-07-24 Thread Paul Mackerras
On Thu, Jul 23, 2015 at 02:02:51PM +0200, Alexander Graf wrote: > > The host crash should only occur with dynamic micro-threading enabled, > which is not in Linus' tree, correct? Correct. Paul. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the bod

[PATCH 0/2] Two fixes for dynamic micro-threading

2015-07-16 Thread Paul Mackerras
This series contains two fixes for the new dynamic micro-threading code that was added recently for HV-mode KVM on Power servers. The patches are against Alex Graf's kvm-ppc-queue branch. Please apply. Paul. arch/powerpc/kvm/book3s_hv.c | 12 +--- 1 file changed, 9 insertions(

[PATCH 2/2] KVM: PPC: Book3S HV: Fix preempted vcore stolen time calculation

2015-07-16 Thread Paul Mackerras
ff-by: Paul Mackerras --- arch/powerpc/kvm/book3s_hv.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c index 3d02276..fad52f2 100644 --- a/arch/powerpc/kvm/book3s_hv.c +++ b/arch/powerpc/kvm/book3s_hv.c @@ -2

[PATCH 1/2] KVM: PPC: Book3S HV: Fix preempted vcore list locking

2015-07-16 Thread Paul Mackerras
since the runner task may have moved to another CPU. Signed-off-by: Paul Mackerras --- arch/powerpc/kvm/book3s_hv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c index 6e3ef30..3d02276 100644 --- a/arch/powerpc/kvm

[PATCH v3] KVM: PPC: Book3S HV: Implement dynamic micro-threading on POWER8

2015-07-02 Thread Paul Mackerras
st context, since we haven't switched to the guest context. Signed-off-by: Paul Mackerras --- v3: Rename MAX_THREADS to MAX_SMT_THREADS to avoid a compile warning arch/powerpc/include/asm/kvm_book3s_asm.h | 20 ++ arch/powerpc/include/asm/kvm_host.h | 3 + arch/powerpc/kerne

[PATCH v2 2/5] KVM: PPC: Book3S HV: Implement dynamic micro-threading on POWER8

2015-06-30 Thread Paul Mackerras
st context, since we haven't switched to the guest context. Signed-off-by: Paul Mackerras --- v2: List allowed values for dynamic_mt_modes module parameter in the module parameter description. arch/powerpc/include/asm/kvm_book3s_asm.h | 20 ++ arch/powerpc/include/asm/kvm_host.h | 3

[PATCH 2/5] KVM: PPC: Book3S HV: Implement dynamic micro-threading on POWER8

2015-06-24 Thread Paul Mackerras
st context, since we haven't switched to the guest context. Signed-off-by: Paul Mackerras --- arch/powerpc/include/asm/kvm_book3s_asm.h | 20 ++ arch/powerpc/include/asm/kvm_host.h | 3 + arch/powerpc/kernel/asm-offsets.c | 7 + arch/powerpc/kvm/book3s_hv.c

[PATCH 5/5] KVM: PPC: Book3S HV: Implement H_CLEAR_REF and H_CLEAR_MOD

2015-06-24 Thread Paul Mackerras
implementations have been tested using a FreeBSD guest. Signed-off-by: Paul Mackerras --- arch/powerpc/kvm/book3s_hv_rm_mmu.c | 126 ++-- arch/powerpc/kvm/book3s_hv_rmhandlers.S | 4 +- 2 files changed, 121 insertions(+), 9 deletions(-) diff --git a/arch/powerpc/kvm

[PATCH 4/5] KVM: PPC: Book3S HV: Fix bug in dirty page tracking

2015-06-24 Thread Paul Mackerras
ages. Signed-off-by: Paul Mackerras --- arch/powerpc/include/asm/kvm_book3s.h | 1 + arch/powerpc/include/asm/kvm_host.h | 2 ++ arch/powerpc/kvm/book3s_64_mmu_hv.c | 8 +++- arch/powerpc/kvm/book3s_hv_rm_mmu.c | 17 + 4 files changed, 27 insertions(+), 1 deletion(-

[PATCH 3/5] KVM: PPC: Book3S HV: Fix race in reading change bit when removing HPTE

2015-06-24 Thread Paul Mackerras
fb Cc: sta...@vger.kernel.org # v3.17+ Signed-off-by: Paul Mackerras --- arch/powerpc/kvm/book3s_hv_rm_mmu.c | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/kvm/book3s_hv_rm_mmu.c b/arch/powerpc/kvm/book3s_hv_rm_mmu.c index b027a89..c6d601c 100644 --- a/ar

[PATCH 1/5] KVM: PPC: Book3S HV: Make use of unused threads when running guests

2015-06-24 Thread Paul Mackerras
on Tested-by: Laurent Vivier Signed-off-by: Paul Mackerras --- arch/powerpc/include/asm/kvm_host.h | 19 +- arch/powerpc/kernel/asm-offsets.c | 2 + arch/powerpc/kvm/book3s_hv.c| 333 ++-- arch/powerpc/kvm/book3s_hv_builtin.c| 7 +- arc

[PATCH 0/5] PPC: Current patch queue for HV KVM

2015-06-24 Thread Paul Mackerras
following a suggestion by Aneesh. I'd like to see these go into 4.2 if possible. Paul. --- arch/powerpc/include/asm/kvm_book3s.h | 1 + arch/powerpc/include/asm/kvm_book3s_asm.h | 20 + arch/powerpc/include/asm/kvm_host.h | 24 +- arch/powerpc/kernel/asm-offsets.c

[PATCH v2] KVM: PPC: Book3S HV: Implement dynamic micro-threading on POWER8

2015-06-24 Thread Paul Mackerras
st context, since we haven't switched to the guest context. Signed-off-by: Paul Mackerras --- v2: Add a test (3 lines) to book3s_hv_rmhandlers.S to ensure that we don't subtract the timebase offset in cases where we didn't add it. This fixes a bug found in testing where the timeb

Re: [PATCH 0/2] KVM: PPC: Book3S HV: Dynamic micro-threading/split-core

2015-06-21 Thread Paul Mackerras
On Wed, Jun 17, 2015 at 07:30:09PM +0200, Laurent Vivier wrote: > > Tested-by: Laurent Vivier > > Performance is better, but Paul could you explain why it is better if I > disable dynamic micro-threading ? > Did I miss something ? > > My test system is an IBM Pow

[PATCH 2/2] KVM: PPC: Book3S HV: Implement dynamic micro-threading on POWER8

2015-05-27 Thread Paul Mackerras
which are the primary thread for their subcore and therefore need to do the MMU switch. These threads will need to be started even if they have no vcpu to run, so we use the vcore pointer in the PACA rather than the vcpu pointer to trigger them. Signed-off-by: Paul Mackerras --- arch/powerpc/include

[PATCH 0/2] KVM: PPC: Book3S HV: Dynamic micro-threading/split-core

2015-05-27 Thread Paul Mackerras
other vcore that was wanting to run on that core but got preempted does the logic kick in to try to run both vcores at once. Paul. --- arch/powerpc/include/asm/kvm_book3s_asm.h | 20 + arch/powerpc/include/asm/kvm_host.h | 22 +- arch/powerpc/kernel/asm-offsets.c | 9 + arch/po

[PATCH 1/2] KVM: PPC: Book3S HV: Make use of unused threads when running guests

2015-05-27 Thread Paul Mackerras
means that vcpu->arch.ptid is no longer necessarily the same as the physical thread that the vcpu runs on. In order to make it easier for code that wants to send an IPI to know which CPU to target, we now store that in a new field in struct vcpu_arch, called thread_cpu. Signed-off-by: Paul Mackerr

[PATCH] KVM: PPC: Book3S HV: Fix list traversal in error case

2015-04-28 Thread Paul Mackerras
8 419e0048 <813e1b20> 939e1b18 2f890001 409effcc ---[ end trace 8cdf50251cca6680 ]--- Fixes: 25fedfca94cf Signed-off-by: Paul Mackerras --- Since this is a regression fix for a patch that went in post 4.0, it should go in for 4.1. arch/powerpc/kvm/book3s_hv.c | 5 +++-- 1 file changed, 3

Re: [PATCH 1/3] KVM: PPC: Book3S HV: Fix race in reading change bit when removing HPTE

2015-04-28 Thread Paul Mackerras
On Tue, Apr 28, 2015 at 10:36:52AM +0530, Aneesh Kumar K.V wrote: > Paul Mackerras writes: > > > The reference (R) and change (C) bits in a HPT entry can be set by > > hardware at any time up until the HPTE is invalidated and the TLB > > invalidation sequence has complete

[PATCH 1/3] KVM: PPC: Book3S HV: Fix race in reading change bit when removing HPTE

2015-04-23 Thread Paul Mackerras
fb Cc: sta...@vger.kernel.org # v3.17+ Signed-off-by: Paul Mackerras --- arch/powerpc/kvm/book3s_hv_rm_mmu.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/kvm/book3s_hv_rm_mmu.c b/arch/powerpc/kvm/book3s_hv_rm_mmu.c index f6bf0b1..5c1737f 100644 --- a/arch/p

[PATCH 3/3] KVM: PPC: Book3S HV: Implement H_CLEAR_REF and H_CLEAR_MOD

2015-04-23 Thread Paul Mackerras
implementations are only compile tested. Signed-off-by: Paul Mackerras --- arch/powerpc/kvm/book3s_hv_rm_mmu.c | 126 ++-- arch/powerpc/kvm/book3s_hv_rmhandlers.S | 4 +- 2 files changed, 121 insertions(+), 9 deletions(-) diff --git a/arch/powerpc/kvm/book3s_hv_rm_mmu.c

[PATCH 2/3] KVM: PPC: Book3S HV: Fix bug in dirty page tracking

2015-04-23 Thread Paul Mackerras
ages. Signed-off-by: Paul Mackerras --- arch/powerpc/include/asm/kvm_book3s.h | 1 + arch/powerpc/include/asm/kvm_host.h | 2 ++ arch/powerpc/kvm/book3s_64_mmu_hv.c | 8 +++- arch/powerpc/kvm/book3s_hv_rm_mmu.c | 17 + 4 files changed, 27 insertions(+), 1 deletion(-

[PATCH 0/3] PPC HV bug fixes + hcalls for FreeBSD

2015-04-23 Thread Paul Mackerras
The first two patches could go in immediately. I'd like to get feedback from actual users of H_CLEAR_REF/MOD before the third patch goes in. These patches are against Alex Graf's kvm-ppc-queue branch. Paul. arch/powerpc/include/asm/kvm_host.h | 2 ++ arch/powerpc/kerne

Re: [PATCH v2 00/12] Remaining improvements for HV KVM

2015-04-21 Thread Paul Mackerras
On Wed, Apr 15, 2015 at 10:16:41PM +0200, Alexander Graf wrote: > > > On 14.04.15 13:56, Paul Mackerras wrote: > > Did you forget to push it out or something? Your kvm-ppc-queue branch > > is still at 4.0-rc1 as far as I can see. > > Oops, not sure how that happened

Re: [PATCH v2 00/12] Remaining improvements for HV KVM

2015-04-14 Thread Paul Mackerras
On Thu, Apr 09, 2015 at 12:57:58AM +0200, Alexander Graf wrote: > On 03/28/2015 04:21 AM, Paul Mackerras wrote: > >This is the rest of my current patch queue for HV KVM on PPC. This > >series is based on Alex Graf's kvm-ppc-queue branch. The only change > >from th

Re: H_CLEAR_REF and H_CLEAR_MOD

2015-04-14 Thread Paul Mackerras
On Sat, Apr 11, 2015 at 12:57:54PM -0700, Nathan Whitehorn wrote: > > > On 02/18/15 15:33, Nathan Whitehorn wrote: > > > >On 02/18/15 14:00, Paul Mackerras wrote: > >>On Wed, Feb 18, 2015 at 09:34:54AM +0100, Alexander Graf wrote: > >>>>Am

[PATCH 10/12] KVM: PPC: Book3S HV: Streamline guest entry and exit

2015-03-27 Thread Paul Mackerras
howing a substantial reduction in the time spent per guest entry in the real-mode guest entry code, and smaller reductions in the real mode guest exit and interrupt handling times. (The test was to start the guest and boot Fedora 20 big-endian to the login prompt.) Signed-off-by: Paul Mackerras -

[PATCH 11/12] KVM: PPC: Book3S HV: Translate kvmhv_commence_exit to C

2015-03-27 Thread Paul Mackerras
: Paul Mackerras --- arch/powerpc/include/asm/kvm_book3s_64.h | 2 + arch/powerpc/kvm/book3s_hv_builtin.c | 63 ++ arch/powerpc/kvm/book3s_hv_rm_xics.c | 12 +- arch/powerpc/kvm/book3s_hv_rmhandlers.S | 66 4 files changed, 75

[PATCH 09/12] KVM: PPC: Book3S HV: Use bitmap of active threads rather than count

2015-03-27 Thread Paul Mackerras
next guest entry. Signed-off-by: Paul Mackerras --- arch/powerpc/include/asm/kvm_host.h | 15 arch/powerpc/kernel/asm-offsets.c | 2 +- arch/powerpc/kvm/book3s_hv.c| 5 ++- arch/powerpc/kvm/book3s_hv_builtin.c| 10 +++--- arch/powerpc/kvm/book3s_hv_rmhandlers.S

[PATCH 05/12] KVM: PPC: Book3S HV: Move vcore preemption point up into kvmppc_run_vcpu

2015-03-27 Thread Paul Mackerras
cause there are potentially other vcpus waiting for the runner in kvmppc_wait_for_exec() which then wouldn't get woken up.) Also, we make use of the handy cond_resched_lock() function, which unlocks and relocks vc->lock for us around the reschedule. Signed-off-by: Paul Mackerras ---

[PATCH 12/12] KVM: PPC: Book3S HV: Use msgsnd for signalling threads on POWER8

2015-03-27 Thread Paul Mackerras
and a little-endian POWER8 host. Signed-off-by: Paul Mackerras --- Note that this patch depends on the patch "powerpc/powernv: Fixes for hypervisor doorbell handling", which is now upstream in Linus' tree as commit 755563bc79c7, for the definition of PPC_MSGCLR(). arch/pow

[PATCH 03/12] KVM: PPC: Book3S HV: Simplify handling of VCPUs that need a VPA update

2015-03-27 Thread Paul Mackerras
kvmppc_run_vcpu() wake up another VCPU task to be the runner if necessary. This all means that the VCORE_STARTING state is no longer used, so we remove it. Signed-off-by: Paul Mackerras --- arch/powerpc/include/asm/kvm_host.h | 5 ++-- arch/powerpc/kvm/book3s_hv.c| 56

[PATCH v2 00/12] Remaining improvements for HV KVM

2015-03-27 Thread Paul Mackerras
anch of the kvm tree, which includes 755563bc79c7, or you could cherry-pick 755563bc79c7 and let the subsequent merge fix it up. I would like to see these patches go into 4.1. Paul. arch/powerpc/include/asm/kvm_book3s_64.h | 4 + arch/powerpc/include/asm/kvm_host.h | 44 ++- arch/powerp

[PATCH 06/12] KVM: PPC: Book3S HV: Get rid of vcore nap_count and n_woken

2015-03-27 Thread Paul Mackerras
threads rather than polling vc->nap_count. Besides reducing the size of the kvmppc_vcore struct by 8 bytes, this also means that we can tell which secondary threads have got stuck and thus print a more informative error message. Signed-off-by: Paul Mackerras --- arch/powerpc/include/asm/kvm_hos

[PATCH 01/12] KVM: PPC: Book3S HV: Create debugfs file for each guest's HPT

2015-03-27 Thread Paul Mackerras
ss. (The format of the second through fourth fields are described in the Power ISA and also in arch/powerpc/include/asm/mmu-hash64.h.) Signed-off-by: Paul Mackerras --- arch/powerpc/include/asm/kvm_book3s_64.h | 2 + arch/powerpc/include/asm/kvm_host.h | 2 + arch/powerpc/kvm

[PATCH 04/12] KVM: PPC: Book3S HV: Minor cleanups

2015-03-27 Thread Paul Mackerras
ode a little and remove the ext_interrupt_to_host label. * Add some comments about register usage. * hcall_try_real_mode doesn't need to be global, and can't be called from C code anyway. Signed-off-by: Paul Mackerras --- arch/powerpc/include/asm/kvm_host.h | 2 -- arch/pow

[PATCH 02/12] KVM: PPC: Book3S HV: Accumulate timing information for real-mode code

2015-03-27 Thread Paul Mackerras
about 30ns for an hcall that is handled in real mode (e.g. H_SET_DABR), which is about 25%. Since production environments may not wish to incur this overhead, the new code is conditional on a new config symbol, CONFIG_KVM_BOOK3S_HV_EXIT_TIMING. Signed-off-by: Paul Mackerras --- arch/powerpc/i

[PATCH 07/12] KVM: PPC: Book3S HV: Don't wake thread with no vcpu on guest IPI

2015-03-27 Thread Paul Mackerras
thread will wake up on an IPI sent using msgsndp. Signed-off-by: Paul Mackerras --- arch/powerpc/kvm/book3s_hv_rmhandlers.S | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/kvm/book3s_hv_rmhandlers.S b/arch/powerpc/kvm/book3s_hv_rmhandlers.S index 9a2ad8f

[PATCH 08/12] KVM: PPC: Book3S HV: Use decrementer to wake napping threads

2015-03-27 Thread Paul Mackerras
guest decrementer value around the nap. Signed-off-by: Paul Mackerras --- arch/powerpc/kvm/book3s_hv_rmhandlers.S | 43 +++-- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kvm/book3s_hv_rmhandlers.S b/arch/powerpc/kvm/book3s_hv_rmhandl

Re: [PATCH 02/12] KVM: PPC: Book3S HV: Accumulate timing information for real-mode code

2015-03-27 Thread Paul Mackerras
On Fri, Mar 27, 2015 at 02:29:46PM +1100, Paul Mackerras wrote: > This reads the timebase at various points in the real-mode guest > entry/exit code and uses that to accumulate total, minimum and > maximum time spent in those parts of the code. Currently these > times are accumulated

[PATCH 02/12] KVM: PPC: Book3S HV: Accumulate timing information for real-mode code

2015-03-26 Thread Paul Mackerras
fig symbol, CONFIG_KVM_BOOK3S_HV_EXIT_TIMING. Signed-off-by: Paul Mackerras --- arch/powerpc/include/asm/kvm_host.h | 21 + arch/powerpc/include/asm/time.h | 3 + arch/powerpc/kernel/asm-offsets.c | 13 +++ arch/powerpc/kernel/time.c | 6 ++ arch/powerpc/k

[PATCH 08/12] KVM: PPC: Book3S HV: Use decrementer to wake napping threads

2015-03-26 Thread Paul Mackerras
guest decrementer value around the nap. Signed-off-by: Paul Mackerras --- arch/powerpc/kvm/book3s_hv_rmhandlers.S | 43 +++-- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kvm/book3s_hv_rmhandlers.S b/arch/powerpc/kvm/book3s_hv_rmhandl

[PATCH 04/12] KVM: PPC: Book3S HV: Minor cleanups

2015-03-26 Thread Paul Mackerras
ode a little and remove the ext_interrupt_to_host label. * Add some comments about register usage. * hcall_try_real_mode doesn't need to be global, and can't be called from C code anyway. Signed-off-by: Paul Mackerras --- arch/powerpc/include/asm/kvm_host.h | 2 -- arch/pow

[PATCH 09/12] KVM: PPC: Book3S HV: Use bitmap of active threads rather than count

2015-03-26 Thread Paul Mackerras
next guest entry. Signed-off-by: Paul Mackerras --- arch/powerpc/include/asm/kvm_host.h | 15 arch/powerpc/kernel/asm-offsets.c | 2 +- arch/powerpc/kvm/book3s_hv.c| 5 ++- arch/powerpc/kvm/book3s_hv_builtin.c| 10 +++--- arch/powerpc/kvm/book3s_hv_rmhandlers.S

[PATCH 11/12] KVM: PPC: Book3S HV: Translate kvmhv_commence_exit to C

2015-03-26 Thread Paul Mackerras
: Paul Mackerras --- arch/powerpc/include/asm/kvm_book3s_64.h | 2 + arch/powerpc/kvm/book3s_hv_builtin.c | 63 ++ arch/powerpc/kvm/book3s_hv_rm_xics.c | 12 +- arch/powerpc/kvm/book3s_hv_rmhandlers.S | 66 4 files changed, 75

[PATCH 07/12] KVM: PPC: Book3S HV: Don't wake thread with no vcpu on guest IPI

2015-03-26 Thread Paul Mackerras
thread will wake up on an IPI sent using msgsndp. Signed-off-by: Paul Mackerras --- arch/powerpc/kvm/book3s_hv_rmhandlers.S | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/kvm/book3s_hv_rmhandlers.S b/arch/powerpc/kvm/book3s_hv_rmhandlers.S index 0a35b8d

[PATCH 06/12] KVM: PPC: Book3S HV: Get rid of vcore nap_count and n_woken

2015-03-26 Thread Paul Mackerras
threads rather than polling vc->nap_count. Besides reducing the size of the kvmppc_vcore struct by 8 bytes, this also means that we can tell which secondary threads have got stuck and thus print a more informative error message. Signed-off-by: Paul Mackerras --- arch/powerpc/include/asm/kvm_hos

[PATCH 12/12] KVM: PPC: Book3S HV: Use msgsnd for signalling threads on POWER8

2015-03-26 Thread Paul Mackerras
and a little-endian POWER8 host. Signed-off-by: Paul Mackerras --- Note that this patch depends on the patch "powerpc/powernv: Fixes for hypervisor doorbell handling", which is now upstream in Linus' tree as commit 755563bc79c7, for the definition of PPC_MSGCLR(). arch/pow

[PATCH 05/12] KVM: PPC: Book3S HV: Move vcore preemption point up into kvmppc_run_vcpu

2015-03-26 Thread Paul Mackerras
cause there are potentially other vcpus waiting for the runner in kvmppc_wait_for_exec() which then wouldn't get woken up.) Also, we make use of the handy cond_resched_lock() function, which unlocks and relocks vc->lock for us around the reschedule. Signed-off-by: Paul Mackerras ---

[PATCH 10/12] KVM: PPC: Book3S HV: Streamline guest entry and exit

2015-03-26 Thread Paul Mackerras
howing a substantial reduction in the time spent per guest entry in the real-mode guest entry code, and smaller reductions in the real mode guest exit and interrupt handling times. (The test was to start the guest and boot Fedora 20 big-endian to the login prompt.) Signed-off-by: Paul Mackerras -

[PATCH 00/12] Remaining improvements for HV KVM

2015-03-26 Thread Paul Mackerras
w gone upstream into Linus' tree as commit 755563bc79c7 via the linuxppc-dev mailing list. Alex, how do you want to handle that? You could pull in the master branch of the kvm tree, or you could cherry-pick 755563bc79c7 and let the subsequent merge fix it up. Paul. arch/powerpc/include

[PATCH 03/12] KVM: PPC: Book3S HV: Simplify handling of VCPUs that need a VPA update

2015-03-26 Thread Paul Mackerras
kvmppc_run_vcpu() wake up another VCPU task to be the runner if necessary. This all means that the VCORE_STARTING state is no longer used, so we remove it. Signed-off-by: Paul Mackerras --- arch/powerpc/include/asm/kvm_host.h | 5 ++-- arch/powerpc/kvm/book3s_hv.c| 56

[PATCH 01/12] KVM: PPC: Book3S HV: Create debugfs file for each guest's HPT

2015-03-26 Thread Paul Mackerras
ss. (The format of the second through fourth fields are described in the Power ISA and also in arch/powerpc/include/asm/mmu-hash64.h.) Signed-off-by: Paul Mackerras --- arch/powerpc/include/asm/kvm_book3s_64.h | 2 + arch/powerpc/include/asm/kvm_host.h | 2 + arch/powerpc/kvm

Re: [kvm-ppc:kvm-ppc-queue 7/9] ERROR: ".__spin_yield" [arch/powerpc/kvm/kvm.ko] undefined!

2015-03-22 Thread Paul Mackerras
-dev/2015-February/125315.html. Alex, if you prefer me to post it to kvm-ppc@vger and kvm@vger, let me know. Paul. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH 20/23] KVM: PPC: Book3S HV: Use msgsnd for signalling threads on POWER8

2015-03-22 Thread Paul Mackerras
On Fri, Mar 20, 2015 at 12:28:25PM +0100, Alexander Graf wrote: > > > On 20.03.15 10:39, Paul Mackerras wrote: > > + /* On POWER8 for IPIs to threads in the same core, use msgsnd */ > > + if (cpu_has_feature(CPU_FTR_ARCH_207S) && > > + (cpu &a

Re: [PATCH 13/23] KVM: PPC: Book3S HV: Accumulate timing information for real-mode code

2015-03-22 Thread Paul Mackerras
On Fri, Mar 20, 2015 at 12:35:43PM +0100, Alexander Graf wrote: > > > On 20.03.15 12:25, Paul Mackerras wrote: > > On Fri, Mar 20, 2015 at 12:15:15PM +0100, Alexander Graf wrote: > >> Have you measure the additional overhead this brings? > > > > I haven

Re: [PATCH 13/23] KVM: PPC: Book3S HV: Accumulate timing information for real-mode code

2015-03-20 Thread Paul Mackerras
On Fri, Mar 20, 2015 at 12:15:15PM +0100, Alexander Graf wrote: > > > On 20.03.15 10:39, Paul Mackerras wrote: > > This reads the timebase at various points in the real-mode guest > > entry/exit code and uses that to accumulate total, minimum and > > maximum time spent

Re: [PATCH 07/23] KVM: PPC: Book3S: Allow reuse of vCPU object

2015-03-20 Thread Paul Mackerras
On Fri, Mar 20, 2015 at 12:01:32PM +0100, Alexander Graf wrote: > > > On 20.03.15 10:39, Paul Mackerras wrote: > > From: Bharata B Rao > > > > Since KVM isn't equipped to handle closure of vcpu fd from userspace(QEMU) > > correctly, certain work arounds

[PATCH 22/23] KVM: PPC: Book3S HV: Use bitmap of active threads rather than count

2015-03-20 Thread Paul Mackerras
next guest entry. Signed-off-by: Paul Mackerras --- arch/powerpc/include/asm/kvm_host.h | 15 arch/powerpc/kernel/asm-offsets.c | 2 +- arch/powerpc/kvm/book3s_hv.c| 5 ++- arch/powerpc/kvm/book3s_hv_builtin.c| 10 +++--- arch/powerpc/kvm/book3s_hv_rmhandlers.S

[PATCH 12/23] KVM: PPC: Book3S HV: Create debugfs file for each guest's HPT

2015-03-20 Thread Paul Mackerras
ss. (The format of the second through fourth fields are described in the Power ISA and also in arch/powerpc/include/asm/mmu-hash64.h.) Signed-off-by: Paul Mackerras --- arch/powerpc/include/asm/kvm_book3s_64.h | 2 + arch/powerpc/include/asm/kvm_host.h | 2 + arch/powerpc/kvm

[PATCH 23/23] KVM: PPC: Book3S HV: Translate kvmhv_commence_exit to C

2015-03-20 Thread Paul Mackerras
-off-by: Paul Mackerras --- arch/powerpc/include/asm/kvm_book3s_64.h | 2 + arch/powerpc/kvm/book3s_hv_builtin.c | 73 arch/powerpc/kvm/book3s_hv_rm_xics.c | 22 + arch/powerpc/kvm/book3s_hv_rmhandlers.S | 81 4 files

[PATCH 10/23] KVM: PPC: Book3S HV: Move virtual mode ICP functions to real-mode

2015-03-20 Thread Paul Mackerras
between the real mode code and the virtual mode code for the ICS/ICP resend and reject functions that for now the code has been duplicated instead of sharing common code. In the future, we can look at creating common functions. Signed-off-by: Suresh Warrier Signed-off-by: Paul Mackerras --- arch

[PATCH 21/23] KVM: PPC: Book3S HV: Streamline guest entry and exit

2015-03-20 Thread Paul Mackerras
stantial reduction in the time spent in the real-mode guest entry code, and smaller reductions in the real mode guest exit and interrupt handling times. (The test was to start the guest and boot Fedora 20 big-endian to the login prompt.) Signed-off-by: Paul Mackerras --- arch/pow

[PATCH 18/23] KVM: PPC: Book3S HV: Don't wake thread with no vcpu on guest IPI

2015-03-20 Thread Paul Mackerras
thread will wake up on an IPI sent using msgsndp. Signed-off-by: Paul Mackerras --- arch/powerpc/kvm/book3s_hv_rmhandlers.S | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/kvm/book3s_hv_rmhandlers.S b/arch/powerpc/kvm/book3s_hv_rmhandlers.S index c3b148d

[PATCH 20/23] KVM: PPC: Book3S HV: Use msgsnd for signalling threads on POWER8

2015-03-20 Thread Paul Mackerras
threads out of the guest when exiting. Signed-off-by: Paul Mackerras --- arch/powerpc/kernel/asm-offsets.c | 4 +++ arch/powerpc/kvm/book3s_hv.c| 48 ++--- arch/powerpc/kvm/book3s_hv_rm_xics.c| 11 arch/powerpc/kvm

[PATCH 14/23] KVM: PPC: Book3S HV: Simplify handling of VCPUs that need a VPA update

2015-03-20 Thread Paul Mackerras
kvmppc_run_vcpu() wake up another VCPU task to be the runner if necessary. This all means that the VCORE_STARTING state is no longer used, so we remove it. Signed-off-by: Paul Mackerras --- arch/powerpc/include/asm/kvm_host.h | 5 ++-- arch/powerpc/kvm/book3s_hv.c| 56

[PATCH 19/23] KVM: PPC: Book3S HV: Use decrementer to wake napping threads

2015-03-20 Thread Paul Mackerras
guest decrementer value around the nap. Signed-off-by: Paul Mackerras --- arch/powerpc/kvm/book3s_hv_rmhandlers.S | 43 +++-- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kvm/book3s_hv_rmhandlers.S b/arch/powerpc/kvm/book3s_hv_rmhandl

  1   2   3   4   5   6   7   8   9   10   >