summaryrefslogtreecommitdiffstats
path: root/sys/amd64/include
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2014-01-29 21:23:37 +0000
committerjhb <jhb@FreeBSD.org>2014-01-29 21:23:37 +0000
commit080d62f93d7c8004e0f06800adb9eb671a15c656 (patch)
treeaaeb609acf09f813a3e0705dffb98eeec21f8312 /sys/amd64/include
parent63fe90dcd8b2fc3d5acd50b81ae0ed650e09329a (diff)
downloadFreeBSD-src-080d62f93d7c8004e0f06800adb9eb671a15c656.zip
FreeBSD-src-080d62f93d7c8004e0f06800adb9eb671a15c656.tar.gz
MFC 259782:
Add a resume hook for bhyve that runs a function on all CPUs during resume. For Intel CPUs, invoke vmxon for CPUs that were in VMX mode at the time of suspend.
Diffstat (limited to 'sys/amd64/include')
-rw-r--r--sys/amd64/include/cpu.h3
-rw-r--r--sys/amd64/include/vmm.h2
2 files changed, 5 insertions, 0 deletions
diff --git a/sys/amd64/include/cpu.h b/sys/amd64/include/cpu.h
index 3d9ff531..3c5d5df 100644
--- a/sys/amd64/include/cpu.h
+++ b/sys/amd64/include/cpu.h
@@ -70,6 +70,9 @@ extern struct cpu_ops cpu_ops;
extern char btext[];
extern char etext[];
+/* Resume hook for VMM. */
+extern void (*vmm_resume_p)(void);
+
void cpu_halt(void);
void cpu_reset(void);
void fork_trampoline(void);
diff --git a/sys/amd64/include/vmm.h b/sys/amd64/include/vmm.h
index b6bb309..f7acb62 100644
--- a/sys/amd64/include/vmm.h
+++ b/sys/amd64/include/vmm.h
@@ -49,6 +49,7 @@ enum x2apic_state;
typedef int (*vmm_init_func_t)(void);
typedef int (*vmm_cleanup_func_t)(void);
+typedef void (*vmm_resume_func_t)(void);
typedef void * (*vmi_init_func_t)(struct vm *vm, struct pmap *pmap);
typedef int (*vmi_run_func_t)(void *vmi, int vcpu, register_t rip,
struct pmap *pmap);
@@ -72,6 +73,7 @@ typedef void (*vmi_vmspace_free)(struct vmspace *vmspace);
struct vmm_ops {
vmm_init_func_t init; /* module wide initialization */
vmm_cleanup_func_t cleanup;
+ vmm_resume_func_t resume;
vmi_init_func_t vminit; /* vm-specific initialization */
vmi_run_func_t vmrun;
OpenPOWER on IntegriCloud