Re: [PATCH 1/2] kvm/powerpc: rename kvm_hypercall() to epapr_hypercall()

2013-10-04 Thread Alexander Graf
On 04.10.2013, at 06:26, Bhushan Bharat-R65777 wrote: -Original Message- From: Wood Scott-B07421 Sent: Thursday, October 03, 2013 12:04 AM To: Alexander Graf Cc: Bhushan Bharat-R65777; kvm-ppc@vger.kernel.org; k...@vger.kernel.org; Bhushan Bharat-R65777 Subject: Re: [PATCH

Re: [RFC] QEMU/KVM PowerPC: virtio and guest endianness

2013-10-04 Thread Alexander Graf
CC'ing qemu-devel - please use qemu-ppc@ only as a tag, every mail needs to go to qemu-devel as well. On 03.10.2013, at 16:29, Greg Kurz wrote: Hi, There have been some work on the topic lately but no agreement has been reached yet. I want to consolidate the facts in a single thread of

[PATCH 1/2] KVM: PPC: Book3S HV: Add missing break statements in ONE_REG switches

2013-10-04 Thread Paul Mackerras
This adds break statements after the KVM_REG_PPC_PPR case in kvmppc_get_one_reg() and kvmppc_set_one_reg(). The error was introduced in commit d3ecc54390 (KVM: PPC: Book3S HV: Support POWER6 compatibility mode on POWER7). That commit also forgot to update Documentation/virtual/kvm/api.txt with

[PATCH 0/2] KVM: PPC: Some more fixes for HV KVM

2013-10-04 Thread Paul Mackerras
Here are two small patches for HV KVM. The first patch in this series corrects some silly errors in one of the patches I sent recently. The second gives us a way to detect when we get an exception in the HV guest entry/exit code, and is a prerequisite for the HV/PR unification patches that

[PATCH 2/2] KVM: PPC: Book3S HV: Better handling of exceptions that happen in real mode

2013-10-04 Thread Paul Mackerras
When an interrupt or exception happens in the guest that comes to the host, the CPU goes to hypervisor real mode (MMU off) to handle the exception but doesn't change the MMU context. After saving a few registers, we then clear the in guest flag. If, for any reason, we get an exception in the

Re: [RFC] QEMU/KVM PowerPC: virtio and guest endianness

2013-10-04 Thread Paul Mackerras
On Thu, Oct 03, 2013 at 04:29:52PM +0200, Greg Kurz wrote: Hi, There have been some work on the topic lately but no agreement has been reached yet. I want to consolidate the facts in a single thread of mail and re-start the discussion. Please find below a recap of what we have as of today:

Re: [Qemu-ppc] [RFC] QEMU/KVM PowerPC: virtio and guest endianness

2013-10-04 Thread Alexander Graf
On 04.10.2013, at 13:53, Paul Mackerras wrote: On Thu, Oct 03, 2013 at 04:29:52PM +0200, Greg Kurz wrote: Hi, There have been some work on the topic lately but no agreement has been reached yet. I want to consolidate the facts in a single thread of mail and re-start the discussion. Please

Re: [PATCH 2/2] KVM: PPC: Book3S HV: Better handling of exceptions that happen in real mode

2013-10-04 Thread Alexander Graf
On 04.10.2013, at 13:45, Paul Mackerras wrote: When an interrupt or exception happens in the guest that comes to the host, the CPU goes to hypervisor real mode (MMU off) to handle the exception but doesn't change the MMU context. After saving a few registers, we then clear the in guest

Re: [PATCH] kvm: powerpc: book3s: Fix build break for BOOK3S_32

2013-10-04 Thread Alexander Graf
On 03.10.2013, at 06:14, Paul Mackerras wrote: On Wed, Oct 02, 2013 at 08:08:44PM +0530, Aneesh Kumar K.V wrote: From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com This was introduced by 85a0d845d8bb5df5d2669416212f56cbe1474c6b It's a good idea to give the headline of the commit as

[RFC PATCH] PPC: KVM: vfio kvm device: support spapr tce

2013-10-04 Thread Alexey Kardashevskiy
This is a very rough change set required for ppc64 to use this KVM device. vfio_rm.c is a piece of code which is going to be called from the realmode (MMU off), and I will put everything spapr-related under #ifdef CONFIG_SPAPR_TCE_IOMMU, it is just friday and I have to run :) This is an RFC but

Re: [PATCH] kvm: powerpc: book3s: Fix build break for BOOK3S_32

2013-10-04 Thread Alexander Graf
On 04.10.2013, at 14:23, Alexander Graf wrote: On 03.10.2013, at 06:14, Paul Mackerras wrote: On Wed, Oct 02, 2013 at 08:08:44PM +0530, Aneesh Kumar K.V wrote: From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com This was introduced by 85a0d845d8bb5df5d2669416212f56cbe1474c6b It's

Re: [PATCH 2/2] KVM: PPC: Book3S HV: Better handling of exceptions that happen in real mode

2013-10-04 Thread Paul Mackerras
On Fri, Oct 04, 2013 at 01:59:25PM +0200, Alexander Graf wrote: On 04.10.2013, at 13:45, Paul Mackerras wrote: When an interrupt or exception happens in the guest that comes to the host, the CPU goes to hypervisor real mode (MMU off) to handle the exception but doesn't change the MMU

Re: [PATCH] kvm: powerpc: book3s: Fix build break for BOOK3S_32

2013-10-04 Thread Paul Mackerras
On Fri, Oct 04, 2013 at 02:27:02PM +0200, Alexander Graf wrote: On 04.10.2013, at 14:23, Alexander Graf wrote: On 03.10.2013, at 06:14, Paul Mackerras wrote: On Wed, Oct 02, 2013 at 08:08:44PM +0530, Aneesh Kumar K.V wrote: From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com

Re: [RFC PATCH] KVM: PPC: Book3S: MMIO emulation support for little endian guests

2013-10-04 Thread Alexander Graf
On 03.10.2013, at 13:03, Cédric Le Goater wrote: MMIO emulation reads the last instruction executed by the guest and then emulates. If the guest is running in Little Endian mode, the instruction needs to be byte-swapped before being emulated. This patch stores the last instruction in the

Re: [PATCH 2/2] KVM: PPC: Book3S HV: Better handling of exceptions that happen in real mode

2013-10-04 Thread Alexander Graf
On 04.10.2013, at 14:33, Paul Mackerras wrote: On Fri, Oct 04, 2013 at 01:59:25PM +0200, Alexander Graf wrote: On 04.10.2013, at 13:45, Paul Mackerras wrote: When an interrupt or exception happens in the guest that comes to the host, the CPU goes to hypervisor real mode (MMU off) to

Re: [PATCH] kvm: powerpc: book3s: Fix build break for BOOK3S_32

2013-10-04 Thread Alexander Graf
On 04.10.2013, at 14:35, Paul Mackerras wrote: On Fri, Oct 04, 2013 at 02:27:02PM +0200, Alexander Graf wrote: On 04.10.2013, at 14:23, Alexander Graf wrote: On 03.10.2013, at 06:14, Paul Mackerras wrote: On Wed, Oct 02, 2013 at 08:08:44PM +0530, Aneesh Kumar K.V wrote: From: Aneesh

Re: [PATCH] KVM: PPC: Book3S HV: Fix typo in saving DSCR

2013-10-04 Thread Alexander Graf
On 21.09.2013, at 01:53, Paul Mackerras wrote: This fixes a typo in the code that saves the guest DSCR (Data Stream Control Register) into the kvm_vcpu_arch struct on guest exit. The effect of the typo was that the DSCR value was saved in the wrong place, so changes to the DSCR by the guest

Re: [PATCH 4/6 v5] kvm: powerpc: keep only pte search logic in lookup_linux_pte

2013-10-04 Thread Alexander Graf
On 19.09.2013, at 08:02, Bharat Bhushan wrote: lookup_linux_pte() was searching for a pte and also sets access flags is writable. This function now searches only pte while access flag setting is done explicitly. This pte lookup is not kvm specific, so moved to common code (asm/pgtable.h)

Re: [PATCH 1/2] kvm: powerpc: mark page accessed when mapping a guest page

2013-10-04 Thread Alexander Graf
On 07.08.2013, at 12:03, Bharat Bhushan wrote: Mark the guest page as accessed so that there is likely less chances of this page getting swap-out. Signed-off-by: Bharat Bhushan bharat.bhus...@freescale.com Thanks, applied to kvm-ppc-queue. Alex --- arch/powerpc/kvm/e500_mmu_host.c |

Re: [PATCH 2/2] kvm: ppc: booke: check range page invalidation progress on page setup

2013-10-04 Thread Alexander Graf
On 07.08.2013, at 12:03, Bharat Bhushan wrote: When the MM code is invalidating a range of pages, it calls the KVM kvm_mmu_notifier_invalidate_range_start() notifier function, which calls kvm_unmap_hva_range(), which arranges to flush all the TLBs for guest pages. However, the Linux PTEs for

RE: [PATCH 4/6 v5] kvm: powerpc: keep only pte search logic in lookup_linux_pte

2013-10-04 Thread Bhushan Bharat-R65777
-Original Message- From: Alexander Graf [mailto:ag...@suse.de] Sent: Friday, October 04, 2013 6:57 PM To: Bhushan Bharat-R65777 Cc: b...@kernel.crashing.org; pau...@samba.org; k...@vger.kernel.org; kvm- p...@vger.kernel.org; linuxppc-...@lists.ozlabs.org; Wood Scott-B07421;

Re: [Qemu-ppc] [RFC] QEMU/KVM PowerPC: virtio and guest endianness

2013-10-04 Thread Greg Kurz
On Fri, 4 Oct 2013 13:43:38 +0200 Alexander Graf ag...@suse.de wrote: CC'ing qemu-devel - please use qemu-ppc@ only as a tag, every mail needs to go to qemu-devel as well. Sure I will. On 03.10.2013, at 16:29, Greg Kurz wrote: [...] I have searched for an appropriate place to add the

Re: [RFC PATCH] KVM: PPC: Book3S: MMIO emulation support for little endian guests

2013-10-04 Thread Aneesh Kumar K.V
Cédric Le Goater c...@fr.ibm.com writes: MMIO emulation reads the last instruction executed by the guest and then emulates. If the guest is running in Little Endian mode, the instruction needs to be byte-swapped before being emulated. This patch stores the last instruction in the endian

Re: [PATCH 0/4 v6] KVM :PPC: Userspace Debug support

2013-10-04 Thread Alexander Graf
On 04.07.2013, at 08:57, Bharat Bhushan wrote: From: Bharat Bhushan bharat.bhus...@freescale.com Note: These patches depends on https://lkml.org/lkml/2013/7/4/49. This patchset adds the userspace debug support for booke/bookehv. this is tested on powerpc e500v2/e500mc devices. Thanks,

Re: [PATCH 0/6 v5] kvm: powerpc: use cache attributes from linux pte

2013-10-04 Thread Alexander Graf
On 19.09.2013, at 08:02, Bharat Bhushan wrote: From: Bharat Bhushan bharat.bhus...@freescale.com First patch is a typo fix where book3e define _PAGE_LENDIAN while it should be defined as _PAGE_ENDIAN. This seems to show that this is never exercised :-) Second and third patch is to

Re: [Qemu-ppc] [RFC] QEMU/KVM PowerPC: virtio and guest endianness

2013-10-04 Thread Greg Kurz
Answering to both Paul and Alex. On Fri, 4 Oct 2013 13:54:25 +0200 Alexander Graf ag...@suse.de wrote: On 04.10.2013, at 13:53, Paul Mackerras wrote: I don't mind particularly whether H_SET_MODE for the endianness setting gets handled in the kernel or in QEMU, but I don't think it

Re: [Qemu-ppc] [RFC] QEMU/KVM PowerPC: virtio and guest endianness

2013-10-04 Thread Alexander Graf
On 04.10.2013, at 16:08, Greg Kurz wrote: Answering to both Paul and Alex. On Fri, 4 Oct 2013 13:54:25 +0200 Alexander Graf ag...@suse.de wrote: On 04.10.2013, at 13:53, Paul Mackerras wrote: I don't mind particularly whether H_SET_MODE for the endianness setting gets handled in

Re: [PATCH] kvm: powerpc: book3s: Fix build break for BOOK3S_32

2013-10-04 Thread Aneesh Kumar K.V
Alexander Graf ag...@suse.de writes: On 04.10.2013, at 14:23, Alexander Graf wrote: On 03.10.2013, at 06:14, Paul Mackerras wrote: On Wed, Oct 02, 2013 at 08:08:44PM +0530, Aneesh Kumar K.V wrote: From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com This was introduced by

Re: [PATCH -V2] kvm: powerpc: book3s: Fix build break for BOOK3S_32

2013-10-04 Thread Alexander Graf
On 03.10.2013, at 09:58, Aneesh Kumar K.V wrote: From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com This was introduced by 85a0d845d8 (KVM: PPC: Book3S PR: Allocate kvm_vcpu structs from kvm_vcpu_cache). arch/powerpc/kvm/book3s_pr.c: In function 'kvmppc_core_vcpu_create':

[PATCH 0/3 v6] kvm: powerpc: use cache attributes from linux pte

2013-10-04 Thread Bharat Bhushan
From: Bharat Bhushan bharat.bhus...@freescale.com kvm: powerpc: use cache attributes from linux pte First patch is moving functions/logic in common code so they can be used on booke also. Second and Third patch is actually setting caching attributes (TLB.WIMGE) using corresponding Linux pte.

[PATCH 2/3 v6] kvm: booke: clear host tlb reference flag on guest tlb invalidation

2013-10-04 Thread Bharat Bhushan
On booke, struct tlbe_ref contains host tlb mapping information (pfn: for guest-pfn to pfn, flags: attribute associated with this mapping) for a guest tlb entry. So when a guest creates a TLB entry then struct tlbe_ref is set to point to valid pfn and set attributes in flags field of the above

[PATCH 3/3 v6] kvm: powerpc: use caching attributes as per linux pte

2013-10-04 Thread Bharat Bhushan
KVM uses same WIM tlb attributes as the corresponding qemu pte. For this we now search the linux pte for the requested page and get these cache caching/coherency attributes from pte. Signed-off-by: Bharat Bhushan bharat.bhus...@freescale.com --- v5-v6 - no change

[PATCH 1/3 v6] kvm: powerpc: keep only pte search logic in lookup_linux_pte

2013-10-04 Thread Bharat Bhushan
lookup_linux_pte() was searching for a pte and also sets access flags is writable. This function now searches only pte while access flag setting is done explicitly. This pte lookup is not kvm specific, so moved to common code (asm/pgtable.h) My Followup patch will use this on booke.

Re: [PATCH 1/3 v6] kvm: powerpc: keep only pte search logic in lookup_linux_pte

2013-10-04 Thread Alexander Graf
On 04.10.2013, at 16:55, Bharat Bhushan wrote: lookup_linux_pte() was searching for a pte and also sets access flags is writable. This function now searches only pte while access flag setting is done explicitly. This pte lookup is not kvm specific, so moved to common code (asm/pgtable.h)

Re: [RFC PATCH] PPC: KVM: vfio kvm device: support spapr tce

2013-10-04 Thread Alex Williamson
On Fri, 2013-10-04 at 22:24 +1000, Alexey Kardashevskiy wrote: This is a very rough change set required for ppc64 to use this KVM device. vfio_rm.c is a piece of code which is going to be called from the realmode (MMU off), and I will put everything spapr-related under #ifdef

Re: [PATCH 2/3] kvm/ppc: IRQ disabling cleanup

2013-10-04 Thread Scott Wood
On Fri, 2013-09-06 at 01:06 +0200, Alexander Graf wrote: On 06.09.2013, at 00:09, Scott Wood wrote: On Thu, 2013-07-11 at 01:09 +0200, Alexander Graf wrote: On 11.07.2013, at 01:08, Scott Wood wrote: On 07/10/2013 06:04:53 PM, Alexander Graf wrote: On 11.07.2013, at 01:01, Benjamin

Re: [PATCH 2/2] KVM: PPC: Book3S HV: Better handling of exceptions that happen in real mode

2013-10-04 Thread Paul Mackerras
On Fri, Oct 04, 2013 at 02:56:31PM +0200, Alexander Graf wrote: On 04.10.2013, at 14:33, Paul Mackerras wrote: On Fri, Oct 04, 2013 at 01:59:25PM +0200, Alexander Graf wrote: On 04.10.2013, at 13:45, Paul Mackerras wrote: When an interrupt or exception happens in the guest that

Re: [PATCH] kvm: powerpc: book3s: Fix build break for BOOK3S_32

2013-10-04 Thread Paul Mackerras
On Fri, Oct 04, 2013 at 03:00:11PM +0200, Alexander Graf wrote: On 04.10.2013, at 14:35, Paul Mackerras wrote: On Fri, Oct 04, 2013 at 02:27:02PM +0200, Alexander Graf wrote: On 04.10.2013, at 14:23, Alexander Graf wrote: On 03.10.2013, at 06:14, Paul Mackerras wrote: On

Re: [PATCH] kvm: powerpc: book3s: Fix build break for BOOK3S_32

2013-10-04 Thread Alexander Graf
On 05.10.2013, at 01:45, Paul Mackerras wrote: On Fri, Oct 04, 2013 at 03:00:11PM +0200, Alexander Graf wrote: On 04.10.2013, at 14:35, Paul Mackerras wrote: On Fri, Oct 04, 2013 at 02:27:02PM +0200, Alexander Graf wrote: On 04.10.2013, at 14:23, Alexander Graf wrote: On

Re: [RFC PATCH] PPC: KVM: vfio kvm device: support spapr tce

2013-10-04 Thread Alexey Kardashevskiy
On 05.10.2013 2:05, Alex Williamson wrote: On Fri, 2013-10-04 at 22:24 +1000, Alexey Kardashevskiy wrote: This is a very rough change set required for ppc64 to use this KVM device. vfio_rm.c is a piece of code which is going to be called from the realmode (MMU off), and I will put

Re: [RFC PATCH] PPC: KVM: vfio kvm device: support spapr tce

2013-10-04 Thread Alexey Kardashevskiy
On 10/05/2013 11:52 AM, Alexey Kardashevskiy wrote: On 05.10.2013 2:05, Alex Williamson wrote: On Fri, 2013-10-04 at 22:24 +1000, Alexey Kardashevskiy wrote: This is a very rough change set required for ppc64 to use this KVM device. vfio_rm.c is a piece of code which is going to be called