summaryrefslogtreecommitdiffstats
path: root/sys/amd64/include/vmm_instruction_emul.h
diff options
context:
space:
mode:
authorneel <neel@FreeBSD.org>2013-03-28 21:26:19 +0000
committerneel <neel@FreeBSD.org>2013-03-28 21:26:19 +0000
commit29b9bf0372f0e21c26723e7ad338ef3395022924 (patch)
treeafb2ba58313bcb030230a5dedb3fdf50556bd25a /sys/amd64/include/vmm_instruction_emul.h
parent82d58114889a20fcd15b9f51da2e60600642ed77 (diff)
downloadFreeBSD-src-29b9bf0372f0e21c26723e7ad338ef3395022924.zip
FreeBSD-src-29b9bf0372f0e21c26723e7ad338ef3395022924.tar.gz
Allow caller to skip 'guest linear address' validation when doing instruction
decode. This is to accomodate hardware assist implementations that do not provide the 'guest linear address' as part of nested page fault collateral. Submitted by: Anish Gupta (akgupt3 at gmail dot com)
Diffstat (limited to 'sys/amd64/include/vmm_instruction_emul.h')
-rw-r--r--sys/amd64/include/vmm_instruction_emul.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/amd64/include/vmm_instruction_emul.h b/sys/amd64/include/vmm_instruction_emul.h
index 4c7a346..a812a73 100644
--- a/sys/amd64/include/vmm_instruction_emul.h
+++ b/sys/amd64/include/vmm_instruction_emul.h
@@ -107,6 +107,18 @@ int vmm_fetch_instruction(struct vm *vm, int cpuid,
uint64_t rip, int inst_length, uint64_t cr3,
struct vie *vie);
+/*
+ * Decode the instruction fetched into 'vie' so it can be emulated.
+ *
+ * 'gla' is the guest linear address provided by the hardware assist
+ * that caused the nested page table fault. It is used to verify that
+ * the software instruction decoding is in agreement with the hardware.
+ *
+ * Some hardware assists do not provide the 'gla' to the hypervisor.
+ * To skip the 'gla' verification for this or any other reason pass
+ * in VIE_INVALID_GLA instead.
+ */
+#define VIE_INVALID_GLA (1UL << 63) /* a non-canonical address */
int vmm_decode_instruction(struct vm *vm, int cpuid,
uint64_t gla, struct vie *vie);
#endif /* _KERNEL */
OpenPOWER on IntegriCloud