diff options
author | jhb <jhb@FreeBSD.org> | 2013-12-23 19:29:07 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2013-12-23 19:29:07 +0000 |
commit | 8ab82a5fe13e26cddefae4b3e57d3c2d8baf2b20 (patch) | |
tree | 1bf0f6e72b82932012864d660cbc802885ec7efd /lib | |
parent | 4cd7151fa0d6497a4048c615ac13730233856a4f (diff) | |
download | FreeBSD-src-8ab82a5fe13e26cddefae4b3e57d3c2d8baf2b20.zip FreeBSD-src-8ab82a5fe13e26cddefae4b3e57d3c2d8baf2b20.tar.gz |
Extend the support for local interrupts on the local APIC:
- Add a generic routine to trigger an LVT interrupt that supports both
fixed and NMI delivery modes.
- Add an ioctl and bhyvectl command to trigger local interrupts inside a
guest. In particular, a global NMI similar to that raised by SERR# or
PERR# can be simulated by asserting LINT1 on all vCPUs.
- Extend the LVT table in the vCPU local APIC to support CMCI.
- Flesh out the local APIC error reporting a bit to cache errors and
report them via ESR when ESR is written to. Add support for asserting
the error LVT when an error occurs. Raise illegal vector errors when
attempting to signal an invalid vector for an interrupt or when sending
an IPI.
- Ignore writes to reserved bits in LVT entries.
- Export table entries the MADT and MP Table advertising the stock x86
config of LINT0 set to ExtInt and LINT1 wired to NMI.
Reviewed by: neel (earlier version)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libvmmapi/vmmapi.c | 12 | ||||
-rw-r--r-- | lib/libvmmapi/vmmapi.h | 1 |
2 files changed, 13 insertions, 0 deletions
diff --git a/lib/libvmmapi/vmmapi.c b/lib/libvmmapi/vmmapi.c index 463ae7e..6fec469 100644 --- a/lib/libvmmapi/vmmapi.c +++ b/lib/libvmmapi/vmmapi.c @@ -397,6 +397,18 @@ vm_lapic_irq(struct vmctx *ctx, int vcpu, int vector) } int +vm_lapic_local_irq(struct vmctx *ctx, int vcpu, int vector) +{ + struct vm_lapic_irq vmirq; + + bzero(&vmirq, sizeof(vmirq)); + vmirq.cpuid = vcpu; + vmirq.vector = vector; + + return (ioctl(ctx->fd, VM_LAPIC_LOCAL_IRQ, &vmirq)); +} + +int vm_lapic_msi(struct vmctx *ctx, uint64_t addr, uint64_t msg) { struct vm_lapic_msi vmmsi; diff --git a/lib/libvmmapi/vmmapi.h b/lib/libvmmapi/vmmapi.h index 52e7e92..69762c7 100644 --- a/lib/libvmmapi/vmmapi.h +++ b/lib/libvmmapi/vmmapi.h @@ -67,6 +67,7 @@ int vm_inject_event(struct vmctx *ctx, int vcpu, enum vm_event_type type, int vm_inject_event2(struct vmctx *ctx, int vcpu, enum vm_event_type type, int vector, int error_code); int vm_lapic_irq(struct vmctx *ctx, int vcpu, int vector); +int vm_lapic_local_irq(struct vmctx *ctx, int vcpu, int vector); int vm_lapic_msi(struct vmctx *ctx, uint64_t addr, uint64_t msg); int vm_ioapic_assert_irq(struct vmctx *ctx, int irq); int vm_ioapic_deassert_irq(struct vmctx *ctx, int irq); |