From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55287) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X5Gpn-0000W6-Uv for qemu-devel@nongnu.org; Thu, 10 Jul 2014 12:04:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X5Gpi-0004FE-LH for qemu-devel@nongnu.org; Thu, 10 Jul 2014 12:04:35 -0400 Received: from mail-we0-x229.google.com ([2a00:1450:400c:c03::229]:52976) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X5Gpi-0004Eo-E4 for qemu-devel@nongnu.org; Thu, 10 Jul 2014 12:04:30 -0400 Received: by mail-we0-f169.google.com with SMTP id t60so9296510wes.14 for ; Thu, 10 Jul 2014 09:04:29 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Thu, 10 Jul 2014 18:04:05 +0200 Message-Id: <1405008253-9816-3-git-send-email-pbonzini@redhat.com> In-Reply-To: <1405008253-9816-1-git-send-email-pbonzini@redhat.com> References: <1405008253-9816-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PULL 02/10] mips/kvm: Disable FPU on reset with KVM List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: James Hogan , Aurelien Jarno From: James Hogan KVM doesn't yet support the MIPS FPU, or writing to the guest's Config1 register which contains the FPU implemented bit. Clear QEMU's version of that bit on reset and display a warning that the FPU has been disabled. The previous incorrect Config1 CP0 register value wasn't being passed to KVM yet, however we should ensure it is set correctly now to reduce the risk of breaking migration/loadvm to a future version of QEMU/Linux that does support it. Signed-off-by: James Hogan Cc: Aurelien Jarno Cc: Paolo Bonzini Signed-off-by: Paolo Bonzini --- target-mips/kvm.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/target-mips/kvm.c b/target-mips/kvm.c index 844e5bb..97fd51a 100644 --- a/target-mips/kvm.c +++ b/target-mips/kvm.c @@ -61,6 +61,13 @@ int kvm_arch_init_vcpu(CPUState *cs) void kvm_mips_reset_vcpu(MIPSCPU *cpu) { + CPUMIPSState *env = &cpu->env; + + if (env->CP0_Config1 & (1 << CP0C1_FP)) { + fprintf(stderr, "Warning: FPU not supported with KVM, disabling\n"); + env->CP0_Config1 &= ~(1 << CP0C1_FP); + } + DPRINTF("%s\n", __func__); } -- 1.8.3.1