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

2013-06-06 Thread Mihai Caraman
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 in host context. This requires to check the Exception Syndrome Register (ESR[EPID]) and External PID Load Context Register (EPLC[EGS]) for DTB_MISS, DSI and

Re: [RFC PATCH 0/6] KVM: PPC: Book3E: AltiVec support

2013-06-06 Thread Scott Wood
On 06/06/2013 04:42:44 AM, Caraman Mihai Claudiu-B02008 wrote: This looks like a bit much for 3.10 (certainly, subject lines like refactor and enhance and add support aren't going to make Linus happy given that we're past rc4) so I think we should apply

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

2013-06-06 Thread Scott Wood
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? Mihai Caraman (1): kvm/ppc/booke64: Fix AltiVec

[PATCH 3/8] kvm/ppc/booke: Hold srcu lock when calling gfn functions

2013-06-06 Thread Scott Wood
KVM core expects arch code to acquire the srcu lock when calling gfn_to_memslot and similar functions. Signed-off-by: Scott Wood scottw...@freescale.com --- arch/powerpc/kvm/44x_tlb.c |5 + arch/powerpc/kvm/booke.c|7 +++ arch/powerpc/kvm/e500_mmu.c |5 + 3 files

[PATCH 6/8] kvm/ppc: IRQ disabling cleanup

2013-06-06 Thread Scott Wood
Simplify the handling of lazy EE by going directly from fully-enabled to hard-disabled. This replaces the lazy_irq_pending() check (including its misplaced kvm_guest_exit() call). As suggested by Tiejun Chen, move the interrupt disabling into kvmppc_prepare_to_enter() rather than have each

[PATCH 8/8] kvm/ppc/booke: Don't call kvm_guest_enter twice

2013-06-06 Thread Scott Wood
kvm_guest_enter() was already called by kvmppc_prepare_to_enter(). Don't call it again. Signed-off-by: Scott Wood scottw...@freescale.com --- arch/powerpc/kvm/booke.c |2 -- 1 file changed, 2 deletions(-) diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c index

[PATCH 4/8] kvm/ppc/booke64: Fix lazy ee handling in kvmppc_handle_exit()

2013-06-06 Thread Scott Wood
EE is hard-disabled on entry to kvmppc_handle_exit(), so call hard_irq_disable() so that PACA_IRQ_HARD_DIS is set, and soft_enabled is unset. Without this, we get warnings such as arch/powerpc/kernel/time.c:300, and sometimes host kernel hangs. Signed-off-by: Scott Wood scottw...@freescale.com

[PATCH 1/8] kvm/ppc/booke64: Fix AltiVec interrupt numbers and build breakage

2013-06-06 Thread Scott Wood
From: Mihai Caraman mihai.cara...@freescale.com Interrupt numbers defined for Book3E follows IVORs definition. Align BOOKE_INTERRUPT_ALTIVEC_UNAVAIL and BOOKE_INTERRUPT_ALTIVEC_ASSIST to this rule which also fixes the build breakage. IVORs 32 and 33 are shared so reflect this in the interrupts

[PATCH 5/8] kvm/ppc: Call trace_hardirqs_on before entry

2013-06-06 Thread Scott Wood
Currently this is only being done on 64-bit. Rather than just move it out of the 64-bit ifdef, move it to kvm_lazy_ee_enable() so that it is consistent with lazy ee state, and so that we don't track more host code as interrupts-enabled than necessary. Rename kvm_lazy_ee_enable() to

[PATCH 2/8] kvm/ppc/booke64: Disable e6500 support

2013-06-06 Thread Scott Wood
The previous patch made 64-bit booke KVM build again, but Altivec support is still not complete, and we can't prevent the guest from turning on Altivec (which can corrupt host state until state save/restore is implemented). Disable e6500 on KVM until this is fixed. Signed-off-by: Scott Wood

[PATCH 7/8] kvm/ppc/booke: Delay kvmppc_fix_ee_before_entry

2013-06-06 Thread Scott Wood
kwmppc_fix_ee_before_entry() should be called as late as possible, or else we get things like WARN_ON(preemptible()) in enable_kernel_fp() in configurations where preemptible() works. Note that book3s_pr already waits until just before __kvmppc_vcpu_run to call kvmppc_fix_ee_before_entry().