Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: KVM: Fix fpu.S misassembly with r6

__kvm_save_fpu and __kvm_restore_fpu use .set mips64r2 so that they can
access the odd FPU registers as well as the even, however this causes
misassembly of the return instruction on MIPSr6.

Fix by replacing .set mips64r2 with .set fp=64, which doesn't change the
architecture revision.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Radim KrÄmář <rkrcmar@redhat.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Cc: kvm@vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

authored by

James Hogan and committed by
Paolo Bonzini
d14740fe 1b492600

+5 -2
+5 -2
arch/mips/kvm/fpu.S
··· 14 14 #include <asm/mipsregs.h> 15 15 #include <asm/regdef.h> 16 16 17 + /* preprocessor replaces the fp in ".set fp=64" with $30 otherwise */ 18 + #undef fp 19 + 17 20 .set noreorder 18 21 .set noat 19 22 20 23 LEAF(__kvm_save_fpu) 21 24 .set push 22 - .set mips64r2 23 25 SET_HARDFLOAT 26 + .set fp=64 24 27 mfc0 t0, CP0_STATUS 25 28 sll t0, t0, 5 # is Status.FR set? 26 29 bgez t0, 1f # no: skip odd doubles ··· 66 63 67 64 LEAF(__kvm_restore_fpu) 68 65 .set push 69 - .set mips64r2 70 66 SET_HARDFLOAT 67 + .set fp=64 71 68 mfc0 t0, CP0_STATUS 72 69 sll t0, t0, 5 # is Status.FR set? 73 70 bgez t0, 1f # no: skip odd doubles