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

MIPS: KVM: Fix pre-r6 ll/sc instructions on r6

The atomic KVM register access macros in kvm_host.h (for the guest Cause
register with KVM in trap & emulate mode) use ll/sc instructions,
however they still .set mips3, which causes pre-MIPSr6 instruction
encodings to be emitted, even for a MIPSr6 build.

Fix it to use MIPS_ISA_ARCH_LEVEL as other parts of arch/mips already
do.

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
d85ebff0 d14740fe

+3 -3
+3 -3
arch/mips/include/asm/kvm_host.h
··· 400 400 unsigned long temp; 401 401 do { 402 402 __asm__ __volatile__( 403 - " .set mips3 \n" 403 + " .set "MIPS_ISA_ARCH_LEVEL" \n" 404 404 " " __LL "%0, %1 \n" 405 405 " or %0, %2 \n" 406 406 " " __SC "%0, %1 \n" ··· 416 416 unsigned long temp; 417 417 do { 418 418 __asm__ __volatile__( 419 - " .set mips3 \n" 419 + " .set "MIPS_ISA_ARCH_LEVEL" \n" 420 420 " " __LL "%0, %1 \n" 421 421 " and %0, %2 \n" 422 422 " " __SC "%0, %1 \n" ··· 433 433 unsigned long temp; 434 434 do { 435 435 __asm__ __volatile__( 436 - " .set mips3 \n" 436 + " .set "MIPS_ISA_ARCH_LEVEL" \n" 437 437 " " __LL "%0, %1 \n" 438 438 " and %0, %2 \n" 439 439 " or %0, %3 \n"