Re: [PATCH 1/6] KVM: PPC: Book3S PR: Ignore PMU SPRs

2014-04-30 Thread Paul Mackerras
On Tue, Apr 29, 2014 at 06:17:37PM +0200, Alexander Graf wrote: > When we expose a POWER8 CPU into the guest, it will start accessing PMU SPRs > that we don't emulate. Just ignore accesses to them. > > Signed-off-by: Alexander Graf This patch is OK as it stands, but in fact the architecture says

[PATCH v2 0/4] KVM: PPC: Read guest instruction from kvmppc_get_last_inst()

2014-04-30 Thread Mihai Caraman
Read guest last instruction from kvmppc_get_last_inst() allowing the function to fail in order to emulate again. On bookehv architecture search for the physical address and kmap it, instead of using Load External PID (lwepx) instruction. This fixes an infinite loop caused by lwepx's data TLB miss e

[PATCH v2 0/4] KVM: PPC: Read guest instruction from kvmppc_get_last_inst()

2014-04-30 Thread Mihai Caraman
Read guest last instruction from kvmppc_get_last_inst() allowing the function to fail in order to emulate again. On bookehv architecture search for the physical address and kmap it, instead of using Load External PID (lwepx) instruction. This fixes an infinite loop caused by lwepx's data TLB miss e

[PATCH v2 1/4] KVM: PPC: e500mc: Revert "add load inst fixup"

2014-04-30 Thread Mihai Caraman
The commit 1d628af7 "add load inst fixup" made an attempt to handle failures generated by reading the guest current instruction. The fixup code that was added works by chance hiding the real issue. Load external pid (lwepx) instruction, used by KVM to read guest instructions, is executed in a subs

[PATCH v2 3/4] KVM: PPC: Alow kvmppc_get_last_inst() to fail

2014-04-30 Thread Mihai Caraman
On book3e, guest last instruction was read on the exist path using load external pid (lwepx) dedicated instruction. lwepx failures have to be handled by KVM and this would require additional checks in DO_KVM hooks (beside MSR[GS] = 1). However extra checks on host fast path are commonly considered

[PATCH v2 4/4] KVM: PPC: Bookehv: Get vcpu's last instruction for emulation

2014-04-30 Thread Mihai Caraman
On bookehv vcpu's last instruction is read using load external pid (lwepx) instruction. lwepx exceptions (DTLB_MISS, DSI and LRAT) need to be handled by KVM. These exceptions originate from host state (MSR[GS] = 0) which implies additional checks in DO_KVM macro (beside the current MSR[GS] = 1) by

[PATCH v2 2/4] KVM: PPC: Book3e: Add TLBSEL/TSIZE defines for MAS0/1

2014-04-30 Thread Mihai Caraman
Add defines MAS0_GET_TLBSEL() and MAS1_GET_TSIZE() to Book3E. Signed-off-by: Mihai Caraman --- v2: - no change arch/powerpc/include/asm/mmu-book3e.h | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/include/asm/mmu-book3e.h b/arch/powerpc/include/asm/mmu-b

[PATCH] KVM: PPC: E500: Add dcbtls emulation

2014-04-30 Thread Alexander Graf
The dcbtls instruction is able to lock data inside the L1 cache. We don't want to give the guest actual access to hardware cache locks, as that could influence other VMs on the same system. But we can tell the guest that its locking attempt failed. By implementing the instruction we at least don'

[PATCH] KVM: PPC: E500: Ignore L1CSR1_ICFI,ICLFR

2014-04-30 Thread Alexander Graf
The L1 instruction cache control register contains bits that indicate that we're still handling a request. Mask those out when we set the SPR so that a read doesn't assume we're still doing something. Signed-off-by: Alexander Graf --- arch/powerpc/kvm/e500_emulate.c | 1 + 1 file changed, 1 inse

Re: [PATCH 2/6] KVM: PPC: Book3S PR: Emulate TIR register

2014-04-30 Thread Alexander Graf
On 30.04.14 07:51, Michael Neuling wrote: In parallel to the Processor ID Register (PIR) threaded POWER8 also adds a Thread ID Register (TID). Since PR KVM doesn't emulate more than one thread s/TID/TIR/ above Oops :) per core, we can just always expose 0 here. I'm not sure if we ever do

Re: [PATCH 0/6] Implement split core for POWER8

2014-04-30 Thread Alexander Graf
On 30.04.14 07:09, Michael Neuling wrote: This patch series implements split core mode on POWER8. This enables up to 4 subcores per core which can each independently run guests (per guest SPRs like SDR1, LPIDR etc are replicated per subcore). Lots more documentation on this feature in the code