diff options
Diffstat (limited to 'arch/x86/kvm/paging_tmpl.h')
-rw-r--r-- | arch/x86/kvm/paging_tmpl.h | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h index 2b3d66c7b68d..3ac39de444ec 100644 --- a/arch/x86/kvm/paging_tmpl.h +++ b/arch/x86/kvm/paging_tmpl.h | |||
@@ -677,7 +677,7 @@ static void FNAME(invlpg)(struct kvm_vcpu *vcpu, gva_t gva) | |||
677 | } | 677 | } |
678 | 678 | ||
679 | static gpa_t FNAME(gva_to_gpa)(struct kvm_vcpu *vcpu, gva_t vaddr, u32 access, | 679 | static gpa_t FNAME(gva_to_gpa)(struct kvm_vcpu *vcpu, gva_t vaddr, u32 access, |
680 | u32 *error) | 680 | struct x86_exception *exception) |
681 | { | 681 | { |
682 | struct guest_walker walker; | 682 | struct guest_walker walker; |
683 | gpa_t gpa = UNMAPPED_GVA; | 683 | gpa_t gpa = UNMAPPED_GVA; |
@@ -688,14 +688,18 @@ static gpa_t FNAME(gva_to_gpa)(struct kvm_vcpu *vcpu, gva_t vaddr, u32 access, | |||
688 | if (r) { | 688 | if (r) { |
689 | gpa = gfn_to_gpa(walker.gfn); | 689 | gpa = gfn_to_gpa(walker.gfn); |
690 | gpa |= vaddr & ~PAGE_MASK; | 690 | gpa |= vaddr & ~PAGE_MASK; |
691 | } else if (error) | 691 | } else if (exception) { |
692 | *error = walker.error_code; | 692 | exception->vector = PF_VECTOR; |
693 | exception->error_code_valid = true; | ||
694 | exception->error_code = walker.error_code; | ||
695 | } | ||
693 | 696 | ||
694 | return gpa; | 697 | return gpa; |
695 | } | 698 | } |
696 | 699 | ||
697 | static gpa_t FNAME(gva_to_gpa_nested)(struct kvm_vcpu *vcpu, gva_t vaddr, | 700 | static gpa_t FNAME(gva_to_gpa_nested)(struct kvm_vcpu *vcpu, gva_t vaddr, |
698 | u32 access, u32 *error) | 701 | u32 access, |
702 | struct x86_exception *exception) | ||
699 | { | 703 | { |
700 | struct guest_walker walker; | 704 | struct guest_walker walker; |
701 | gpa_t gpa = UNMAPPED_GVA; | 705 | gpa_t gpa = UNMAPPED_GVA; |
@@ -706,8 +710,11 @@ static gpa_t FNAME(gva_to_gpa_nested)(struct kvm_vcpu *vcpu, gva_t vaddr, | |||
706 | if (r) { | 710 | if (r) { |
707 | gpa = gfn_to_gpa(walker.gfn); | 711 | gpa = gfn_to_gpa(walker.gfn); |
708 | gpa |= vaddr & ~PAGE_MASK; | 712 | gpa |= vaddr & ~PAGE_MASK; |
709 | } else if (error) | 713 | } else if (exception) { |
710 | *error = walker.error_code; | 714 | exception->vector = PF_VECTOR; |
715 | exception->error_code_valid = true; | ||
716 | exception->error_code = walker.error_code; | ||
717 | } | ||
711 | 718 | ||
712 | return gpa; | 719 | return gpa; |
713 | } | 720 | } |