summaryrefslogtreecommitdiffstats
path: root/sys/amd64/vmm/intel/vmcs.h
diff options
context:
space:
mode:
authorneel <neel@FreeBSD.org>2014-01-11 03:14:05 +0000
committerneel <neel@FreeBSD.org>2014-01-11 03:14:05 +0000
commit41814122f19400859788d1b15a5aa0854ecd8530 (patch)
tree34e2105846c268a0b5d112f708ee2c0e646b1063 /sys/amd64/vmm/intel/vmcs.h
parent651494a5f1183fa7a351ff494970640ba9c6f3d8 (diff)
downloadFreeBSD-src-41814122f19400859788d1b15a5aa0854ecd8530.zip
FreeBSD-src-41814122f19400859788d1b15a5aa0854ecd8530.tar.gz
Enable the "Acknowledge Interrupt on VM exit" VM-exit control.
This control is needed to enable "Posted Interrupts" and is present in all the Intel VT-x implementations supported by bhyve so enable it as the default. With this VM-exit control enabled the processor will acknowledge the APIC and store the vector number in the "VM-Exit Interruption Information" field. We now call the interrupt handler "by hand" through the IDT entry associated with the vector.
Diffstat (limited to 'sys/amd64/vmm/intel/vmcs.h')
-rw-r--r--sys/amd64/vmm/intel/vmcs.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/amd64/vmm/intel/vmcs.h b/sys/amd64/vmm/intel/vmcs.h
index 21958f0..217cfdd 100644
--- a/sys/amd64/vmm/intel/vmcs.h
+++ b/sys/amd64/vmm/intel/vmcs.h
@@ -177,8 +177,8 @@ vmcs_write(uint32_t encoding, uint64_t val)
/* 32-bit read-only data fields */
#define VMCS_INSTRUCTION_ERROR 0x00004400
#define VMCS_EXIT_REASON 0x00004402
-#define VMCS_EXIT_INTERRUPTION_INFO 0x00004404
-#define VMCS_EXIT_INTERRUPTION_ERROR 0x00004406
+#define VMCS_EXIT_INTR_INFO 0x00004404
+#define VMCS_EXIT_INTR_ERRCODE 0x00004406
#define VMCS_IDT_VECTORING_INFO 0x00004408
#define VMCS_IDT_VECTORING_ERROR 0x0000440A
#define VMCS_EXIT_INSTRUCTION_LENGTH 0x0000440C
@@ -331,9 +331,10 @@ vmcs_write(uint32_t encoding, uint64_t val)
/*
* VMCS interrupt information fields
*/
-#define VMCS_INTERRUPTION_INFO_VALID (1U << 31)
-#define VMCS_INTERRUPTION_INFO_HW_INTR (0 << 8)
-#define VMCS_INTERRUPTION_INFO_NMI (2 << 8)
+#define VMCS_INTR_INFO_VALID (1U << 31)
+#define VMCS_INTR_INFO_TYPE(info) (((info) >> 8) & 0x7)
+#define VMCS_INTR_INFO_HW_INTR (0 << 8)
+#define VMCS_INTR_INFO_NMI (2 << 8)
/*
* VMCS IDT-Vectoring information fields
OpenPOWER on IntegriCloud