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 of days. Paul. -- To

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

2015-09-05 Thread Paul Mackerras
Paolo, Please pull the commits listed below into your tree. I would like them to go in for 4.3 as they are all small bug fixes not new features, and they all can only affect HV-mode KVM on IBM server machines (in fact one has no effect on code at all since it is a typo fix for a comment).

KVM memory slots limit on powerpc

2015-09-04 Thread Thomas Huth
Hi all, now that we get memory hotplugging for the spapr machine on qemu-ppc, too, it seems like we easily can hit the amount of KVM-internal memory slots now ("#define KVM_USER_MEM_SLOTS 32" in arch/powerpc/include/asm/kvm_host.h). For example, start qemu-system-ppc64 with a couple of "-device

Re: [Qemu-ppc] KVM memory slots limit on powerpc

2015-09-04 Thread Thomas Huth
On 04/09/15 12:07, Christian Borntraeger wrote: > Am 04.09.2015 um 12:04 schrieb Alexander Graf: >> >> >> On 04.09.15 11:59, Christian Borntraeger wrote: >>> Am 04.09.2015 um 11:35 schrieb Thomas Huth: Hi all, now that we get memory hotplugging for the spapr machine on

Re: KVM memory slots limit on powerpc

2015-09-04 Thread Christian Borntraeger
Am 04.09.2015 um 11:35 schrieb Thomas Huth: > > Hi all, > > now that we get memory hotplugging for the spapr machine on qemu-ppc, > too, it seems like we easily can hit the amount of KVM-internal memory > slots now ("#define KVM_USER_MEM_SLOTS 32" in > arch/powerpc/include/asm/kvm_host.h). For

Re: [Qemu-ppc] KVM memory slots limit on powerpc

2015-09-04 Thread Christian Borntraeger
Am 04.09.2015 um 12:04 schrieb Alexander Graf: > > > On 04.09.15 11:59, Christian Borntraeger wrote: >> Am 04.09.2015 um 11:35 schrieb Thomas Huth: >>> >>> Hi all, >>> >>> now that we get memory hotplugging for the spapr machine on qemu-ppc, >>> too, it seems like we easily can hit the amount

Re: [Qemu-ppc] KVM memory slots limit on powerpc

2015-09-04 Thread Benjamin Herrenschmidt
On Fri, 2015-09-04 at 12:28 +0200, Thomas Huth wrote: > > Maybe some rcu protected scheme that doubles the amount of memslots > > for > > each overrun? Yes, that would be good and even reduce the footprint > > for > > systems with only a small number of memslots. > > Seems like Alex Williamson

Re: [Qemu-ppc] KVM memory slots limit on powerpc

2015-09-04 Thread Thomas Huth
On 04/09/15 12:04, Alexander Graf wrote: > > > On 04.09.15 11:59, Christian Borntraeger wrote: >> Am 04.09.2015 um 11:35 schrieb Thomas Huth: >>> >>> Hi all, >>> >>> now that we get memory hotplugging for the spapr machine on qemu-ppc, >>> too, it seems like we easily can hit the amount of

[PATCH] powerpc/e500: move qemu machine spec together with the rest

2015-09-04 Thread Laurentiu Tudor
This way we get rid of an entire file with mostly duplicated code plus a Kconfig option that you always had to take care to check it in order for kvm to work. Signed-off-by: Laurentiu Tudor --- arch/powerpc/platforms/85xx/Kconfig | 15 -

Re: [Qemu-ppc] KVM memory slots limit on powerpc

2015-09-04 Thread Alex Williamson
On Fri, 2015-09-04 at 12:28 +0200, Thomas Huth wrote: > On 04/09/15 12:07, Christian Borntraeger wrote: > > Am 04.09.2015 um 12:04 schrieb Alexander Graf: > >> > >> > >> On 04.09.15 11:59, Christian Borntraeger wrote: > >>> Am 04.09.2015 um 11:35 schrieb Thomas Huth: > > Hi all, >

[PATCH] KVM: PPC: fix typo in top comment about locking

2015-09-03 Thread Greg Kurz
Signed-off-by: Greg Kurz --- arch/powerpc/kvm/book3s_xics.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/kvm/book3s_xics.c b/arch/powerpc/kvm/book3s_xics.c index c6ca7db64673..905e94a1370f 100644 ---

Please add my kvm-ppc-next branch to linux-next

2015-09-03 Thread Paul Mackerras
Hi Stephen, Please include the kvm-ppc-next branch of my powerpc git tree at: git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc.git to linux-next. This branch currently only has commits that are intended to go into 4.3, and I won't put in any commits for 4.4 until 4.3-rc1 is out.

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

2015-09-02 Thread Thomas Huth
On 02/09/15 00:24, Paul Mackerras wrote: > On Tue, Sep 01, 2015 at 11:41:18PM +0200, Thomas Huth wrote: >> The size of the Problem State Priority Boost Register is only >> 32 bits, so let's change the type of the corresponding variable >> accordingly to avoid future trouble. > > Since we're

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

2015-09-02 Thread Thomas Huth
The size of the Problem State Priority Boost Register is only 32 bits, but the kvm_vcpu_arch->pspb variable is declared as "ulong", ie. 64-bit. However, the assembler code accesses this variable with 32-bit accesses, and the KVM_REG_PPC_PSPB macro is defined with SIZE_U32, too, so that the current

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

2015-09-02 Thread Alexander Graf
> Am 02.09.2015 um 09:26 schrieb Thomas Huth : > >> On 02/09/15 00:55, Benjamin Herrenschmidt wrote: >>> On Wed, 2015-09-02 at 08:45 +1000, Paul Mackerras wrote: >>> On Wed, Sep 02, 2015 at 08:25:05AM +1000, Benjamin Herrenschmidt >>> wrote: On Tue, 2015-09-01 at 23:41

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

2015-09-02 Thread Thomas Huth
On 02/09/15 00:55, Benjamin Herrenschmidt wrote: > On Wed, 2015-09-02 at 08:45 +1000, Paul Mackerras wrote: >> On Wed, Sep 02, 2015 at 08:25:05AM +1000, Benjamin Herrenschmidt >> wrote: >>> On Tue, 2015-09-01 at 23:41 +0200, Thomas Huth wrote: The size of the Problem State Priority Boost

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

2015-09-02 Thread Thomas Huth
On 02/09/15 10:26, Alexander Graf wrote: > >> Am 02.09.2015 um 09:26 schrieb Thomas Huth : >> >>> On 02/09/15 00:55, Benjamin Herrenschmidt wrote: On Wed, 2015-09-02 at 08:45 +1000, Paul Mackerras wrote: On Wed, Sep 02, 2015 at 08:25:05AM +1000, Benjamin Herrenschmidt

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

2015-09-02 Thread David Gibson
On Thu, Sep 03, 2015 at 03:21:23PM +1000, Paul Mackerras wrote: > From: "Gautham R. Shenoy" > > The code that handles the case when we receive a H_DOORBELL interrupt > has a comment which says "Hypervisor doorbell - exit only if host IPI > flag set". However, the

Re: [PATCH 1/2] KVM: PPC: Book3S HV: Fix race in starting secondary threads

2015-09-02 Thread David Gibson
On Thu, Sep 03, 2015 at 03:20:50PM +1000, Paul Mackerras wrote: > From: "Gautham R. Shenoy" > > The current dynamic micro-threading code has a race due to which a > secondary thread naps when it is supposed to be running a vcpu. As a > side effect of this, on a guest

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

2015-09-02 Thread Paul Mackerras
From: "Gautham R. Shenoy" The code that handles the case when we receive a H_DOORBELL interrupt has a comment which says "Hypervisor doorbell - exit only if host IPI flag set". However, the current code does not actually check if the host IPI flag is set. This is due

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

2015-09-02 Thread Paul Mackerras
From: "Gautham R. Shenoy" The current dynamic micro-threading code has a race due to which a secondary thread naps when it is supposed to be running a vcpu. As a side effect of this, on a guest exit, the primary thread in kvmppc_wait_for_nap() finds that this secondary

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

2015-09-01 Thread Paul Mackerras
On Tue, Sep 01, 2015 at 11:41:18PM +0200, Thomas Huth wrote: > The size of the Problem State Priority Boost Register is only > 32 bits, so let's change the type of the corresponding variable > accordingly to avoid future trouble. Since we're already using lwz/stw in the assembly code in

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

2015-09-01 Thread Benjamin Herrenschmidt
On Wed, 2015-09-02 at 08:24 +1000, Paul Mackerras wrote: > On Tue, Sep 01, 2015 at 11:41:18PM +0200, Thomas Huth wrote: > > The size of the Problem State Priority Boost Register is only > > 32 bits, so let's change the type of the corresponding variable > > accordingly to avoid future trouble. >

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

2015-09-01 Thread Paul Mackerras
On Wed, Sep 02, 2015 at 08:25:05AM +1000, Benjamin Herrenschmidt wrote: > On Tue, 2015-09-01 at 23:41 +0200, Thomas Huth wrote: > > The size of the Problem State Priority Boost Register is only > > 32 bits, so let's change the type of the corresponding variable > > accordingly to avoid future

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

2015-09-01 Thread Benjamin Herrenschmidt
On Wed, 2015-09-02 at 08:45 +1000, Paul Mackerras wrote: > On Wed, Sep 02, 2015 at 08:25:05AM +1000, Benjamin Herrenschmidt > wrote: > > On Tue, 2015-09-01 at 23:41 +0200, Thomas Huth wrote: > > > The size of the Problem State Priority Boost Register is only > > > 32 bits, so let's change the type

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

2015-09-01 Thread Thomas Huth
The size of the Problem State Priority Boost Register is only 32 bits, so let's change the type of the corresponding variable accordingly to avoid future trouble. Signed-off-by: Thomas Huth --- arch/powerpc/include/asm/kvm_host.h | 2 +- 1 file changed, 1 insertion(+), 1

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

2015-09-01 Thread Benjamin Herrenschmidt
On Tue, 2015-09-01 at 23:41 +0200, Thomas Huth wrote: > The size of the Problem State Priority Boost Register is only > 32 bits, so let's change the type of the corresponding variable > accordingly to avoid future trouble. It's not future trouble, it's broken today for LE and this should fix it

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

2015-08-26 Thread Paul Mackerras
On Wed, Aug 26, 2015 at 11:34:26AM +0200, Alexander Graf wrote: On 13.08.15 03:15, David Gibson wrote: ec53500f kvm: Add VFIO device added a special KVM pseudo-device which is used to handle any necessary interactions between KVM and VFIO. Currently that device is built on x86 and

Re: Build regressions/improvements in v4.2-rc8

2015-08-26 Thread Alexander Graf
On 24.08.15 10:36, Geert Uytterhoeven wrote: On Mon, Aug 24, 2015 at 10:34 AM, Geert Uytterhoeven ge...@linux-m68k.org wrote: JFYI, when comparing v4.2-rc8[1] to v4.2-rc7[3], the summaries are: - build errors: +4/-7 4 regressions: + /home/kisskb/slave/src/include/linux/kvm_host.h:

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

2015-08-26 Thread Alexander Graf
On 13.08.15 03:15, David Gibson wrote: ec53500f kvm: Add VFIO device added a special KVM pseudo-device which is used to handle any necessary interactions between KVM and VFIO. Currently that device is built on x86 and ARM, but not powerpc, although powerpc does support both KVM and VFIO.

Re: Build regressions/improvements in v4.2-rc8

2015-08-24 Thread Geert Uytterhoeven
On Mon, Aug 24, 2015 at 10:34 AM, Geert Uytterhoeven ge...@linux-m68k.org wrote: JFYI, when comparing v4.2-rc8[1] to v4.2-rc7[3], the summaries are: - build errors: +4/-7 4 regressions: + /home/kisskb/slave/src/include/linux/kvm_host.h: error: array subscript is above array bounds

Re: [PULL 00/12] ppc patch queue 2015-08-22

2015-08-24 Thread Paolo Bonzini
On 24/08/2015 06:49, Alexander Graf wrote: Hi Paolo, This is my current patch queue for ppc. Please pull. Done, but this queue has not been in linux-next. Please push to kvm-ppc-next on your github Linux tree as well; please keep an eye on Ah, sorry. I pushed to kvm-ppc-next

Re: [PULL 00/12] ppc patch queue 2015-08-22

2015-08-23 Thread Alexander Graf
On 22.08.15 15:32, Paolo Bonzini wrote: On 22/08/2015 02:21, Alexander Graf wrote: Hi Paolo, This is my current patch queue for ppc. Please pull. Done, but this queue has not been in linux-next. Please push to kvm-ppc-next on your github Linux tree as well; please keep an eye on

[PULL 07/12] KVM: PPC: Book3S HV: Fix race in reading change bit when removing HPTE

2015-08-22 Thread Alexander Graf
From: Paul Mackerras pau...@samba.org 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 completed. This means that when removing a HPTE, we need to read the HPTE after the invalidation

[PULL 04/12] KVM: PPC: add missing pt_regs initialization

2015-08-22 Thread Alexander Graf
From: Tudor Laurentiu b10...@freescale.com On this switch branch the regs initialization doesn't happen so add it. This was found with the help of a static code analysis tool. Signed-off-by: Laurentiu Tudor laurentiu.tu...@freescale.com Signed-off-by: Alexander Graf ag...@suse.de ---

[PULL 00/12] ppc patch queue 2015-08-22

2015-08-22 Thread Alexander Graf
Hi Paolo, This is my current patch queue for ppc. Please pull. Alex The following changes since commit 4d283ec908e617fa28bcb06bce310206f0655d67: x86/kvm: Rename VMX's segment access rights defines (2015-08-15 00:47:13 +0200) are available in the git repository at:

[PULL 03/12] KVM: PPC: Fix warnings from sparse

2015-08-22 Thread Alexander Graf
From: Thomas Huth th...@redhat.com When compiling the KVM code for POWER with make C=1, sparse complains about functions missing proper prototypes and a 64-bit constant missing the ULL prefix. Let's fix this by making the functions static or by including the proper header with the prototypes, and

[PULL 01/12] KVM: PPC: fix suspicious use of conditional operator

2015-08-22 Thread Alexander Graf
From: Tudor Laurentiu b10...@freescale.com This was signaled by a static code analysis tool. Signed-off-by: Laurentiu Tudor laurentiu.tu...@freescale.com Reviewed-by: Scott Wood scottw...@freescale.com Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/kvm/e500_mmu.c | 2 +- 1 file

[PULL 05/12] KVM: PPC: Book3S HV: Make use of unused threads when running guests

2015-08-22 Thread Alexander Graf
From: Paul Mackerras pau...@samba.org When running a virtual core of a guest that is configured with fewer threads per core than the physical cores have, the extra physical threads are currently unused. This makes it possible to use them to run one or more other virtual cores from the same guest

[PULL 06/12] KVM: PPC: Book3S HV: Implement dynamic micro-threading on POWER8

2015-08-22 Thread Alexander Graf
From: Paul Mackerras pau...@samba.org This builds on the ability to run more than one vcore on a physical core by using the micro-threading (split-core) modes of the POWER8 chip. Previously, only vcores from the same VM could be run together, and (on POWER8) only if they had just one thread per

[PULL 10/12] KVM: PPC: Book3S HV: Fix preempted vcore list locking

2015-08-22 Thread Alexander Graf
From: Paul Mackerras pau...@samba.org When a vcore gets preempted, we put it on the preempted vcore list for the current CPU. The runner task then calls schedule() and comes back some time later and takes itself off the list. We need to be careful to lock the list that it was put onto, which

[PULL 12/12] KVM: PPC: Book3S: correct width in XER handling

2015-08-22 Thread Alexander Graf
From: Sam bobroff sam.bobr...@au1.ibm.com In 64 bit kernels, the Fixed Point Exception Register (XER) is a 64 bit field (e.g. in kvm_regs and kvm_vcpu_arch) and in most places it is accessed as such. This patch corrects places where it is accessed as a 32 bit field by a 64 bit kernel. In some

[PULL 09/12] KVM: PPC: Book3S HV: Implement H_CLEAR_REF and H_CLEAR_MOD

2015-08-22 Thread Alexander Graf
From: Paul Mackerras pau...@samba.org This adds implementations for the H_CLEAR_REF (test and clear reference bit) and H_CLEAR_MOD (test and clear changed bit) hypercalls. When clearing the reference or change bit in the guest view of the HPTE, we also have to clear it in the real HPTE so that

[PULL 02/12] KVM: PPC: Remove PPC970 from KVM_BOOK3S_64_HV text in Kconfig

2015-08-22 Thread Alexander Graf
From: Thomas Huth th...@redhat.com Since the PPC970 support has been removed from the kvm-hv kernel module recently, we should also reflect this change in the help text of the corresponding Kconfig option. Signed-off-by: Thomas Huth th...@redhat.com Signed-off-by: Alexander Graf ag...@suse.de

[PULL 08/12] KVM: PPC: Book3S HV: Fix bug in dirty page tracking

2015-08-22 Thread Alexander Graf
From: Paul Mackerras pau...@samba.org This fixes a bug in the tracking of pages that get modified by the guest. If the guest creates a large-page HPTE, writes to memory somewhere within the large page, and then removes the HPTE, we only record the modified state for the first normal page within

[PULL 11/12] KVM: PPC: Book3S HV: Fix preempted vcore stolen time calculation

2015-08-22 Thread Alexander Graf
From: Paul Mackerras pau...@samba.org Whenever a vcore state is VCORE_PREEMPT we need to be counting stolen time for it. This currently isn't the case when we have a vcore that no longer has any runnable threads in it but still has a runner task, so we do an explicit call to

Re: [PULL 00/12] ppc patch queue 2015-08-22

2015-08-22 Thread Paolo Bonzini
On 22/08/2015 02:21, Alexander Graf wrote: Hi Paolo, This is my current patch queue for ppc. Please pull. Done, but this queue has not been in linux-next. Please push to kvm-ppc-next on your github Linux tree as well; please keep an eye on Steven Rothwell's messages in the next few days,

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

2015-08-20 Thread Paul Mackerras
On Mon, Aug 10, 2015 at 11:27:31AM -0400, Nicholas Krause wrote: This fixes the wrapper functions kvm_umap_hva_hv and the function kvm_unmap_hav_range_hv to return the return value of the function kvm_handle_hva or kvm_handle_hva_range that they are wrapped to call internally rather then

Re: [PATCH] book3s_hv_rmhandlers:Pass the correct trap argument to kvmhv_commence_exit

2015-08-16 Thread Gautham R Shenoy
Hi Sam, On Fri, Aug 14, 2015 at 03:07:28PM +1000, Sam Bobroff wrote: On Thu, May 21, 2015 at 01:57:04PM +0530, Gautham R. Shenoy wrote: In guest_exit_cont we call kvmhv_commence_exit which expects the trap number as the argument. However r3 doesn't contain the trap number at this point and

Re: [PATCH] book3s_hv_rmhandlers:Pass the correct trap argument to kvmhv_commence_exit

2015-08-13 Thread Sam Bobroff
On Thu, May 21, 2015 at 01:57:04PM +0530, Gautham R. Shenoy wrote: In guest_exit_cont we call kvmhv_commence_exit which expects the trap number as the argument. However r3 doesn't contain the trap number at this point and as a result we would be calling the function with a spurious trap

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

2015-08-13 Thread Michael Ellerman
On Wed, 2015-08-12 at 21:06 +0200, Alexander Graf wrote: On 10.08.15 17:27, Nicholas Krause wrote: This fixes the wrapper functions kvm_umap_hva_hv and the function kvm_unmap_hav_range_hv to return the return value of the function kvm_handle_hva or kvm_handle_hva_range that they are

Re: [PATCH v3 1/1] KVM: PPC: Book3S: correct width in XER handling

2015-08-12 Thread Alexander Graf
On 06.08.15 12:16, Laurent Vivier wrote: Hi, I'd also like to see this patch in the mainstream as it fixes a bug appearing when we switch from vCPU context to hypervisor context (guest crash). Thanks, applied to kvm-ppc-queue. Alex -- To unsubscribe from this list: send the line

Re: [PATCH] kvm:powerpc:Fix incorrect return statement in the function mpic_set_default_irq_routing

2015-08-12 Thread Alexander Graf
On 07.08.15 17:54, Nicholas Krause wrote: This fixes the incorrect return statement in the function mpic_set_default_irq_routing from always returning zero to signal success to this function's caller to instead return the return value of kvm_set_irq_routing as this function can fail and we

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

2015-08-12 Thread Alexander Graf
On 10.08.15 17:27, Nicholas Krause wrote: This fixes the wrapper functions kvm_umap_hva_hv and the function kvm_unmap_hav_range_hv to return the return value of the function kvm_handle_hva or kvm_handle_hva_range that they are wrapped to call internally rather then always making the caller

Re: [PATCH] kvm:powerpc:Fix incorrect return statement in the function mpic_set_default_irq_routing

2015-08-12 Thread Alexander Graf
On 12.08.15 21:06, nick wrote: On 2015-08-12 03:05 PM, Alexander Graf wrote: On 07.08.15 17:54, Nicholas Krause wrote: This fixes the incorrect return statement in the function mpic_set_default_irq_routing from always returning zero to signal success to this function's caller to

Re: [PATCH] kvm:powerpc:Fix error handling in the function mpic_set_default_irq_routing

2015-08-07 Thread Paolo Bonzini
On 07/08/2015 15:47, Nicholas Krause wrote: - kvm_set_irq_routing(opp-kvm, routing, 0, 0); + ret = kvm_set_irq_routing(opp-kvm, routing, 0, 0); + if (ret) { + kfree(routing); + return ret; + } kfree(routing); return 0; You could

Re: [PATCH] kvm:powerpc:Fix error handling in the function mpic_set_default_irq_routing

2015-08-07 Thread Paolo Bonzini
On 06/08/2015 19:13, Nicholas Krause wrote: diff --git a/arch/powerpc/kvm/mpic.c b/arch/powerpc/kvm/mpic.c index 6249cdc..5a18859 100644 --- a/arch/powerpc/kvm/mpic.c +++ b/arch/powerpc/kvm/mpic.c @@ -1641,13 +1641,16 @@ static void mpic_destroy(struct kvm_device *dev) static int

Re: [PATCH v3 1/1] KVM: PPC: Book3S: correct width in XER handling

2015-08-06 Thread Laurent Vivier
Hi, I'd also like to see this patch in the mainstream as it fixes a bug appearing when we switch from vCPU context to hypervisor context (guest crash). Laurent On 06/08/2015 03:25, Sam Bobroff wrote: Ping? I think I've addressed all the comments in this version. Is there anything else I

Re: [PATCH v3 1/1] KVM: PPC: Book3S: correct width in XER handling

2015-08-05 Thread Sam Bobroff
Ping? I think I've addressed all the comments in this version. Is there anything else I need to look at? Cheers, Sam. On Wed, May 27, 2015 at 09:56:57AM +1000, Sam Bobroff wrote: In 64 bit kernels, the Fixed Point Exception Register (XER) is a 64 bit field (e.g. in kvm_regs and kvm_vcpu_arch)

Re: [kvm-unit-tests PATCH 10/14] powerpc/ppc64: relocate linker VMAs

2015-08-04 Thread Andrew Jones
On Tue, Aug 04, 2015 at 01:53:24PM +1000, David Gibson wrote: On Mon, Aug 03, 2015 at 04:41:27PM +0200, Andrew Jones wrote: QEMU loads the unit test, but due to the way it translates the unit test's linker VMA to the LMA, we can't just link such that VMA == LMA. Thus, we link with VMA ==

Re: [kvm-unit-tests PATCH 11/14] powerpc/ppc64: add rtas_power_off

2015-08-04 Thread Andrew Jones
On Tue, Aug 04, 2015 at 02:09:52PM +1000, David Gibson wrote: On Mon, Aug 03, 2015 at 07:08:17PM +0200, Paolo Bonzini wrote: On 03/08/2015 16:41, Andrew Jones wrote: Add enough RTAS support to support power-off, and apply it to exit(). Signed-off-by: Andrew Jones

Re: [kvm-unit-tests PATCH 08/14] powerpc/ppc64: add HV putchar

2015-08-04 Thread Andrew Jones
On Tue, Aug 04, 2015 at 01:50:39PM +1000, David Gibson wrote: On Mon, Aug 03, 2015 at 04:41:25PM +0200, Andrew Jones wrote: Add the hvcall for putchar and use it in puts. That, along with a couple more lines in start to prepare for C code, and a branch to main(), gets us hello world. Run

Re: [kvm-unit-tests PATCH 11/14] powerpc/ppc64: add rtas_power_off

2015-08-04 Thread Paolo Bonzini
On 04/08/2015 09:47, Andrew Jones wrote: In early development we did have a hypercall mediated virtio model, but it was abandoned once we got PCI working. So I think by yours and Alex's responses, if we want testdev support then we should target using pci to expose it. I'm ok with that,

Re: [kvm-unit-tests PATCH 11/14] powerpc/ppc64: add rtas_power_off

2015-08-04 Thread Andrew Jones
On Tue, Aug 04, 2015 at 02:11:30PM +1000, David Gibson wrote: On Mon, Aug 03, 2015 at 04:41:28PM +0200, Andrew Jones wrote: Add enough RTAS support to support power-off, and apply it to exit(). Signed-off-by: Andrew Jones drjo...@redhat.com --- lib/powerpc/asm/rtas.h | 27

Re: [kvm-unit-tests PATCH 11/14] powerpc/ppc64: add rtas_power_off

2015-08-04 Thread Andrew Jones
On Tue, Aug 04, 2015 at 02:03:24PM +1000, David Gibson wrote: On Mon, Aug 03, 2015 at 04:41:28PM +0200, Andrew Jones wrote: Add enough RTAS support to support power-off, and apply it to exit(). Signed-off-by: Andrew Jones drjo...@redhat.com --- lib/powerpc/asm/rtas.h | 27

Re: [kvm-unit-tests PATCH 11/14] powerpc/ppc64: add rtas_power_off

2015-08-04 Thread Andrew Jones
On Tue, Aug 04, 2015 at 03:15:25PM +0200, Paolo Bonzini wrote: On 04/08/2015 09:47, Andrew Jones wrote: In early development we did have a hypercall mediated virtio model, but it was abandoned once we got PCI working. So I think by yours and Alex's responses, if we want testdev

Re: [kvm-unit-tests PATCH 11/14] powerpc/ppc64: add rtas_power_off

2015-08-04 Thread David Gibson
On Tue, Aug 04, 2015 at 09:54:44AM +0200, Andrew Jones wrote: On Tue, Aug 04, 2015 at 02:11:30PM +1000, David Gibson wrote: On Mon, Aug 03, 2015 at 04:41:28PM +0200, Andrew Jones wrote: Add enough RTAS support to support power-off, and apply it to exit(). Signed-off-by: Andrew

Re: [kvm-unit-tests PATCH 11/14] powerpc/ppc64: add rtas_power_off

2015-08-04 Thread David Gibson
On Tue, Aug 04, 2015 at 09:47:59AM +0200, Andrew Jones wrote: On Tue, Aug 04, 2015 at 02:09:52PM +1000, David Gibson wrote: On Mon, Aug 03, 2015 at 07:08:17PM +0200, Paolo Bonzini wrote: On 03/08/2015 16:41, Andrew Jones wrote: Add enough RTAS support to support power-off, and

[kvm-unit-tests PATCH 11/14] powerpc/ppc64: add rtas_power_off

2015-08-03 Thread Andrew Jones
Add enough RTAS support to support power-off, and apply it to exit(). Signed-off-by: Andrew Jones drjo...@redhat.com --- lib/powerpc/asm/rtas.h | 27 lib/powerpc/io.c| 3 ++ lib/powerpc/rtas.c | 84 +

[kvm-unit-tests PATCH 04/14] powerpc/ppc64: start skeleton framework

2015-08-03 Thread Andrew Jones
Use the arm/arm64 framework as a template to start a skeleton for powerpc/ppc64. Copy the arm makefiles and linker script verbatim. We'll modify them for powerpc with the next patch, making it clear what needs to be changed. Signed-off-by: Andrew Jones drjo...@redhat.com --- configure

[kvm-unit-tests PATCH 05/14] powerpc/pp64: ppc-ify makefiles and linker script

2015-08-03 Thread Andrew Jones
Signed-off-by: Andrew Jones drjo...@redhat.com --- powerpc/Makefile.common | 44 +--- powerpc/Makefile.ppc64 | 16 powerpc/flat.lds| 14 ++ 3 files changed, 31 insertions(+), 43 deletions(-) diff --git

[kvm-unit-tests PATCH 07/14] powerpc/ppc64: add bootloader to bounce into memory

2015-08-03 Thread Andrew Jones
Committing the binary, since there's little point in rebuilding, and it requires SLOF's build_romfs tool, which is not part of this source repository. Signed-off-by: Andrew Jones drjo...@redhat.com --- powerpc/boot_rom.bin | Bin 0 - 280 bytes 1 file changed, 0 insertions(+), 0 deletions(-)

[kvm-unit-tests PATCH 02/14] lib: share arm-selftest utility functions

2015-08-03 Thread Andrew Jones
arm-selftest has a couple utility functions that could be useful to other unit tests, even other architectures. So move them out. split_var moves to lib/util, where we can add other random utilities over time. assert_args inspires report_abort, which allows us to report a message, using the

[kvm-unit-tests PATCH 14/14] mkstandalone: add support for powerpc

2015-08-03 Thread Andrew Jones
PowerPC needs firmware and an exit code snooper. Signed-off-by: Andrew Jones drjo...@redhat.com --- configure | 3 +++ powerpc/run | 2 +- scripts/mkstandalone.sh | 50 + 3 files changed, 50 insertions(+), 5 deletions(-)

[kvm-unit-tests PATCH 10/14] powerpc/ppc64: relocate linker VMAs

2015-08-03 Thread Andrew Jones
QEMU loads the unit test, but due to the way it translates the unit test's linker VMA to the LMA, we can't just link such that VMA == LMA. Thus, we link with VMA == 0x0, and then deal with relocation. Signed-off-by: Andrew Jones drjo...@redhat.com --- configure | 2 ++

[kvm-unit-tests PATCH 00/14] ppc64: initial drop

2015-08-03 Thread Andrew Jones
This series is the first series of a series of series that will bring support to kvm-unit-tests for ppc64, and eventually ppc64le. (Yes, the word 'series' is four times in that sentence. And now I've typed 'series' five times! Wait, now six times! OK, moving on...) This series brings basic setup;

[kvm-unit-tests PATCH 01/14] lib: asm-generic: add missing casts

2015-08-03 Thread Andrew Jones
Signed-off-by: Andrew Jones drjo...@redhat.com --- lib/asm-generic/io.h | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/asm-generic/io.h b/lib/asm-generic/io.h index a9939d3a5921f..abd245676e97a 100644 --- a/lib/asm-generic/io.h +++ b/lib/asm-generic/io.h @@

[kvm-unit-tests PATCH 13/14] powerpc/ppc64: add run script and unittests.cfg

2015-08-03 Thread Andrew Jones
Now that we have all the pieces, pull them together into the run script. To run a test do ./powerpc-run powerpc/test.elf To run all tests in unittests.cfg do ./run_tests.sh Signed-off-by: Andrew Jones drjo...@redhat.com --- powerpc/run | 57

[kvm-unit-tests PATCH 06/14] powerpc/ppc64: add boot rom source

2015-08-03 Thread Andrew Jones
Make a one line replacement for SLOF. This bootloader just jumps to 0x40, because we know the kernel will be there. This commit allows rebuilding of the bootloader, as long as the SLOF build_romfs tool is present, but since it would be a pain to require that tool for ever build, we'll just

[kvm-unit-tests PATCH 08/14] powerpc/ppc64: add HV putchar

2015-08-03 Thread Andrew Jones
Add the hvcall for putchar and use it in puts. That, along with a couple more lines in start to prepare for C code, and a branch to main(), gets us hello world. Run with qemu-system-ppc64 -M pseries\ -bios powerpc/boot_rom.bin \ -display none -serial stdio \

[kvm-unit-tests PATCH 03/14] config: no need to mix arch makefiles

2015-08-03 Thread Andrew Jones
Move the config/config-*.mak files to their own directories and rename to Makefile.* README is also updated to reflect the change, as well as to remove an optimistic reference to a non-existent docs directory. Signed-off-by: Andrew Jones drjo...@redhat.com --- Makefile

[kvm-unit-tests PATCH 09/14] powerpc/ppc64: adapt arm's setup

2015-08-03 Thread Andrew Jones
Copy arm's setup code (also DT based) over to powerpc, adapting it a bit. Also bring over arm's setup selftest, giving powerpc its first test. Signed-off-by: Andrew Jones drjo...@redhat.com --- lib/powerpc/asm/setup.h | 27 lib/powerpc/setup.c | 82

[kvm-unit-tests PATCH 12/14] scripts: add exit code snooper

2015-08-03 Thread Andrew Jones
Add a function that reads test output streams and just forwards it on to stdout, except when a line is 'EXIT: STATUS=%d', at which point it grabs the status to use as the exit code. Tests that always exit with zero (due to how they inform QEMU to quit), can now return other status codes. Run with

Re: [kvm-unit-tests PATCH 11/14] powerpc/ppc64: add rtas_power_off

2015-08-03 Thread Alexander Graf
On 03.08.15 19:02, Andrew Jones wrote: On Mon, Aug 03, 2015 at 07:08:17PM +0200, Paolo Bonzini wrote: On 03/08/2015 16:41, Andrew Jones wrote: Add enough RTAS support to support power-off, and apply it to exit(). Signed-off-by: Andrew Jones drjo...@redhat.com Why not use virtio-mmio +

Re: [kvm-unit-tests PATCH 10/14] powerpc/ppc64: relocate linker VMAs

2015-08-03 Thread David Gibson
On Mon, Aug 03, 2015 at 04:41:27PM +0200, Andrew Jones wrote: QEMU loads the unit test, but due to the way it translates the unit test's linker VMA to the LMA, we can't just link such that VMA == LMA. Thus, we link with VMA == 0x0, and then deal with relocation. Signed-off-by: Andrew Jones

Re: [kvm-unit-tests PATCH 11/14] powerpc/ppc64: add rtas_power_off

2015-08-03 Thread David Gibson
On Mon, Aug 03, 2015 at 04:41:28PM +0200, Andrew Jones wrote: Add enough RTAS support to support power-off, and apply it to exit(). Signed-off-by: Andrew Jones drjo...@redhat.com --- lib/powerpc/asm/rtas.h | 27 lib/powerpc/io.c| 3 ++ lib/powerpc/rtas.c |

Re: [kvm-unit-tests PATCH 11/14] powerpc/ppc64: add rtas_power_off

2015-08-03 Thread David Gibson
On Mon, Aug 03, 2015 at 04:41:28PM +0200, Andrew Jones wrote: Add enough RTAS support to support power-off, and apply it to exit(). Signed-off-by: Andrew Jones drjo...@redhat.com --- lib/powerpc/asm/rtas.h | 27 lib/powerpc/io.c| 3 ++ lib/powerpc/rtas.c |

Re: [kvm-unit-tests PATCH 08/14] powerpc/ppc64: add HV putchar

2015-08-03 Thread David Gibson
On Mon, Aug 03, 2015 at 04:41:25PM +0200, Andrew Jones wrote: Add the hvcall for putchar and use it in puts. That, along with a couple more lines in start to prepare for C code, and a branch to main(), gets us hello world. Run with qemu-system-ppc64 -M pseries\ -bios

Re: [kvm-unit-tests PATCH 11/14] powerpc/ppc64: add rtas_power_off

2015-08-03 Thread David Gibson
On Mon, Aug 03, 2015 at 07:08:17PM +0200, Paolo Bonzini wrote: On 03/08/2015 16:41, Andrew Jones wrote: Add enough RTAS support to support power-off, and apply it to exit(). Signed-off-by: Andrew Jones drjo...@redhat.com Why not use virtio-mmio + testdev on ppc as well? Similar

Re: [kvm-unit-tests PATCH 11/14] powerpc/ppc64: add rtas_power_off

2015-08-03 Thread Paolo Bonzini
On 03/08/2015 16:41, Andrew Jones wrote: Add enough RTAS support to support power-off, and apply it to exit(). Signed-off-by: Andrew Jones drjo...@redhat.com Why not use virtio-mmio + testdev on ppc as well? Similar to how we're not using PSCI on ARM or ACPI on x86. Paolo -- To

Re: [kvm-unit-tests PATCH 00/14] ppc64: initial drop

2015-08-03 Thread Paolo Bonzini
On 03/08/2015 16:41, Andrew Jones wrote: This series is the first series of a series of series that will bring support to kvm-unit-tests for ppc64, and eventually ppc64le. (Yes, the word 'series' is four times in that sentence. And now I've typed 'series' five times! Wait, now six times! OK,

Re: [kvm-unit-tests PATCH 11/14] powerpc/ppc64: add rtas_power_off

2015-08-03 Thread Andrew Jones
On Mon, Aug 03, 2015 at 07:08:17PM +0200, Paolo Bonzini wrote: On 03/08/2015 16:41, Andrew Jones wrote: Add enough RTAS support to support power-off, and apply it to exit(). Signed-off-by: Andrew Jones drjo...@redhat.com Why not use virtio-mmio + testdev on ppc as well? Similar

Re: powerpc/rtas: Introduce rtas_get_sensor_fast() for IRQ handlers

2015-08-02 Thread Michael Ellerman
On Fri, 2015-17-07 at 10:46:58 UTC, Thomas Huth wrote: The EPOW interrupt handler uses rtas_get_sensor(), which in turn uses rtas_busy_delay() to wait for RTAS becoming ready in case it is necessary. But rtas_busy_delay() is annotated with might_sleep() and thus may not be used by interrupts

Re: [PATCH v5 1/2] perf,kvm/ppc: Add kvm_perf.h for powerpc

2015-07-31 Thread Scott Wood
[Added KVM lists and a couple relevant people] On Fri, 2015-07-31 at 14:25 +0530, Hemant Kumar wrote: On 07/30/2015 03:52 AM, Scott Wood wrote: On Wed, 2015-07-29 at 16:07 +0530, Hemant Kumar wrote: Hi Scott, On 07/17/2015 01:40 AM, Scott Wood wrote: On Thu, 2015-07-16 at 21:18

[PATCH 06/14] MIPS: use pseek() in ELF kernel image loading

2015-07-30 Thread Andre Przywara
Use the newly introduced pseek() function when skipping to the start offset in the ELF file. The layout of an ELF file should satisfy the constraints of pseek, so that we should be able to use a pipe file descriptor as well. Signed-off-by: Andre Przywara andre.przyw...@arm.com --- mips/kvm.c | 4

[PATCH 12/14] powerpc: use read_file() in kernel and initrd loading

2015-07-30 Thread Andre Przywara
Replace the unsafe read-loops in the powerpc kernel image loading function with our new and safe read_file() wrapper. This should fix random fails in kernel image loading, especially from pipes and sockets. Signed-off-by: Andre Przywara andre.przyw...@arm.com --- powerpc/kvm.c | 36

[PATCH 00/14] kvmtool: Refactor kernel image loading to allow pipes

2015-07-30 Thread Andre Przywara
Currently kvmtool uses rewinds (lseeks to position 0) on kernel image files. This prevents non-regular files (for instance pipes in the -k parameter) from being used as a kernel image file. This series reworks the kernel loading to avoid any seeks and allows to pipe in kernel images on the

[PATCH 08/14] MIPS: remove seeks from load_flat_binary()

2015-07-30 Thread Andre Przywara
Remove the need to rewind the kernel image file if loading it as a flat binary by re-using the already read portion of the file passed in as a buffer. This allows the MIPS flat binary kernel image to be read from a pipe. Signed-off-by: Andre Przywara andre.przyw...@arm.com --- mips/kvm.c | 14

[PATCH 05/14] kvmtool: introduce pseek

2015-07-30 Thread Andre Przywara
pseek is a wrapper around lseek(2), which can cope with non-seekable file descriptors. The limitation is of course that we only can seek forward and only relative to the current position (hence the whence parameter is missing). In this case pseek will do dummy reads to skip over the requested

[PATCH 13/14] MIPS: use read wrappers in kernel loading

2015-07-30 Thread Andre Przywara
Replace the unsafe read-loops used in the MIPS kernel image loading with our safe read_file() and read_in_full() wrappers. This should fix random fails in kernel image loading, especially from pipes and sockets. Signed-off-by: Andre Przywara andre.przyw...@arm.com --- mips/kvm.c | 35

<    1   2   3   4   5   6   7   8   9   10   >