|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v3 3/6] xen/arm: assign devices to boot domains
Hi Stefano, On 20/08/2019 00:20, Stefano Stabellini wrote: On Fri, 9 Aug 2019, Julien Grall wrote:Hi Stefano, On 8/9/19 12:12 AM, Stefano Stabellini wrote:Scan the user provided dtb fragment at boot. For each device node, map memory to guests, and route interrupts and setup the iommu. The iommu is setup by passing the node of the device to assign on the host device tree. The path is specified in the device tree fragment as the "xen,path" string property. The memory region to remap is specified by the "xen,reg" property. (Perhaps it might be possible to use "range" instead of "xen,regs". Thiss/xen,regs/xen,reg/ But I don't see how you could use range here... This is for translation address between two address-space.I'll remove the comment in-code comment. This is not a new request from my side, the code should be either self-explained or contain in-code comment to understand it. Have a look at write_properties() for example.
Your assumption here is if handle_interrupts return a strictly positive integer (i.e some interrupts have been routed), then the "interrupts" property exists. But this is definitely not correct, Xen is able to handle "interrupts-extended" so if you have a node using that property and using GIC interrupts. Then you would be executing this path. So if the property "interrupts-extended" is used, then the code below will fail as the property "interrupts" is not present. + + /* generate interrupt-parent to point to the virtual GIC */ + r = fdt_property_u32(fdt, "interrupt-parent", GUEST_PHANDLE_GIC);From your implementation of handle_interrupts(), there are no promise you would be here with just a GIC interrupts. You may also need to copy any interrupts property for node that does not belong to the GIC.Let's say that we have a mix of GIC and non-GIC interrupts at the node with xen,path and xen,reg. Let's also say that we are in a regular interrupt-parent/interrupts configuration (no interrupts-extended, see below). Is it possible without interrupts-extended? How would it look like? It is not possible to have a node using a mix of GIC and non-GIC interrupts without the property "interrupts-extended". However, this is not my point here. My point is the presence of xen,path does not mean the node will be using GIC interrupts. So blindly setting "interrupt-parent" to point to the GIC node is wrong. + if ( r ) + return r; + + /* copy interrupts/interrupts-extended from the host DT node */ + intspec = dt_get_property(node, "interrupts", &intlen); + if ( intspec == NULL ) + return -EFAULT;You don't handle interrupts-extended nor interrupt-mapping.I was wondering what to do about that. For now, I added a note in the last patch of the series, the one adding info to the doc. Already in this v3 series: My point here is your in-code comment does not match the code. But... "For GIC interrupts, only the interrupts property is currently supported, not the newer interrupts-extended property." ... I don't think this series should be merged with "interrupts-extended" not handled. I don't think this is right to request the user to fix its device-tree in order to test passthrough dom0less. The property is also not very difficult to handle as this is copying the property over. Regarding the property "interrupt-map" (and interrupt-map-mask), it is used for bus (i.e PCI...) so I think it may not be critical yet. However, it made me realized that the node you are trying to passthrough may be under a bus. That bus may have an "interrupt-map" so the property "interrupts" will not contain directly GIC interrupts. You can relate this to the way memory region are translated. So this means to copying over "interrupts" does not look to be a good solution. Cheers, -- Julien Grall _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |