@@ -298,6 +298,9 @@ struct kvm_vcpu_arch {
/* Used for two dimensional paging emulation */
struct kvm_mmu nested_mmu;
+ unsigned long fault_address;
+ int fault_error_code;
+
/* only needed in kvm_pv_mmu_op() path, but it's hot so
* put it here to avoid allocation */
struct kvm_pv_mmu_op_buffer mmu_op_buffer;
@@ -266,6 +266,10 @@ err:
walker->error_code |= PFERR_FETCH_MASK;
if (rsvd_fault)
walker->error_code |= PFERR_RSVD_MASK;
+
+ vcpu->arch.fault_address = addr;
+ vcpu->arch.fault_error_code = walker->error_code;
+
trace_kvm_mmu_walker_error(walker->error_code);
return 0;
}