[PATCH 3/4] kvm: powerpc: define a linux pte lookup function

2013-10-08 Thread Bharat Bhushan
We need to search linux pte to get pte attributes for setting TLB in KVM. This patch defines a linux_pte_lookup() function for same. Signed-off-by: Bharat Bhushan bharat.bhus...@freescale.com --- arch/powerpc/include/asm/pgtable.h | 35 +++ 1 files changed, 35

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

2013-10-08 Thread Bharat Bhushan
From: Bharat Bhushan bharat.bhus...@freescale.com kvm: powerpc: use cache attributes from linux pte - 1st Patch fixes a bug in booke (detail in patch) - 2nd patch is renaming the linux_pte_lookup_function() just for clarity. There is not functional change. - 3nd Patch adds a Linux pte

[PATCH 2/4] kvm: book3s: rename lookup_linux_pte() to lookup_linux_pte_and_update()

2013-10-08 Thread Bharat Bhushan
lookup_linux_pte() is doing more than lookup, updating the pte, so for clarity it is renamed to lookup_linux_pte_and_update() Signed-off-by: Bharat Bhushan bharat.bhus...@freescale.com --- arch/powerpc/kvm/book3s_hv_rm_mmu.c |8 +--- 1 files changed, 5 insertions(+), 3 deletions(-) diff

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

2013-10-08 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 --- arch/powerpc/include/asm/kvm_host.h |2 +-

[PATCH 1/4] kvm: booke: clear host tlb reference flag on guest tlb invalidation

2013-10-08 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 v2 1/3] KVM: PPC: Book3S: add helper routine to load guest instructions

2013-10-08 Thread Cédric Le Goater
This patch adds an helper routine kvmppc_ld_inst() to load an instruction form the guest. This routine will be modified in the next patch to take into account the endian order of the guest. Signed-off-by: Cédric Le Goater c...@fr.ibm.com --- arch/powerpc/include/asm/kvm_book3s.h | 16

[PATCH v2 0/3] KVM: PPC: Book3S: MMIO support for Little Endian guests

2013-10-08 Thread Cédric Le Goater
MIO 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. The first patches add simple helper routines to load instructions from the guest. It prepares ground

[PATCH v2 3/3] KVM: PPC: Book3S: MMIO emulation support for little endian guests

2013-10-08 Thread Cédric Le Goater
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 order of the host, primarily doing a byte-swap if

[PATCH v2 2/3] KVM: PPC: Book3S: add helper routines to detect endian

2013-10-08 Thread Cédric Le Goater
They will be used to decide whether to byte-swap or not. When Little Endian host kernels come, these routines will need to be changed accordingly. Signed-off-by: Cédric Le Goater c...@fr.ibm.com --- arch/powerpc/include/asm/kvm_book3s.h | 10 ++ 1 file changed, 10 insertions(+) diff

Re: [PATCH v2 3/3] KVM: PPC: Book3S: MMIO emulation support for little endian guests

2013-10-08 Thread Alexander Graf
On 08.10.2013, at 16:12, Cédric Le Goater c...@fr.ibm.com 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

Re: [PATCH v2 3/3] KVM: PPC: Book3S: MMIO emulation support for little endian guests

2013-10-08 Thread Cedric Le Goater
On 10/08/2013 04:25 PM, Alexander Graf wrote: On 08.10.2013, at 16:12, Cédric Le Goater c...@fr.ibm.com 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

[PATCH v3 3/3] KVM: PPC: Book3S: MMIO emulation support for little endian guests

2013-10-08 Thread Cédric Le Goater
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 order of the host, primarily doing a byte-swap if

Re: [PATCH v3 3/3] KVM: PPC: Book3S: MMIO emulation support for little endian guests

2013-10-08 Thread Alexander Graf
On 08.10.2013, at 17:31, Cédric Le Goater c...@fr.ibm.com 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

Re: [PATCH v3 3/3] KVM: PPC: Book3S: MMIO emulation support for little endian guests

2013-10-08 Thread Cedric Le Goater
On 10/08/2013 05:36 PM, Alexander Graf wrote: On 08.10.2013, at 17:31, Cédric Le Goater c...@fr.ibm.com 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

[PATCH v4 0/3] KVM: PPC: Book3S: MMIO support for Little Endian guests

2013-10-08 Thread Cédric Le Goater
MIO 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. The first patches add simple helper routines to load instructions from the guest. It prepares ground

[PATCH v4 3/3] KVM: PPC: Book3S: MMIO emulation support for little endian guests

2013-10-08 Thread Cédric Le Goater
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 order of the host, primarily doing a byte-swap if

[PATCH v4 1/3] KVM: PPC: Book3S: add helper routine to load guest instructions

2013-10-08 Thread Cédric Le Goater
This patch adds an helper routine kvmppc_ld32() to load an instruction form the guest. This routine will be modified in the next patch to take into account the endian order of the guest. Signed-off-by: Cédric Le Goater c...@fr.ibm.com --- Changes in v4: - got rid of useless helper routine

[PATCH v4 2/3] KVM: PPC: Book3S: add helper routines to detect endian order

2013-10-08 Thread Cédric Le Goater
They will be used to decide whether to byte-swap or not. When Little Endian host kernels come, these routines will need to be changed accordingly. Signed-off-by: Cédric Le Goater c...@fr.ibm.com --- arch/powerpc/include/asm/kvm_book3s.h | 10 ++ 1 file changed, 10 insertions(+) diff

Re: [PATCH 3/4] kvm: powerpc: define a linux pte lookup function

2013-10-08 Thread Scott Wood
On Tue, 2013-10-08 at 11:33 +0530, Bharat Bhushan wrote: We need to search linux pte to get pte attributes for setting TLB in KVM. This patch defines a linux_pte_lookup() function for same. Signed-off-by: Bharat Bhushan bharat.bhus...@freescale.com --- arch/powerpc/include/asm/pgtable.h |

Re: [PATCH v2 3/3] KVM: PPC: Book3S: MMIO emulation support for little endian guests

2013-10-08 Thread Paul Mackerras
On Tue, Oct 08, 2013 at 04:25:31PM +0200, Alexander Graf wrote: On 08.10.2013, at 16:12, Cédric Le Goater c...@fr.ibm.com 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

Re: [PATCH v2 3/3] KVM: PPC: Book3S: MMIO emulation support for little endian guests

2013-10-08 Thread Alexander Graf
Am 09.10.2013 um 01:31 schrieb Paul Mackerras pau...@samba.org: On Tue, Oct 08, 2013 at 04:25:31PM +0200, Alexander Graf wrote: On 08.10.2013, at 16:12, Cédric Le Goater c...@fr.ibm.com wrote: MMIO emulation reads the last instruction executed by the guest and then emulates. If the