mirror of
				git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
				synced 2025-10-31 16:54:21 +00:00 
			
		
		
		
	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>
This commit is contained in:
		
							parent
							
								
									1b49260006
								
							
						
					
					
						commit
						d14740fed8
					
				
					 1 changed files with 5 additions and 2 deletions
				
			
		|  | @ -14,13 +14,16 @@ | |||
| #include <asm/mipsregs.h> | ||||
| #include <asm/regdef.h> | ||||
| 
 | ||||
| /* preprocessor replaces the fp in ".set fp=64" with $30 otherwise */ | ||||
| #undef fp | ||||
| 
 | ||||
| 	.set	noreorder
 | ||||
| 	.set	noat
 | ||||
| 
 | ||||
| LEAF(__kvm_save_fpu) | ||||
| 	.set	push
 | ||||
| 	.set	mips64r2
 | ||||
| 	SET_HARDFLOAT | ||||
| 	.set	fp=64 | ||||
| 	mfc0	t0, CP0_STATUS | ||||
| 	sll     t0, t0, 5			# is Status.FR set? | ||||
| 	bgez    t0, 1f				# no: skip odd doubles | ||||
|  | @ -63,8 +66,8 @@ LEAF(__kvm_save_fpu) | |||
| 
 | ||||
| LEAF(__kvm_restore_fpu) | ||||
| 	.set	push
 | ||||
| 	.set	mips64r2
 | ||||
| 	SET_HARDFLOAT | ||||
| 	.set	fp=64 | ||||
| 	mfc0	t0, CP0_STATUS | ||||
| 	sll     t0, t0, 5			# is Status.FR set? | ||||
| 	bgez    t0, 1f				# no: skip odd doubles | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 James Hogan
						James Hogan