aboutsummaryrefslogtreecommitdiff
path: root/sys/amd64/vmm/vmm.c
diff options
context:
space:
mode:
authorNeel Natu <neel@FreeBSD.org>2013-12-03 00:43:31 +0000
committerNeel Natu <neel@FreeBSD.org>2013-12-03 00:43:31 +0000
commit2282187475351a53dfc9572624bf616b9a977300 (patch)
treee093dc29b32757625454b62ae109d5a5d20603e8 /sys/amd64/vmm/vmm.c
parent3cd260b2228a7690b644eeab76c7d942aee7073f (diff)
downloadsrc-2282187475351a53dfc9572624bf616b9a977300.tar.gz
src-2282187475351a53dfc9572624bf616b9a977300.zip
Rename 'vm_interrupt_hostcpu()' to 'vcpu_notify_event()' because the function
has outgrown its original name. Originally this function simply sent an IPI to the host cpu that a vcpu was executing on but now it does a lot more than just that. Reviewed by: grehan@
Notes
Notes: svn path=/head/; revision=258859
Diffstat (limited to 'sys/amd64/vmm/vmm.c')
-rw-r--r--sys/amd64/vmm/vmm.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/sys/amd64/vmm/vmm.c b/sys/amd64/vmm/vmm.c
index 3e52a8e81a61..d2df5b1d5321 100644
--- a/sys/amd64/vmm/vmm.c
+++ b/sys/amd64/vmm/vmm.c
@@ -1099,7 +1099,7 @@ vm_inject_nmi(struct vm *vm, int vcpuid)
vcpu = &vm->vcpu[vcpuid];
vcpu->nmi_pending = 1;
- vm_interrupt_hostcpu(vm, vcpuid);
+ vcpu_notify_event(vm, vcpuid);
return (0);
}
@@ -1319,8 +1319,15 @@ vm_set_x2apic_state(struct vm *vm, int vcpuid, enum x2apic_state state)
return (0);
}
+/*
+ * This function is called to ensure that a vcpu "sees" a pending event
+ * as soon as possible:
+ * - If the vcpu thread is sleeping then it is woken up.
+ * - If the vcpu is running on a different host_cpu then an IPI will be directed
+ * to the host_cpu to cause the vcpu to trap into the hypervisor.
+ */
void
-vm_interrupt_hostcpu(struct vm *vm, int vcpuid)
+vcpu_notify_event(struct vm *vm, int vcpuid)
{
int hostcpu;
struct vcpu *vcpu;