summaryrefslogtreecommitdiff
path: root/sys/arch/amd64
diff options
context:
space:
mode:
authorpd <pd@cvs.openbsd.org>2018-04-18 06:50:36 +0000
committerpd <pd@cvs.openbsd.org>2018-04-18 06:50:36 +0000
commitbf9e5c04ec5cf2ea595062420b9b5108abce0c09 (patch)
treefc10d204c7d32d01dc58633fb65ef6bd54865d10 /sys/arch/amd64
parentcb7574ce9e1e63d8d09ad8a0b77052b74944873f (diff)
vmm: Fix interrupt window exiting for AMD / SVM
* define V_IGN_TPR (ignore virtual TPR) * set V_IGN_TPR while configuring window exiting (was missed in one location along with setting of the intr vector) This should fix unresponsive network / console issues with guests on SVM.
Diffstat (limited to 'sys/arch/amd64')
-rw-r--r--sys/arch/amd64/amd64/vmm.c6
-rw-r--r--sys/arch/amd64/include/specialreg.h4
2 files changed, 7 insertions, 3 deletions
diff --git a/sys/arch/amd64/amd64/vmm.c b/sys/arch/amd64/amd64/vmm.c
index ec8cbd7a188..6ddb77c5c4d 100644
--- a/sys/arch/amd64/amd64/vmm.c
+++ b/sys/arch/amd64/amd64/vmm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmm.c,v 1.186 2018/03/29 02:25:10 mlarkin Exp $ */
+/* $OpenBSD: vmm.c,v 1.187 2018/04/18 06:50:35 pd Exp $ */
/*
* Copyright (c) 2014 Mike Larkin <mlarkin@openbsd.org>
*
@@ -6092,7 +6092,7 @@ vcpu_run_svm(struct vcpu *vcpu, struct vm_run_params *vrp)
vmcb->v_eventinj = (irq & 0xFF) | (1<<31);
} else {
vmcb->v_irq = 1;
- vmcb->v_intr_misc = 0x10; /* XXX #define ign_tpr */
+ vmcb->v_intr_misc = SVM_INTR_MISC_V_IGN_TPR;
vmcb->v_intr_vector = 0;
vmcb->v_intercept1 |= SVM_INTERCEPT_VINTR;
svm_set_dirty(vcpu, SVM_CLEANBITS_TPR |
@@ -6246,6 +6246,8 @@ vcpu_run_svm(struct vcpu *vcpu, struct vm_run_params *vrp)
if (vcpu->vc_irqready == 0 && vcpu->vc_intr) {
vmcb->v_intercept1 |= SVM_INTERCEPT_VINTR;
vmcb->v_irq = 1;
+ vmcb->v_intr_misc = SVM_INTR_MISC_V_IGN_TPR;
+ vmcb->v_intr_vector = 0;
svm_set_dirty(vcpu, SVM_CLEANBITS_TPR |
SVM_CLEANBITS_I);
}
diff --git a/sys/arch/amd64/include/specialreg.h b/sys/arch/amd64/include/specialreg.h
index 134870742f7..2e8f7c37e8c 100644
--- a/sys/arch/amd64/include/specialreg.h
+++ b/sys/arch/amd64/include/specialreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: specialreg.h,v 1.69 2018/02/22 20:18:59 bluhm Exp $ */
+/* $OpenBSD: specialreg.h,v 1.70 2018/04/18 06:50:35 pd Exp $ */
/* $NetBSD: specialreg.h,v 1.1 2003/04/26 18:39:48 fvdl Exp $ */
/* $NetBSD: x86/specialreg.h,v 1.2 2003/04/25 21:54:30 fvdl Exp $ */
@@ -1252,6 +1252,8 @@
SVM_CLEANBITS_DR | SVM_CLEANBITS_DT | SVM_CLEANBITS_SEG | \
SVM_CLEANBITS_CR2 | SVM_CLEANBITS_LBR | SVM_CLEANBITS_AVIC )
+#define SVM_INTR_MISC_V_IGN_TPR 0x10
+
/*
* SVM : VMCB intercepts
*/