summaryrefslogtreecommitdiffstats
path: root/sys/amd64/vmm/vmm_lapic.c
diff options
context:
space:
mode:
authorneel <neel@FreeBSD.org>2013-12-25 06:46:31 +0000
committerneel <neel@FreeBSD.org>2013-12-25 06:46:31 +0000
commit0c91ef8145cb2d4090accd731fafb4e98da2a46c (patch)
tree7c26297e63fee10a7fbabe8f0dba16c34086f60f /sys/amd64/vmm/vmm_lapic.c
parent258c0be375414a2ecddb9f8db57bb16625ef7ca0 (diff)
downloadFreeBSD-src-0c91ef8145cb2d4090accd731fafb4e98da2a46c.zip
FreeBSD-src-0c91ef8145cb2d4090accd731fafb4e98da2a46c.tar.gz
vlapic code restructuring to make it easy to support hardware-assist for APIC
emulation. The vlapic initialization and cleanup is done via processor specific vmm_ops. This will allow the VT-x/SVM modules to layer any hardware-assist for APIC emulation or virtual interrupt delivery on top of the vlapic device model. Add a parameter to 'vcpu_notify_event()' to distinguish between vlapic interrupts versus other events (e.g. NMI). This provides an opportunity to use hardware-assists like Posted Interrupts (VT-x) or doorbell MSR (SVM) to deliver an interrupt to a guest without causing a VM-exit. Get rid of lapic_pending_intr() and lapic_intr_accepted() and use the vlapic_xxx() counterparts directly. Associate an 'Apic Page' with each vcpu and reference it from the 'vlapic'. The 'Apic Page' is intended to be referenced from the Intel VMCS as the 'virtual APIC page' or from the AMD VMCB as the 'vAPIC backing page'.
Diffstat (limited to 'sys/amd64/vmm/vmm_lapic.c')
-rw-r--r--sys/amd64/vmm/vmm_lapic.c24
1 files changed, 1 insertions, 23 deletions
diff --git a/sys/amd64/vmm/vmm_lapic.c b/sys/amd64/vmm/vmm_lapic.c
index 8d915cd..cb2c806 100644
--- a/sys/amd64/vmm/vmm_lapic.c
+++ b/sys/amd64/vmm/vmm_lapic.c
@@ -51,26 +51,6 @@ __FBSDID("$FreeBSD$");
#define MSI_X86_ADDR_LOG 0x00000004 /* Destination Mode */
int
-lapic_pending_intr(struct vm *vm, int cpu)
-{
- struct vlapic *vlapic;
-
- vlapic = vm_lapic(vm, cpu);
-
- return (vlapic_pending_intr(vlapic));
-}
-
-void
-lapic_intr_accepted(struct vm *vm, int cpu, int vector)
-{
- struct vlapic *vlapic;
-
- vlapic = vm_lapic(vm, cpu);
-
- vlapic_intr_accepted(vlapic, vector);
-}
-
-int
lapic_set_intr(struct vm *vm, int cpu, int vector, bool level)
{
struct vlapic *vlapic;
@@ -83,9 +63,7 @@ lapic_set_intr(struct vm *vm, int cpu, int vector, bool level)
vlapic = vm_lapic(vm, cpu);
vlapic_set_intr_ready(vlapic, vector, level);
-
- vcpu_notify_event(vm, cpu);
-
+ vcpu_notify_event(vm, cpu, true);
return (0);
}
OpenPOWER on IntegriCloud