KVM: x86: use kvm_complete_insn_gp in emulating RDMSR/WRMSR
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 14 Dec 2020 12:44:46 +0000 (07:44 -0500)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 15 Dec 2020 10:20:09 +0000 (05:20 -0500)
commit8b474427cbeea05850fb32da65cc95eebcbad089
tree0d9976d4c5681aa1e5909b9614b68d35b7dcc6a2
parent9caec4bf1d0126fa5f2fcd21852958bccd2a4c18
KVM: x86: use kvm_complete_insn_gp in emulating RDMSR/WRMSR

Simplify the four functions that handle {kernel,user} {rd,wr}msr, there
is still some repetition between the two instances of rdmsr but the
whole business of calling kvm_inject_gp and kvm_skip_emulated_instruction
can be unified nicely.

Because complete_emulated_wrmsr now becomes essentially a call to
kvm_complete_insn_gp, remove complete_emulated_msr.

Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/x86.c