• James Hogan's avatar
    MIPS: KVM: Factor writing of translated guest instructions · d5cd26bc
    James Hogan authored
    The code in kvm_mips_dyntrans.c to write a translated guest instruction
    to guest memory depending on the segment is duplicated between each of
    the functions. Additionally the cache op translation functions assume
    the instruction is in the KSEG0/1 segment rather than KSEG2/3, which is
    generally true but isn't guaranteed.
    
    Factor that code into a new kvm_mips_trans_replace() which handles both
    KSEG0/1 and KSEG2/3.
    Signed-off-by: default avatarJames 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: default avatarPaolo Bonzini <pbonzini@redhat.com>
    d5cd26bc
dyntrans.c 3.18 KB