Re: [PATCH 0/8] kvm/ppc: fixes for 3.10

2013-07-09 Thread tiejun.chen
On 06/07/2013 08:16 AM, Scott Wood wrote: Most of these have been posted before, but I grouped them together as there are some contextual dependencies between them. Gleb/Paolo: As Alex doesn't appear to be back yet, can you apply these if there's no objection over the next few days? Scott and

Re: [PATCH 0/8] kvm/ppc: fixes for 3.10

2013-07-09 Thread Alexander Graf
Am 09.07.2013 um 09:21 schrieb tiejun.chen tiejun.c...@windriver.com: On 06/07/2013 08:16 AM, Scott Wood wrote: Most of these have been posted before, but I grouped them together as there are some contextual dependencies between them. Gleb/Paolo: As Alex doesn't appear to be back yet, can

Re: [PATCH 0/8] kvm/ppc: fixes for 3.10

2013-07-09 Thread tiejun.chen
On 07/09/2013 04:53 PM, Alexander Graf wrote: Am 09.07.2013 um 09:21 schrieb tiejun.chen tiejun.c...@windriver.com: On 06/07/2013 08:16 AM, Scott Wood wrote: Most of these have been posted before, but I grouped them together as there are some contextual dependencies between them.

Re: [PATCH 2/8] KVM: PPC: reserve a capability and ioctl numbers for realmode VFIO

2013-07-09 Thread Alexander Graf
On 06/27/2013 07:02 AM, Alexey Kardashevskiy wrote: Signed-off-by: Alexey Kardashevskiya...@ozlabs.ru --- include/uapi/linux/kvm.h |2 ++ 1 file changed, 2 insertions(+) diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h index 970b1f5..0865c01 100644 ---

Re: [PATCH 4/8] powerpc: Prepare to support kernel handling of IOMMU map/unmap

2013-07-09 Thread Alexander Graf
On 07/08/2013 03:33 AM, Benjamin Herrenschmidt wrote: On Sun, 2013-07-07 at 01:07 +1000, Alexey Kardashevskiy wrote: The current VFIO-on-POWER implementation supports only user mode driven mapping, i.e. QEMU is sending requests to map/unmap pages. However this approach is really slow, so we

Re: [PATCH 5/8] powerpc: add real mode support for dma operations on powernv

2013-07-09 Thread Alexander Graf
On 07/06/2013 05:07 PM, Alexey Kardashevskiy wrote: The existing TCE machine calls (tce_build and tce_free) only support virtual mode as they call __raw_writeq for TCE invalidation what fails in real mode. This introduces tce_build_rm and tce_free_rm real mode versions which do mostly the same

Re: [PATCH 7/8] KVM: PPC: Add support for IOMMU in-kernel handling

2013-07-09 Thread Alexander Graf
On 07/06/2013 05:07 PM, Alexey Kardashevskiy wrote: This allows the host kernel to handle H_PUT_TCE, H_PUT_TCE_INDIRECT and H_STUFF_TCE requests without passing them to QEMU, which saves time on switching to QEMU and back. Both real and virtual modes are supported. First the kernel tries to

Re: [PATCH 2/2] KVM: PPC: Book3E: Get vcpu's last instruction for emulation

2013-07-09 Thread Scott Wood
On 07/08/2013 08:39:05 AM, Alexander Graf wrote: On 28.06.2013, at 11:20, Mihai Caraman wrote: lwepx faults needs to be handled by KVM and this implies additional code in DO_KVM macro to identify the source of the exception originated from host context. This requires to check the

Re: [PATCH 2/2] KVM: PPC: Book3E: Emulate MCSRR0/1 SPR and rfmci instruction

2013-07-09 Thread Scott Wood
On 07/08/2013 01:45:58 PM, Alexander Graf wrote: On 03.07.2013, at 15:30, Mihai Caraman wrote: Some guests are making use of return from machine check instruction to do crazy things even though the 64-bit kernel doesn't handle yet this interrupt. Emulate MCSRR0/1 SPR and rfmci instruction

Re: [PATCH 8/8] KVM: PPC: Add hugepage support for IOMMU in-kernel handling

2013-07-09 Thread Alexander Graf
On 07/06/2013 05:07 PM, Alexey Kardashevskiy wrote: This adds special support for huge pages (16MB). The reference counting cannot be easily done for such pages in real mode (when MMU is off) so we added a list of huge pages. It is populated in virtual mode and get_page is called just once per

Re: [PATCH 2/2] KVM: PPC: Book3E: Get vcpu's last instruction for emulation

2013-07-09 Thread Alexander Graf
On 07/09/2013 07:13 PM, Scott Wood wrote: On 07/08/2013 08:39:05 AM, Alexander Graf wrote: On 28.06.2013, at 11:20, Mihai Caraman wrote: lwepx faults needs to be handled by KVM and this implies additional code in DO_KVM macro to identify the source of the exception originated from host

Re: [PATCH 2/2] KVM: PPC: Book3E: Emulate MCSRR0/1 SPR and rfmci instruction

2013-07-09 Thread Alexander Graf
On 07/09/2013 07:16 PM, Scott Wood wrote: On 07/08/2013 01:45:58 PM, Alexander Graf wrote: On 03.07.2013, at 15:30, Mihai Caraman wrote: Some guests are making use of return from machine check instruction to do crazy things even though the 64-bit kernel doesn't handle yet this interrupt.

Re: [PATCH 2/2] KVM: PPC: Book3E: Emulate MCSRR0/1 SPR and rfmci instruction

2013-07-09 Thread Scott Wood
On 07/09/2013 12:46:32 PM, Alexander Graf wrote: On 07/09/2013 07:16 PM, Scott Wood wrote: On 07/08/2013 01:45:58 PM, Alexander Graf wrote: On 03.07.2013, at 15:30, Mihai Caraman wrote: Some guests are making use of return from machine check instruction to do crazy things even though the

Re: [PATCH 2/2] KVM: PPC: Book3E: Get vcpu's last instruction for emulation

2013-07-09 Thread Scott Wood
On 07/09/2013 12:44:32 PM, Alexander Graf wrote: On 07/09/2013 07:13 PM, Scott Wood wrote: On 07/08/2013 08:39:05 AM, Alexander Graf wrote: On 28.06.2013, at 11:20, Mihai Caraman wrote: lwepx faults needs to be handled by KVM and this implies additional code in DO_KVM macro to identify

Re: [PATCH 0/8] kvm/ppc: fixes for 3.10

2013-07-09 Thread Alexander Graf
On 09.07.2013, at 11:09, tiejun.chen wrote: On 07/09/2013 04:53 PM, Alexander Graf wrote: Am 09.07.2013 um 09:21 schrieb tiejun.chen tiejun.c...@windriver.com: On 06/07/2013 08:16 AM, Scott Wood wrote: Most of these have been posted before, but I grouped them together as there are

Re: [PATCH 2/2] KVM: PPC: Book3E: Get vcpu's last instruction for emulation

2013-07-09 Thread Alexander Graf
On 09.07.2013, at 20:46, Scott Wood wrote: On 07/09/2013 12:44:32 PM, Alexander Graf wrote: On 07/09/2013 07:13 PM, Scott Wood wrote: On 07/08/2013 08:39:05 AM, Alexander Graf wrote: On 28.06.2013, at 11:20, Mihai Caraman wrote: lwepx faults needs to be handled by KVM and this implies

Re: [PATCH 2/2] KVM: PPC: Book3E: Get vcpu's last instruction for emulation

2013-07-09 Thread Alexander Graf
On 28.06.2013, at 11:20, Mihai Caraman wrote: lwepx faults needs to be handled by KVM and this implies additional code in DO_KVM macro to identify the source of the exception originated from host context. This requires to check the Exception Syndrome Register (ESR[EPID]) and External PID

Re: [PATCH 2/2] KVM: PPC: Book3E: Emulate MCSRR0/1 SPR and rfmci instruction

2013-07-09 Thread Alexander Graf
On 09.07.2013, at 20:29, Scott Wood wrote: On 07/09/2013 12:46:32 PM, Alexander Graf wrote: On 07/09/2013 07:16 PM, Scott Wood wrote: On 07/08/2013 01:45:58 PM, Alexander Graf wrote: On 03.07.2013, at 15:30, Mihai Caraman wrote: Some guests are making use of return from machine check

Re: [PATCH 2/2] KVM: PPC: Book3E: Emulate MCSRR0/1 SPR and rfmci instruction

2013-07-09 Thread Scott Wood
On 07/09/2013 04:49:32 PM, Alexander Graf wrote: On 09.07.2013, at 20:29, Scott Wood wrote: On 07/09/2013 12:46:32 PM, Alexander Graf wrote: On 07/09/2013 07:16 PM, Scott Wood wrote: On 07/08/2013 01:45:58 PM, Alexander Graf wrote: On 03.07.2013, at 15:30, Mihai Caraman wrote: Some

Re: [PATCH 2/2] KVM: PPC: Book3E: Emulate MCSRR0/1 SPR and rfmci instruction

2013-07-09 Thread Alexander Graf
On 09.07.2013, at 23:54, Scott Wood wrote: On 07/09/2013 04:49:32 PM, Alexander Graf wrote: On 09.07.2013, at 20:29, Scott Wood wrote: On 07/09/2013 12:46:32 PM, Alexander Graf wrote: On 07/09/2013 07:16 PM, Scott Wood wrote: On 07/08/2013 01:45:58 PM, Alexander Graf wrote: On

Re: [PATCH 2/2] KVM: PPC: Book3E: Emulate MCSRR0/1 SPR and rfmci instruction

2013-07-09 Thread Scott Wood
On 07/09/2013 05:00:26 PM, Alexander Graf wrote: On 09.07.2013, at 23:54, Scott Wood wrote: On 07/09/2013 04:49:32 PM, Alexander Graf wrote: Not sure I understand. What the timing stats do is that they measure the time between [exit ... entry], right? We'd do the same thing, just all in

Re: [PATCH 8/8] KVM: PPC: Add hugepage support for IOMMU in-kernel handling

2013-07-09 Thread Alexey Kardashevskiy
On 07/10/2013 03:32 AM, Alexander Graf wrote: On 07/06/2013 05:07 PM, Alexey Kardashevskiy wrote: This adds special support for huge pages (16MB). The reference counting cannot be easily done for such pages in real mode (when MMU is off) so we added a list of huge pages. It is populated in

Re: [PATCH 2/8] KVM: PPC: reserve a capability and ioctl numbers for realmode VFIO

2013-07-09 Thread Alexey Kardashevskiy
On 07/10/2013 01:35 AM, Alexander Graf wrote: On 06/27/2013 07:02 AM, Alexey Kardashevskiy wrote: Signed-off-by: Alexey Kardashevskiya...@ozlabs.ru --- include/uapi/linux/kvm.h |2 ++ 1 file changed, 2 insertions(+) diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h

Re: [PATCH 2/2] KVM: PPC: Book3E: Emulate MCSRR0/1 SPR and rfmci instruction

2013-07-09 Thread Steven Rostedt
On Wed, 2013-07-10 at 00:00 +0200, Alexander Graf wrote: Then don't overflow the buffer. Make it large enough. IIRC ftrace improved recently to dynamically increase the buffer size too. Steven, do I remember correctly here? Not really. Ftrace only dynamically increases the buffer when the

Re: [PATCH 2/2] KVM: PPC: Book3E: Emulate MCSRR0/1 SPR and rfmci instruction

2013-07-09 Thread Steven Rostedt
On Tue, 2013-07-09 at 17:26 -0500, Scott Wood wrote: On 07/09/2013 05:00:26 PM, Alexander Graf wrote: On 09.07.2013, at 23:54, Scott Wood wrote: On 07/09/2013 04:49:32 PM, Alexander Graf wrote: Not sure I understand. What the timing stats do is that they measure the time between

Re: [PATCH 2/2] KVM: PPC: Book3E: Get vcpu's last instruction for emulation

2013-07-09 Thread Scott Wood
On 07/09/2013 04:44:24 PM, Alexander Graf wrote: On 09.07.2013, at 20:46, Scott Wood wrote: I suspect that tlbsx is faster, or at worst similar. And unlike comparing tlbsx to lwepx (not counting a fix for the threading problem), we don't already have code to search the guest TLB, so

Re: [PATCH 2/2] KVM: PPC: Book3E: Get vcpu's last instruction for emulation

2013-07-09 Thread Scott Wood
On 07/09/2013 04:45:10 PM, Alexander Graf wrote: On 28.06.2013, at 11:20, Mihai Caraman wrote: + /* Get page size */ + if (MAS0_GET_TLBSEL(mfspr(SPRN_MAS0)) == 0) + psize_shift = PAGE_SHIFT; + else + psize_shift = MAS1_GET_TSIZE(mas1) + 10; + + mas7_mas3 = (((u64)

Re: [PATCH 5/8] powerpc: add real mode support for dma operations on powernv

2013-07-09 Thread Benjamin Herrenschmidt
On Tue, 2013-07-09 at 18:02 +0200, Alexander Graf wrote: On 07/06/2013 05:07 PM, Alexey Kardashevskiy wrote: The existing TCE machine calls (tce_build and tce_free) only support virtual mode as they call __raw_writeq for TCE invalidation what fails in real mode. This introduces

Re: [PATCH 6/8] KVM: PPC: Add support for multiple-TCE hcalls

2013-07-09 Thread Alexey Kardashevskiy
On 07/10/2013 03:02 AM, Alexander Graf wrote: On 07/06/2013 05:07 PM, Alexey Kardashevskiy wrote: This adds real mode handlers for the H_PUT_TCE_INDIRECT and H_STUFF_TCE hypercalls for QEMU emulated devices such as IBMVIO devices or emulated PCI. These calls allow adding multiple entries (up