KVM: x86: Add EMULTYPE_PF when emulation is triggered by a page fault
authorSean Christopherson <sean.j.christopherson@intel.com>
Tue, 18 Feb 2020 23:03:08 +0000 (15:03 -0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 16 Mar 2020 16:57:12 +0000 (17:57 +0100)
commit92daa48b34d784748b575ae424def4ea7f024b2f
treea8bc39b2165d069348873967f573012e312a4891
parent999eabcc89b0e99a699d2946086a97537c3eff14
KVM: x86: Add EMULTYPE_PF when emulation is triggered by a page fault

Add a new emulation type flag to explicitly mark emulation related to a
page fault.  Move the propation of the GPA into the emulator from the
page fault handler into x86_emulate_instruction, using EMULTYPE_PF as an
indicator that cr2 is valid.  Similarly, don't propagate cr2 into the
exception.address when it's *not* valid.

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/mmu/mmu.c
arch/x86/kvm/x86.c