summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/x86.c
diff options
context:
space:
mode:
authorSean Christopherson <sean.j.christopherson@intel.com>2019-08-27 23:40:27 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2019-09-24 13:37:35 +0200
commitbc8a0aafcbb82e5c7dde486c03e6c51e3896d797 (patch)
tree1428a0786d0c957e2cbc823d9eb5a59ec39fac22 /arch/x86/kvm/x86.c
parentKVM: nVMX: Check Host Address Space Size on vmentry of nested guests (diff)
downloadlinux-bc8a0aafcbb82e5c7dde486c03e6c51e3896d797.tar.xz
linux-bc8a0aafcbb82e5c7dde486c03e6c51e3896d797.zip
KVM: x86: Relocate MMIO exit stats counting
Move the stat.mmio_exits update into x86_emulate_instruction(). This is both a bug fix, e.g. the current update flows will incorrectly increment mmio_exits on emulation failure, and a preparatory change to set the stage for eliminating EMULATE_DONE and company. Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com> Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to '')
-rw-r--r--arch/x86/kvm/x86.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 7e51924c4a1c..2b92c2ca1d79 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -6703,6 +6703,8 @@ restart:
}
r = EMULATE_USER_EXIT;
} else if (vcpu->mmio_needed) {
+ ++vcpu->stat.mmio_exits;
+
if (!vcpu->mmio_is_write)
writeback = false;
r = EMULATE_USER_EXIT;