diff options
author | Eddie Dong <eddie.dong@intel.com> | 2007-09-12 03:58:04 -0400 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2007-10-13 04:18:25 -0400 |
commit | 97222cc8316328965851ed28d23f6b64b4c912d2 (patch) | |
tree | 469b2f72e74046a7aec5061df194c3f68812a224 /drivers/kvm/vmx.c | |
parent | 7017fc3d1a12e30ea7df4992152978a188433457 (diff) |
KVM: Emulate local APIC in kernel
Because lightweight exits (exits which don't involve userspace) are many
times faster than heavyweight exits, it makes sense to emulate high usage
devices in the kernel. The local APIC is one such device, especially for
Windows and for SMP, so we add an APIC model to kvm.
It also allows in-kernel host-side drivers to inject interrupts without
going through userspace.
[compile fix on i386 from Jindrich Makovicka]
Signed-off-by: Yaozu (Eddie) Dong <Eddie.Dong@intel.com>
Signed-off-by: Qing He <qing.he@intel.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/vmx.c')
-rw-r--r-- | drivers/kvm/vmx.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c index 19676b5a6719..c4cc17cc00f7 100644 --- a/drivers/kvm/vmx.c +++ b/drivers/kvm/vmx.c | |||
@@ -2390,6 +2390,12 @@ static struct kvm_vcpu *vmx_create_vcpu(struct kvm *kvm, unsigned int id) | |||
2390 | if (err) | 2390 | if (err) |
2391 | goto free_vcpu; | 2391 | goto free_vcpu; |
2392 | 2392 | ||
2393 | if (irqchip_in_kernel(kvm)) { | ||
2394 | err = kvm_create_lapic(&vmx->vcpu); | ||
2395 | if (err < 0) | ||
2396 | goto free_vcpu; | ||
2397 | } | ||
2398 | |||
2393 | vmx->guest_msrs = kmalloc(PAGE_SIZE, GFP_KERNEL); | 2399 | vmx->guest_msrs = kmalloc(PAGE_SIZE, GFP_KERNEL); |
2394 | if (!vmx->guest_msrs) { | 2400 | if (!vmx->guest_msrs) { |
2395 | err = -ENOMEM; | 2401 | err = -ENOMEM; |