Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 93886
b: refs/heads/master
c: 53371b5
h: refs/heads/master
v: v3
  • Loading branch information
Joerg Roedel authored and Avi Kivity committed Apr 27, 2008
1 parent d6a1d4e commit 1bc2b47
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6394b6494c0a352a2db3ea3e891ba7aeea7c1441
refs/heads/master: 53371b5098543ab09dcb0c7ce31da887dbe58c62
17 changes: 16 additions & 1 deletion trunk/arch/x86/kvm/svm.c
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,8 @@ static void init_vmcb(struct vcpu_svm *svm)
INTERCEPT_DR7_MASK;

control->intercept_exceptions = (1 << PF_VECTOR) |
(1 << UD_VECTOR);
(1 << UD_VECTOR) |
(1 << MC_VECTOR);


control->intercept = (1ULL << INTERCEPT_INTR) |
Expand Down Expand Up @@ -1044,6 +1045,19 @@ static int nm_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run)
return 1;
}

static int mc_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run)
{
/*
* On an #MC intercept the MCE handler is not called automatically in
* the host. So do it by hand here.
*/
asm volatile (
"int $0x12\n");
/* not sure if we ever come back to this point */

return 1;
}

static int shutdown_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run)
{
/*
Expand Down Expand Up @@ -1367,6 +1381,7 @@ static int (*svm_exit_handlers[])(struct vcpu_svm *svm,
[SVM_EXIT_EXCP_BASE + UD_VECTOR] = ud_interception,
[SVM_EXIT_EXCP_BASE + PF_VECTOR] = pf_interception,
[SVM_EXIT_EXCP_BASE + NM_VECTOR] = nm_interception,
[SVM_EXIT_EXCP_BASE + MC_VECTOR] = mc_interception,
[SVM_EXIT_INTR] = nop_on_interception,
[SVM_EXIT_NMI] = nop_on_interception,
[SVM_EXIT_SMI] = nop_on_interception,
Expand Down
1 change: 1 addition & 0 deletions trunk/include/asm-x86/kvm_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
#define SS_VECTOR 12
#define GP_VECTOR 13
#define PF_VECTOR 14
#define MC_VECTOR 18

#define SELECTOR_TI_MASK (1 << 2)
#define SELECTOR_RPL_MASK 0x03
Expand Down

0 comments on commit 1bc2b47

Please sign in to comment.