]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: MIPS/VZ: Support guest load-linked bit
authorJames Hogan <james.hogan@imgtec.com>
Tue, 14 Mar 2017 10:15:37 +0000 (10:15 +0000)
committerJames Hogan <james.hogan@imgtec.com>
Tue, 28 Mar 2017 13:53:58 +0000 (14:53 +0100)
commitf9c6e380c49acf9e62c919be56d13833b9bf2c8b
tree3a9fbbb55312b5adeafc7eb3e200cadc79ff9093
parent173a79c0b2aba1e640b4db1e471a4634e64708ee
KVM: MIPS/VZ: Support guest load-linked bit

When restoring guest state after another VCPU has run, be sure to clear
CP0_LLAddr.LLB in order to break any interrupted atomic critical
section. Without this SMP guest atomics don't work when LLB is present
as one guest can complete the atomic section started by another guest.

MIPS VZ guest read of CP0_LLAddr causes Guest Privileged Sensitive
Instruction (GPSI) exception due to the address being root physical.
Handle this by reporting only the LLB bit, which contains the bit for
whether a ll/sc atomic is in progress without any reason for failure.

Similarly on P5600 a guest write to CP0_LLAddr also causes a GPSI
exception. Handle this also by clearing the guest LLB bit from root
mode.

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
arch/mips/kvm/vz.c