aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/kvm/mmu.c5
-rw-r--r--include/linux/kvm.h7
2 files changed, 10 insertions, 2 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index 5f97dbd24291..b6e4cda77047 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -2673,8 +2673,9 @@ int kvm_mmu_page_fault(struct kvm_vcpu *vcpu, gva_t cr2, u32 error_code)
2673 ++vcpu->stat.mmio_exits; 2673 ++vcpu->stat.mmio_exits;
2674 return 0; 2674 return 0;
2675 case EMULATE_FAIL: 2675 case EMULATE_FAIL:
2676 kvm_report_emulation_failure(vcpu, "pagetable"); 2676 vcpu->run->exit_reason = KVM_EXIT_INTERNAL_ERROR;
2677 return 1; 2677 vcpu->run->internal.suberror = KVM_INTERNAL_ERROR_EMULATION;
2678 return 0;
2678 default: 2679 default:
2679 BUG(); 2680 BUG();
2680 } 2681 }
diff --git a/include/linux/kvm.h b/include/linux/kvm.h
index 5037e170a70d..671051829da6 100644
--- a/include/linux/kvm.h
+++ b/include/linux/kvm.h
@@ -95,6 +95,10 @@ struct kvm_pit_config {
95#define KVM_EXIT_S390_RESET 14 95#define KVM_EXIT_S390_RESET 14
96#define KVM_EXIT_DCR 15 96#define KVM_EXIT_DCR 15
97#define KVM_EXIT_NMI 16 97#define KVM_EXIT_NMI 16
98#define KVM_EXIT_INTERNAL_ERROR 17
99
100/* For KVM_EXIT_INTERNAL_ERROR */
101#define KVM_INTERNAL_ERROR_EMULATION 1
98 102
99/* for KVM_RUN, returned by mmap(vcpu_fd, offset=0) */ 103/* for KVM_RUN, returned by mmap(vcpu_fd, offset=0) */
100struct kvm_run { 104struct kvm_run {
@@ -181,6 +185,9 @@ struct kvm_run {
181 __u32 data; 185 __u32 data;
182 __u8 is_write; 186 __u8 is_write;
183 } dcr; 187 } dcr;
188 struct {
189 __u32 suberror;
190 } internal;
184 /* Fix the size of the union. */ 191 /* Fix the size of the union. */
185 char padding[256]; 192 char padding[256];
186 }; 193 };