From 03f444d9042b1730bf3d8ff9ab3369e744e5e69b Mon Sep 17 00:00:00 2001 From: Brandon Perez Date: Mon, 20 Jul 2015 18:04:36 -0400 Subject: [PATCH 3/3] This commit adds in support for Xen to be aware of devices being statically mapped in the crossbar. In general, Xen needs very few interrupts to run. Most of the interrupts it directly uses (and therefore owns) are timer interrupts, which are internal to the processor (PPIs), and therefore do not involve the interrupts crossbar. The rest of the interrupts (SPIs) are simply passed onto the Dom0 kernel, who handles them appropiately. Xen simply internally tracks which interrupts belong to which domain. There is one notable exception to this: the serial device, which is a peripheral, and therefore must be routed through the crossbar. In a setup where the kernel does pseudo-dynamic crossbar mapping, Xen must still own this serial interrupt, and it therefore must be statically mapped. The interrupt property will contain the crossbar input number of the device, so a new property is added to a device if it is needed by Xen: "default-mapping", which contains the interrupt number that the device will correspond to in the mapping setup by the bootloader. This will not be changed by the Dom0 kernel. --- xen/common/device_tree.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c index 31f169b..fc82eb4 100644 --- a/xen/common/device_tree.c +++ b/xen/common/device_tree.c @@ -1036,10 +1036,13 @@ int dt_device_get_raw_irq(const struct dt_device_node *device, dt_dprintk("dt_device_get_raw_irq: dev=%s, index=%u\n", device->full_name, index); - /* Get the interrupts property */ - intspec = dt_get_property(device, "interrupts", &intlen); - if ( intspec == NULL ) - return -EINVAL; + /* Get the appropiate interrupts property */ + intspec = dt_get_property(device, "default-mapping", &intlen); + if (intspec == NULL) { + intspec = dt_get_property(device, "interrupts", &intlen); + if (intspec == NULL) + return -EINVAL; + } intlen /= sizeof(*intspec); dt_dprintk(" intspec=%d intlen=%d\n", be32_to_cpup(intspec), intlen); -- 1.7.9.5