[PATCH] KVM: PPC: Book3s PR: Disable AIL mode with OPAL
When we're using PR KVM we must not allow the CPU to take interrupts in virtual mode, as the SLB does not contain host kernel mappings when running inside the guest context. To make sure we get good performance for non-KVM tasks but still properly functioning PR KVM, let's just disable AIL whenever a vcpu is scheduled in. This patch fixes running PR KVM on POWER8 bare metal for me. Signed-off-by: Alexander Graf --- arch/powerpc/kvm/book3s_pr.c | 12 1 file changed, 12 insertions(+) diff --git a/arch/powerpc/kvm/book3s_pr.c b/arch/powerpc/kvm/book3s_pr.c index 03fc884..cdc0eef 100644 --- a/arch/powerpc/kvm/book3s_pr.c +++ b/arch/powerpc/kvm/book3s_pr.c @@ -71,6 +71,12 @@ static void kvmppc_core_vcpu_load_pr(struct kvm_vcpu *vcpu, int cpu) svcpu->in_use = 0; svcpu_put(svcpu); #endif + + /* Disable AIL if supported */ + if (cpu_has_feature(CPU_FTR_HVMODE) && + cpu_has_feature(CPU_FTR_ARCH_207S)) + mtspr(SPRN_LPCR, mfspr(SPRN_LPCR) & ~LPCR_AIL); + vcpu->cpu = smp_processor_id(); #ifdef CONFIG_PPC_BOOK3S_32 current->thread.kvm_shadow_vcpu = vcpu->arch.shadow_vcpu; @@ -91,6 +97,12 @@ static void kvmppc_core_vcpu_put_pr(struct kvm_vcpu *vcpu) kvmppc_giveup_ext(vcpu, MSR_FP | MSR_VEC | MSR_VSX); kvmppc_giveup_fac(vcpu, FSCR_TAR_LG); + + /* Enable AIL if supported */ + if (cpu_has_feature(CPU_FTR_HVMODE) && + cpu_has_feature(CPU_FTR_ARCH_207S)) + mtspr(SPRN_LPCR, mfspr(SPRN_LPCR) | LPCR_AIL_3); + vcpu->cpu = -1; } -- 1.8.1.4 -- To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Does KVM support the P.A. Semi PA6T cpu?
On 06/10/2014 12:39 PM, Christian Zigotzky wrote: Am 30.05.14 19:38, schrieb Christian Zigotzky: Dmesg logs: watch -n 0 "dmesg" > dmesg_mol_mac_os_x_tiger.txt watch -n 0 "dmesg" > dmesg_mol_mac_os_x_jaguar.txt http://forum.hyperion-entertainment.biz/download/file.php?id=1215 http://forum.hyperion-entertainment.biz/download/file.php?id=1216 more dmesg_mol_mac_os_x_tiger.txt I hope you can fix the problem. -- Christian Hi Alex, I've read that we should disable SMP support for KVM (http://techuman.wordpress.com/2013/09/12/powerpc-g4-virtualization-with-kvm/). Is that right? Only on 32bit hosts. Shall I unset the SMP support in the kernel config? Have you looked in the dmesg files above? I have no idea what's going wrong on your system tbh :). Alex -- To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Does KVM support the P.A. Semi PA6T cpu?
Am 30.05.14 19:38, schrieb Christian Zigotzky: Dmesg logs: watch -n 0 "dmesg" > dmesg_mol_mac_os_x_tiger.txt watch -n 0 "dmesg" > dmesg_mol_mac_os_x_jaguar.txt http://forum.hyperion-entertainment.biz/download/file.php?id=1215 http://forum.hyperion-entertainment.biz/download/file.php?id=1216 more dmesg_mol_mac_os_x_tiger.txt I hope you can fix the problem. -- Christian Hi Alex, I've read that we should disable SMP support for KVM (http://techuman.wordpress.com/2013/09/12/powerpc-g4-virtualization-with-kvm/). Is that right? Shall I unset the SMP support in the kernel config? Have you looked in the dmesg files above? Cheers, Christian -- To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html