Changeset View
Changeset View
Standalone View
Standalone View
head/sys/x86/xen/xen_apic.c
Show First 20 Lines • Show All 70 Lines • ▼ Show 20 Lines | |||||
static driver_filter_t xen_invltlb; | static driver_filter_t xen_invltlb; | ||||
static driver_filter_t xen_invlpg; | static driver_filter_t xen_invlpg; | ||||
static driver_filter_t xen_invlrng; | static driver_filter_t xen_invlrng; | ||||
static driver_filter_t xen_invlcache; | static driver_filter_t xen_invlcache; | ||||
#endif | #endif | ||||
static driver_filter_t xen_ipi_bitmap_handler; | static driver_filter_t xen_ipi_bitmap_handler; | ||||
static driver_filter_t xen_cpustop_handler; | static driver_filter_t xen_cpustop_handler; | ||||
static driver_filter_t xen_cpususpend_handler; | static driver_filter_t xen_cpususpend_handler; | ||||
static driver_filter_t xen_ipi_swi_handler; | |||||
#endif | #endif | ||||
/*---------------------------------- Macros ----------------------------------*/ | /*---------------------------------- Macros ----------------------------------*/ | ||||
#define IPI_TO_IDX(ipi) ((ipi) - APIC_IPI_INTS) | #define IPI_TO_IDX(ipi) ((ipi) - APIC_IPI_INTS) | ||||
/*--------------------------------- Xen IPIs ---------------------------------*/ | /*--------------------------------- Xen IPIs ---------------------------------*/ | ||||
#ifdef SMP | #ifdef SMP | ||||
struct xen_ipi_handler | struct xen_ipi_handler | ||||
Show All 11 Lines | #else | ||||
[IPI_TO_IDX(IPI_INVLTLB)] = { xen_invltlb, "itlb"}, | [IPI_TO_IDX(IPI_INVLTLB)] = { xen_invltlb, "itlb"}, | ||||
[IPI_TO_IDX(IPI_INVLPG)] = { xen_invlpg, "ipg" }, | [IPI_TO_IDX(IPI_INVLPG)] = { xen_invlpg, "ipg" }, | ||||
[IPI_TO_IDX(IPI_INVLRNG)] = { xen_invlrng, "irg" }, | [IPI_TO_IDX(IPI_INVLRNG)] = { xen_invlrng, "irg" }, | ||||
[IPI_TO_IDX(IPI_INVLCACHE)] = { xen_invlcache, "ic" }, | [IPI_TO_IDX(IPI_INVLCACHE)] = { xen_invlcache, "ic" }, | ||||
#endif | #endif | ||||
[IPI_TO_IDX(IPI_BITMAP_VECTOR)] = { xen_ipi_bitmap_handler, "b" }, | [IPI_TO_IDX(IPI_BITMAP_VECTOR)] = { xen_ipi_bitmap_handler, "b" }, | ||||
[IPI_TO_IDX(IPI_STOP)] = { xen_cpustop_handler, "st" }, | [IPI_TO_IDX(IPI_STOP)] = { xen_cpustop_handler, "st" }, | ||||
[IPI_TO_IDX(IPI_SUSPEND)] = { xen_cpususpend_handler, "sp" }, | [IPI_TO_IDX(IPI_SUSPEND)] = { xen_cpususpend_handler, "sp" }, | ||||
[IPI_TO_IDX(IPI_SWI)] = { xen_ipi_swi_handler, "sw" }, | |||||
}; | }; | ||||
#endif | #endif | ||||
/*------------------------------- Per-CPU Data -------------------------------*/ | /*------------------------------- Per-CPU Data -------------------------------*/ | ||||
#ifdef SMP | #ifdef SMP | ||||
DPCPU_DEFINE(xen_intr_handle_t, ipi_handle[nitems(xen_ipis)]); | DPCPU_DEFINE(xen_intr_handle_t, ipi_handle[nitems(xen_ipis)]); | ||||
#endif | #endif | ||||
▲ Show 20 Lines • Show All 400 Lines • ▼ Show 20 Lines | xen_cpustop_handler(void *arg) | ||||
return (FILTER_HANDLED); | return (FILTER_HANDLED); | ||||
} | } | ||||
static int | static int | ||||
xen_cpususpend_handler(void *arg) | xen_cpususpend_handler(void *arg) | ||||
{ | { | ||||
cpususpend_handler(); | cpususpend_handler(); | ||||
return (FILTER_HANDLED); | |||||
} | |||||
static int | |||||
xen_ipi_swi_handler(void *arg) | |||||
{ | |||||
struct trapframe *frame = arg; | |||||
ipi_swi_handler(*frame); | |||||
return (FILTER_HANDLED); | return (FILTER_HANDLED); | ||||
} | } | ||||
/*----------------------------- XEN PV IPI setup -----------------------------*/ | /*----------------------------- XEN PV IPI setup -----------------------------*/ | ||||
/* | /* | ||||
* Those functions are provided outside of the Xen PV APIC implementation | * Those functions are provided outside of the Xen PV APIC implementation | ||||
* so PVHVM guests can also use PV IPIs without having an actual Xen PV APIC, | * so PVHVM guests can also use PV IPIs without having an actual Xen PV APIC, | ||||
* because on PVHVM there's an emulated LAPIC provided by Xen. | * because on PVHVM there's an emulated LAPIC provided by Xen. | ||||
▲ Show 20 Lines • Show All 44 Lines • Show Last 20 Lines |