svn commit: r253043 - in projects/bhyve_npt_pmap/sys/amd64: include vmm
Neel Natu
neel at FreeBSD.org
Mon Jul 8 19:19:30 UTC 2013
Author: neel
Date: Mon Jul 8 19:19:29 2013
New Revision: 253043
URL: http://svnweb.freebsd.org/changeset/base/253043
Log:
Require that the 'struct vie' be initialized before fetching and decoding
the instruction.
Modified:
projects/bhyve_npt_pmap/sys/amd64/include/vmm_instruction_emul.h
projects/bhyve_npt_pmap/sys/amd64/vmm/vmm_instruction_emul.c
Modified: projects/bhyve_npt_pmap/sys/amd64/include/vmm_instruction_emul.h
==============================================================================
--- projects/bhyve_npt_pmap/sys/amd64/include/vmm_instruction_emul.h Mon Jul 8 17:57:11 2013 (r253042)
+++ projects/bhyve_npt_pmap/sys/amd64/include/vmm_instruction_emul.h Mon Jul 8 19:19:29 2013 (r253043)
@@ -102,11 +102,15 @@ int vmm_emulate_instruction(void *vm, in
#ifdef _KERNEL
/*
* APIs to fetch and decode the instruction from nested page fault handler.
+ *
+ * 'vie' must be initialized before calling 'vmm_fetch_instruction()'
*/
int vmm_fetch_instruction(struct vm *vm, int cpuid,
uint64_t rip, int inst_length, uint64_t cr3,
struct vie *vie);
+void vie_init(struct vie *vie);
+
/*
* Decode the instruction fetched into 'vie' so it can be emulated.
*
Modified: projects/bhyve_npt_pmap/sys/amd64/vmm/vmm_instruction_emul.c
==============================================================================
--- projects/bhyve_npt_pmap/sys/amd64/vmm/vmm_instruction_emul.c Mon Jul 8 17:57:11 2013 (r253042)
+++ projects/bhyve_npt_pmap/sys/amd64/vmm/vmm_instruction_emul.c Mon Jul 8 19:19:29 2013 (r253043)
@@ -399,7 +399,7 @@ vmm_emulate_instruction(void *vm, int vc
}
#ifdef _KERNEL
-static void
+void
vie_init(struct vie *vie)
{
@@ -474,8 +474,6 @@ vmm_fetch_instruction(struct vm *vm, int
if (inst_length > VIE_INST_SIZE)
panic("vmm_fetch_instruction: invalid length %d", inst_length);
- vie_init(vie);
-
/* Copy the instruction into 'vie' */
while (vie->num_valid < inst_length) {
err = gla2gpa(vm, rip, cr3, &gpa, &gpaend);
More information about the svn-src-projects
mailing list