MIPS: KVM: Use mipsregs.h defs for config registers
Convert MIPS KVM guest register state initialisation to use the standard <asm/mipsregs.h> register field definitions for Config registers, and drop the custom definitions in kvm_host.h which it was using before. 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:

committed by
Paolo Bonzini

parent
e342925f17
commit
4e10b764e2
@@ -440,8 +440,7 @@ static int kvm_trap_emul_vcpu_setup(struct kvm_vcpu *vcpu)
|
||||
* host.
|
||||
*/
|
||||
config = read_c0_config() & MIPS_CONF_AR;
|
||||
config |= MIPS_CONF_M | (0x3 << CP0C0_K0) |
|
||||
(MMU_TYPE_R4000 << CP0C0_MT);
|
||||
config |= MIPS_CONF_M | CONF_CM_CACHABLE_NONCOHERENT | MIPS_CONF_MT_TLB;
|
||||
#ifdef CONFIG_CPU_BIG_ENDIAN
|
||||
config |= CONF_BE;
|
||||
#endif
|
||||
@@ -457,9 +456,8 @@ static int kvm_trap_emul_vcpu_setup(struct kvm_vcpu *vcpu)
|
||||
config1 |= ((KVM_MIPS_GUEST_TLB_SIZE - 1) << 25);
|
||||
|
||||
/* We unset some bits that we aren't emulating */
|
||||
config1 &=
|
||||
~((1 << CP0C1_C2) | (1 << CP0C1_MD) | (1 << CP0C1_PC) |
|
||||
(1 << CP0C1_WR) | (1 << CP0C1_CA));
|
||||
config1 &= ~(MIPS_CONF1_C2 | MIPS_CONF1_MD | MIPS_CONF1_PC |
|
||||
MIPS_CONF1_WR | MIPS_CONF1_CA);
|
||||
kvm_write_c0_guest_config1(cop0, config1);
|
||||
|
||||
/* Have config3, no tertiary/secondary caches implemented */
|
||||
|
Reference in New Issue
Block a user