aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/kvm/svm.c
diff options
context:
space:
mode:
authorAvi Kivity <avi@qumranet.com>2007-03-04 07:17:08 -0500
committerAvi Kivity <avi@qumranet.com>2007-05-03 03:52:24 -0400
commit8eb7d334bd8e693340ee198280f7d45035cdab8c (patch)
tree438ec0b6b6c7714e436884576a3fdce84507813f /drivers/kvm/svm.c
parentb4e63f560beb187cffdaf706e534a1e2f9effb66 (diff)
KVM: Fold kvm_run::exit_type into kvm_run::exit_reason
Currently, userspace is told about the nature of the last exit from the guest using two fields, exit_type and exit_reason, where exit_type has just two enumerations (and no need for more). So fold exit_type into exit_reason, reducing the complexity of determining what really happened. Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/svm.c')
-rw-r--r--drivers/kvm/svm.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/kvm/svm.c b/drivers/kvm/svm.c
index d4b2936479d9..b09928f14219 100644
--- a/drivers/kvm/svm.c
+++ b/drivers/kvm/svm.c
@@ -1298,8 +1298,6 @@ static int handle_exit(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
1298{ 1298{
1299 u32 exit_code = vcpu->svm->vmcb->control.exit_code; 1299 u32 exit_code = vcpu->svm->vmcb->control.exit_code;
1300 1300
1301 kvm_run->exit_type = KVM_EXIT_TYPE_VM_EXIT;
1302
1303 if (is_external_interrupt(vcpu->svm->vmcb->control.exit_int_info) && 1301 if (is_external_interrupt(vcpu->svm->vmcb->control.exit_int_info) &&
1304 exit_code != SVM_EXIT_EXCP_BASE + PF_VECTOR) 1302 exit_code != SVM_EXIT_EXCP_BASE + PF_VECTOR)
1305 printk(KERN_ERR "%s: unexpected exit_ini_info 0x%x " 1303 printk(KERN_ERR "%s: unexpected exit_ini_info 0x%x "
@@ -1609,8 +1607,9 @@ again:
1609 vcpu->svm->next_rip = 0; 1607 vcpu->svm->next_rip = 0;
1610 1608
1611 if (vcpu->svm->vmcb->control.exit_code == SVM_EXIT_ERR) { 1609 if (vcpu->svm->vmcb->control.exit_code == SVM_EXIT_ERR) {
1612 kvm_run->exit_type = KVM_EXIT_TYPE_FAIL_ENTRY; 1610 kvm_run->exit_reason = KVM_EXIT_FAIL_ENTRY;
1613 kvm_run->exit_reason = vcpu->svm->vmcb->control.exit_code; 1611 kvm_run->fail_entry.hardware_entry_failure_reason
1612 = vcpu->svm->vmcb->control.exit_code;
1614 post_kvm_run_save(vcpu, kvm_run); 1613 post_kvm_run_save(vcpu, kvm_run);
1615 return 0; 1614 return 0;
1616 } 1615 }