Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/xen/xenpci/xenpci.c
Show First 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | |||||
#include <xen/xen_intr.h> | #include <xen/xen_intr.h> | ||||
#include <dev/pci/pcireg.h> | #include <dev/pci/pcireg.h> | ||||
#include <dev/pci/pcivar.h> | #include <dev/pci/pcivar.h> | ||||
#include <dev/xen/xenpci/xenpcivar.h> | #include <dev/xen/xenpci/xenpcivar.h> | ||||
static int | static int | ||||
xenpci_intr_filter(void *trap_frame) | |||||
{ | |||||
mhorne: Here is where you might obtain a trapframe from `curthread->td_intr_frame`, which could be… | |||||
Done Inline ActionsExcept I was trying to get rid of this function. ehem_freebsd_m5p.com: Except I was trying to get rid of this function. | |||||
xen_intr_handle_upcall(trap_frame); | |||||
return (FILTER_HANDLED); | |||||
} | |||||
static int | |||||
xenpci_irq_init(device_t device, struct xenpci_softc *scp) | xenpci_irq_init(device_t device, struct xenpci_softc *scp) | ||||
{ | { | ||||
int error; | int error; | ||||
error = BUS_SETUP_INTR(device_get_parent(device), device, | error = BUS_SETUP_INTR(device_get_parent(device), device, | ||||
scp->res_irq, INTR_MPSAFE|INTR_TYPE_MISC, | scp->res_irq, INTR_MPSAFE|INTR_TYPE_MISC, | ||||
xenpci_intr_filter, NULL, /*trap_frame*/NULL, | xen_intr_handle_upcall, NULL, NULL, | ||||
Done Inline ActionsHere we have one of the users of the "feature" brought up in D32346. ehem_freebsd_m5p.com: Here we have one of the users of the "feature" brought up in D32346. | |||||
Not Done Inline ActionsIndeed. Which bus does the xenpci device attach to, xenpv? mhorne: Indeed. Which bus does the `xenpci` device attach to, `xenpv`? | |||||
Done Inline ActionsI'm not 100% certain as I haven't tried it. Looks like on x86 with HVM it is presented as a PCI device, I'm unsure how it shows in PVH mode. (partially I was taking a look since there are some patches to Xen to offer the feature on ARM, IOMMU will be needed) ehem_freebsd_m5p.com: I'm not 100% certain as I haven't tried it. Looks like on x86 with HVM it is presented as a… | |||||
&scp->intr_cookie); | &scp->intr_cookie); | ||||
if (error) | if (error) | ||||
return error; | return error; | ||||
#ifdef SMP | #ifdef SMP | ||||
/* | /* | ||||
* When using the PCI event delivery callback we cannot assign | * When using the PCI event delivery callback we cannot assign | ||||
* events to specific vCPUs, so all events are delivered to vCPU#0 by | * events to specific vCPUs, so all events are delivered to vCPU#0 by | ||||
▲ Show 20 Lines • Show All 157 Lines • Show Last 20 Lines |
Here is where you might obtain a trapframe from curthread->td_intr_frame, which could be passed to xen_intr_handle_upcall(). Since this handler is called by the interrupt framework (not direct from asm), we know that the value will be set and up to date. Please do this as a separate review from this one.