diff options
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r-- | arch/x86/kvm/x86.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 9d434777154d..48b74d2fbfb7 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -329,11 +329,12 @@ void kvm_requeue_exception(struct kvm_vcpu *vcpu, unsigned nr) | |||
329 | } | 329 | } |
330 | EXPORT_SYMBOL_GPL(kvm_requeue_exception); | 330 | EXPORT_SYMBOL_GPL(kvm_requeue_exception); |
331 | 331 | ||
332 | void kvm_inject_page_fault(struct kvm_vcpu *vcpu, unsigned long addr, | 332 | void kvm_inject_page_fault(struct kvm_vcpu *vcpu) |
333 | u32 error_code) | ||
334 | { | 333 | { |
334 | unsigned error_code = vcpu->arch.fault.error_code; | ||
335 | |||
335 | ++vcpu->stat.pf_guest; | 336 | ++vcpu->stat.pf_guest; |
336 | vcpu->arch.cr2 = addr; | 337 | vcpu->arch.cr2 = vcpu->arch.fault.address; |
337 | kvm_queue_exception_e(vcpu, PF_VECTOR, error_code); | 338 | kvm_queue_exception_e(vcpu, PF_VECTOR, error_code); |
338 | } | 339 | } |
339 | 340 | ||
@@ -4080,7 +4081,7 @@ static void inject_emulated_exception(struct kvm_vcpu *vcpu) | |||
4080 | { | 4081 | { |
4081 | struct x86_emulate_ctxt *ctxt = &vcpu->arch.emulate_ctxt; | 4082 | struct x86_emulate_ctxt *ctxt = &vcpu->arch.emulate_ctxt; |
4082 | if (ctxt->exception == PF_VECTOR) | 4083 | if (ctxt->exception == PF_VECTOR) |
4083 | kvm_inject_page_fault(vcpu, ctxt->cr2, ctxt->error_code); | 4084 | kvm_inject_page_fault(vcpu); |
4084 | else if (ctxt->error_code_valid) | 4085 | else if (ctxt->error_code_valid) |
4085 | kvm_queue_exception_e(vcpu, ctxt->exception, ctxt->error_code); | 4086 | kvm_queue_exception_e(vcpu, ctxt->exception, ctxt->error_code); |
4086 | else | 4087 | else |