summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMike Larkin <mlarkin@cvs.openbsd.org>2017-01-19 23:17:20 +0000
committerMike Larkin <mlarkin@cvs.openbsd.org>2017-01-19 23:17:20 +0000
commitd38b16970ac4f10991656aef68a4be84c9d63aa2 (patch)
tree3ec6083578b96570ef3d6449e5064e924fc7a39b /sys
parentc34b6803301a5c29c5701fd7c6cd1ab6d66c5eaf (diff)
SVM: VMCB intercept definitions
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/amd64/include/specialreg.h115
-rw-r--r--sys/arch/i386/include/specialreg.h115
2 files changed, 228 insertions, 2 deletions
diff --git a/sys/arch/amd64/include/specialreg.h b/sys/arch/amd64/include/specialreg.h
index 59ceb9bd5de..cebd613f11e 100644
--- a/sys/arch/amd64/include/specialreg.h
+++ b/sys/arch/amd64/include/specialreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: specialreg.h,v 1.52 2017/01/13 17:15:27 mikeb Exp $ */
+/* $OpenBSD: specialreg.h,v 1.53 2017/01/19 23:17:19 mlarkin 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 $ */
@@ -1176,6 +1176,119 @@
#define AMD_SVM_NESTED_PAGING_CAP (1 << 0)
/*
+ * SVM : VMCB intercepts
+ */
+#define SVM_INTERCEPT_CR0_READ (1UL << 0)
+#define SVM_INTERCEPT_CR1_READ (1UL << 1)
+#define SVM_INTERCEPT_CR2_READ (1UL << 2)
+#define SVM_INTERCEPT_CR3_READ (1UL << 2)
+#define SVM_INTERCEPT_CR4_READ (1UL << 4)
+#define SVM_INTERCEPT_CR5_READ (1UL << 5)
+#define SVM_INTERCEPT_CR6_READ (1UL << 6)
+#define SVM_INTERCEPT_CR7_READ (1UL << 7)
+#define SVM_INTERCEPT_CR8_READ (1UL << 8)
+#define SVM_INTERCEPT_CR9_READ (1UL << 9)
+#define SVM_INTERCEPT_CR10_READ (1UL << 10)
+#define SVM_INTERCEPT_CR11_READ (1UL << 11)
+#define SVM_INTERCEPT_CR12_READ (1UL << 12)
+#define SVM_INTERCEPT_CR13_READ (1UL << 13)
+#define SVM_INTERCEPT_CR14_READ (1UL << 14)
+#define SVM_INTERCEPT_CR15_READ (1UL << 15)
+#define SVM_INTERCEPT_CR0_WRITE (1UL << 16)
+#define SVM_INTERCEPT_CR1_WRITE (1UL << 17)
+#define SVM_INTERCEPT_CR2_WRITE (1UL << 18)
+#define SVM_INTERCEPT_CR3_WRITE (1UL << 19)
+#define SVM_INTERCEPT_CR4_WRITE (1UL << 20)
+#define SVM_INTERCEPT_CR5_WRITE (1UL << 21)
+#define SVM_INTERCEPT_CR6_WRITE (1UL << 22)
+#define SVM_INTERCEPT_CR7_WRITE (1UL << 23)
+#define SVM_INTERCEPT_CR8_WRITE (1UL << 24)
+#define SVM_INTERCEPT_CR9_WRITE (1UL << 25)
+#define SVM_INTERCEPT_CR10_WRITE (1UL << 26)
+#define SVM_INTERCEPT_CR11_WRITE (1UL << 27)
+#define SVM_INTERCEPT_CR12_WRITE (1UL << 28)
+#define SVM_INTERCEPT_CR13_WRITE (1UL << 29)
+#define SVM_INTERCEPT_CR14_WRITE (1UL << 30)
+#define SVM_INTERCEPT_CR15_WRITE (1UL << 31)
+#define SVM_INTERCEPT_DR0_READ (1UL << 0)
+#define SVM_INTERCEPT_DR1_READ (1UL << 1)
+#define SVM_INTERCEPT_DR2_READ (1UL << 2)
+#define SVM_INTERCEPT_DR3_READ (1UL << 2)
+#define SVM_INTERCEPT_DR4_READ (1UL << 4)
+#define SVM_INTERCEPT_DR5_READ (1UL << 5)
+#define SVM_INTERCEPT_DR6_READ (1UL << 6)
+#define SVM_INTERCEPT_DR7_READ (1UL << 7)
+#define SVM_INTERCEPT_DR8_READ (1UL << 8)
+#define SVM_INTERCEPT_DR9_READ (1UL << 9)
+#define SVM_INTERCEPT_DR10_READ (1UL << 10)
+#define SVM_INTERCEPT_DR11_READ (1UL << 11)
+#define SVM_INTERCEPT_DR12_READ (1UL << 12)
+#define SVM_INTERCEPT_DR13_READ (1UL << 13)
+#define SVM_INTERCEPT_DR14_READ (1UL << 14)
+#define SVM_INTERCEPT_DR15_READ (1UL << 15)
+#define SVM_INTERCEPT_DR0_WRITE (1UL << 16)
+#define SVM_INTERCEPT_DR1_WRITE (1UL << 17)
+#define SVM_INTERCEPT_DR2_WRITE (1UL << 18)
+#define SVM_INTERCEPT_DR3_WRITE (1UL << 19)
+#define SVM_INTERCEPT_DR4_WRITE (1UL << 20)
+#define SVM_INTERCEPT_DR5_WRITE (1UL << 21)
+#define SVM_INTERCEPT_DR6_WRITE (1UL << 22)
+#define SVM_INTERCEPT_DR7_WRITE (1UL << 23)
+#define SVM_INTERCEPT_DR8_WRITE (1UL << 24)
+#define SVM_INTERCEPT_DR9_WRITE (1UL << 25)
+#define SVM_INTERCEPT_DR10_WRITE (1UL << 26)
+#define SVM_INTERCEPT_DR11_WRITE (1UL << 27)
+#define SVM_INTERCEPT_DR12_WRITE (1UL << 28)
+#define SVM_INTERCEPT_DR13_WRITE (1UL << 29)
+#define SVM_INTERCEPT_DR14_WRITE (1UL << 30)
+#define SVM_INTERCEPT_DR15_WRITE (1UL << 31)
+#define SVM_INTERCEPT_INTR (1UL << 0)
+#define SVM_INTERCEPT_NMI (1UL << 1)
+#define SVM_INTERCEPT_SMI (1UL << 2)
+#define SVM_INTERCEPT_INIT (1UL << 3)
+#define SVM_INTERCEPT_VINTR (1UL << 4)
+#define SVM_INTERCEPT_CR0_SEL_WRITE (1UL << 5)
+#define SVM_INTERCEPT_IDTR_READ (1UL << 6)
+#define SVM_INTERCEPT_GDTR_READ (1UL << 7)
+#define SVM_INTERCEPT_LDTR_READ (1UL << 8)
+#define SVM_INTERCEPT_TR_READ (1UL << 9)
+#define SVM_INTERCEPT_IDTR_WRITE (1UL << 10)
+#define SVM_INTERCEPT_GDTR_WRITE (1UL << 11)
+#define SVM_INTERCEPT_LDTR_WRITE (1UL << 12)
+#define SVM_INTERCEPT_TR_WRITE (1UL << 13)
+#define SVM_INTERCEPT_RDTSC (1UL << 14)
+#define SVM_INTERCEPT_RDPMC (1UL << 15)
+#define SVM_INTERCEPT_PUSHF (1UL << 16)
+#define SVM_INTERCEPT_POPF (1UL << 17)
+#define SVM_INTERCEPT_CPUID (1UL << 18)
+#define SVM_INTERCEPT_RSM (1UL << 19)
+#define SVM_INTERCEPT_IRET (1UL << 20)
+#define SVM_INTERCEPT_INTN (1UL << 21)
+#define SVM_INTERCEPT_INVD (1UL << 22)
+#define SVM_INTERCEPT_PAUSE (1UL << 23)
+#define SVM_INTERCEPT_HLT (1UL << 24)
+#define SVM_INTERCEPT_INVLPG (1UL << 25)
+#define SVM_INTERCEPT_INVLPGA (1UL << 26)
+#define SVM_INTERCEPT_INOUT (1UL << 27)
+#define SVM_INTERCEPT_MSR (1UL << 28)
+#define SVM_INTERCEPT_TASK_SWITCH (1UL << 29)
+#define SVM_INTERCEPT_FERR_FREEZE (1UL << 30)
+#define SVM_INTERCEPT_SHUTDOWN (1UL << 31)
+#define SVM_INTERCEPT_VMRUN (1UL << 0)
+#define SVM_INTERCEPT_VMMCALL (1UL << 1)
+#define SVM_INTERCEPT_VMLOAD (1UL << 2)
+#define SVM_INTERCEPT_VMSAVE (1UL << 3)
+#define SVM_INTERCEPT_STGI (1UL << 4)
+#define SVM_INTERCEPT_CLGI (1UL << 5)
+#define SVM_INTERCEPT_SKINIT (1UL << 6)
+#define SVM_INTERCEPT_RDTSCP (1UL << 7)
+#define SVM_INTERCEPT_ICEBP (1UL << 8)
+#define SVM_INTERCEPT_WBINVD (1UL << 9)
+#define SVM_INTERCEPT_MONITOR (1UL << 10)
+#define SVM_INTERCEPT_MWAIT_UNCOND (1UL << 11)
+#define SVM_INTERCEPT_MWAIT_COND (1UL << 12)
+
+/*
* PAT
*/
#define PATENTRY(n, type) (type << ((n) * 8))
diff --git a/sys/arch/i386/include/specialreg.h b/sys/arch/i386/include/specialreg.h
index 856030a479e..11c025c2adc 100644
--- a/sys/arch/i386/include/specialreg.h
+++ b/sys/arch/i386/include/specialreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: specialreg.h,v 1.59 2017/01/13 17:15:27 mikeb Exp $ */
+/* $OpenBSD: specialreg.h,v 1.60 2017/01/19 23:17:19 mlarkin Exp $ */
/* $NetBSD: specialreg.h,v 1.7 1994/10/27 04:16:26 cgd Exp $ */
/*-
@@ -1049,6 +1049,119 @@
#define AMD_SVM_NESTED_PAGING_CAP (1 << 0)
/*
+ * SVM : VMCB intercepts
+ */
+#define SVM_INTERCEPT_CR0_READ (1UL << 0)
+#define SVM_INTERCEPT_CR1_READ (1UL << 1)
+#define SVM_INTERCEPT_CR2_READ (1UL << 2)
+#define SVM_INTERCEPT_CR3_READ (1UL << 2)
+#define SVM_INTERCEPT_CR4_READ (1UL << 4)
+#define SVM_INTERCEPT_CR5_READ (1UL << 5)
+#define SVM_INTERCEPT_CR6_READ (1UL << 6)
+#define SVM_INTERCEPT_CR7_READ (1UL << 7)
+#define SVM_INTERCEPT_CR8_READ (1UL << 8)
+#define SVM_INTERCEPT_CR9_READ (1UL << 9)
+#define SVM_INTERCEPT_CR10_READ (1UL << 10)
+#define SVM_INTERCEPT_CR11_READ (1UL << 11)
+#define SVM_INTERCEPT_CR12_READ (1UL << 12)
+#define SVM_INTERCEPT_CR13_READ (1UL << 13)
+#define SVM_INTERCEPT_CR14_READ (1UL << 14)
+#define SVM_INTERCEPT_CR15_READ (1UL << 15)
+#define SVM_INTERCEPT_CR0_WRITE (1UL << 16)
+#define SVM_INTERCEPT_CR1_WRITE (1UL << 17)
+#define SVM_INTERCEPT_CR2_WRITE (1UL << 18)
+#define SVM_INTERCEPT_CR3_WRITE (1UL << 19)
+#define SVM_INTERCEPT_CR4_WRITE (1UL << 20)
+#define SVM_INTERCEPT_CR5_WRITE (1UL << 21)
+#define SVM_INTERCEPT_CR6_WRITE (1UL << 22)
+#define SVM_INTERCEPT_CR7_WRITE (1UL << 23)
+#define SVM_INTERCEPT_CR8_WRITE (1UL << 24)
+#define SVM_INTERCEPT_CR9_WRITE (1UL << 25)
+#define SVM_INTERCEPT_CR10_WRITE (1UL << 26)
+#define SVM_INTERCEPT_CR11_WRITE (1UL << 27)
+#define SVM_INTERCEPT_CR12_WRITE (1UL << 28)
+#define SVM_INTERCEPT_CR13_WRITE (1UL << 29)
+#define SVM_INTERCEPT_CR14_WRITE (1UL << 30)
+#define SVM_INTERCEPT_CR15_WRITE (1UL << 31)
+#define SVM_INTERCEPT_DR0_READ (1UL << 0)
+#define SVM_INTERCEPT_DR1_READ (1UL << 1)
+#define SVM_INTERCEPT_DR2_READ (1UL << 2)
+#define SVM_INTERCEPT_DR3_READ (1UL << 2)
+#define SVM_INTERCEPT_DR4_READ (1UL << 4)
+#define SVM_INTERCEPT_DR5_READ (1UL << 5)
+#define SVM_INTERCEPT_DR6_READ (1UL << 6)
+#define SVM_INTERCEPT_DR7_READ (1UL << 7)
+#define SVM_INTERCEPT_DR8_READ (1UL << 8)
+#define SVM_INTERCEPT_DR9_READ (1UL << 9)
+#define SVM_INTERCEPT_DR10_READ (1UL << 10)
+#define SVM_INTERCEPT_DR11_READ (1UL << 11)
+#define SVM_INTERCEPT_DR12_READ (1UL << 12)
+#define SVM_INTERCEPT_DR13_READ (1UL << 13)
+#define SVM_INTERCEPT_DR14_READ (1UL << 14)
+#define SVM_INTERCEPT_DR15_READ (1UL << 15)
+#define SVM_INTERCEPT_DR0_WRITE (1UL << 16)
+#define SVM_INTERCEPT_DR1_WRITE (1UL << 17)
+#define SVM_INTERCEPT_DR2_WRITE (1UL << 18)
+#define SVM_INTERCEPT_DR3_WRITE (1UL << 19)
+#define SVM_INTERCEPT_DR4_WRITE (1UL << 20)
+#define SVM_INTERCEPT_DR5_WRITE (1UL << 21)
+#define SVM_INTERCEPT_DR6_WRITE (1UL << 22)
+#define SVM_INTERCEPT_DR7_WRITE (1UL << 23)
+#define SVM_INTERCEPT_DR8_WRITE (1UL << 24)
+#define SVM_INTERCEPT_DR9_WRITE (1UL << 25)
+#define SVM_INTERCEPT_DR10_WRITE (1UL << 26)
+#define SVM_INTERCEPT_DR11_WRITE (1UL << 27)
+#define SVM_INTERCEPT_DR12_WRITE (1UL << 28)
+#define SVM_INTERCEPT_DR13_WRITE (1UL << 29)
+#define SVM_INTERCEPT_DR14_WRITE (1UL << 30)
+#define SVM_INTERCEPT_DR15_WRITE (1UL << 31)
+#define SVM_INTERCEPT_INTR (1UL << 0)
+#define SVM_INTERCEPT_NMI (1UL << 1)
+#define SVM_INTERCEPT_SMI (1UL << 2)
+#define SVM_INTERCEPT_INIT (1UL << 3)
+#define SVM_INTERCEPT_VINTR (1UL << 4)
+#define SVM_INTERCEPT_CR0_SEL_WRITE (1UL << 5)
+#define SVM_INTERCEPT_IDTR_READ (1UL << 6)
+#define SVM_INTERCEPT_GDTR_READ (1UL << 7)
+#define SVM_INTERCEPT_LDTR_READ (1UL << 8)
+#define SVM_INTERCEPT_TR_READ (1UL << 9)
+#define SVM_INTERCEPT_IDTR_WRITE (1UL << 10)
+#define SVM_INTERCEPT_GDTR_WRITE (1UL << 11)
+#define SVM_INTERCEPT_LDTR_WRITE (1UL << 12)
+#define SVM_INTERCEPT_TR_WRITE (1UL << 13)
+#define SVM_INTERCEPT_RDTSC (1UL << 14)
+#define SVM_INTERCEPT_RDPMC (1UL << 15)
+#define SVM_INTERCEPT_PUSHF (1UL << 16)
+#define SVM_INTERCEPT_POPF (1UL << 17)
+#define SVM_INTERCEPT_CPUID (1UL << 18)
+#define SVM_INTERCEPT_RSM (1UL << 19)
+#define SVM_INTERCEPT_IRET (1UL << 20)
+#define SVM_INTERCEPT_INTN (1UL << 21)
+#define SVM_INTERCEPT_INVD (1UL << 22)
+#define SVM_INTERCEPT_PAUSE (1UL << 23)
+#define SVM_INTERCEPT_HLT (1UL << 24)
+#define SVM_INTERCEPT_INVLPG (1UL << 25)
+#define SVM_INTERCEPT_INVLPGA (1UL << 26)
+#define SVM_INTERCEPT_INOUT (1UL << 27)
+#define SVM_INTERCEPT_MSR (1UL << 28)
+#define SVM_INTERCEPT_TASK_SWITCH (1UL << 29)
+#define SVM_INTERCEPT_FERR_FREEZE (1UL << 30)
+#define SVM_INTERCEPT_SHUTDOWN (1UL << 31)
+#define SVM_INTERCEPT_VMRUN (1UL << 0)
+#define SVM_INTERCEPT_VMMCALL (1UL << 1)
+#define SVM_INTERCEPT_VMLOAD (1UL << 2)
+#define SVM_INTERCEPT_VMSAVE (1UL << 3)
+#define SVM_INTERCEPT_STGI (1UL << 4)
+#define SVM_INTERCEPT_CLGI (1UL << 5)
+#define SVM_INTERCEPT_SKINIT (1UL << 6)
+#define SVM_INTERCEPT_RDTSCP (1UL << 7)
+#define SVM_INTERCEPT_ICEBP (1UL << 8)
+#define SVM_INTERCEPT_WBINVD (1UL << 9)
+#define SVM_INTERCEPT_MONITOR (1UL << 10)
+#define SVM_INTERCEPT_MWAIT_UNCOND (1UL << 11)
+#define SVM_INTERCEPT_MWAIT_COND (1UL << 12)
+
+/*
* PAT
*/
#define PATENTRY(n, type) ((uint64_t)type << ((n) * 8))