|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [RFC 7/8] xen/arm: Allow DOM0 to set the irq type when ACPI is inuse
Hi Stefano, On 22/06/16 12:23, Stefano Stabellini wrote: On Tue, 7 Jun 2016, Julien Grall wrote:The function route_irq_to_guest mandates the IRQ type, stored in desc->arch.type, to be valid. However, in case of ACPI, these information is not part of the static tables. Therefore Xen needs to rely on DOM0 to provide a valid type based on the firmware tables. A new helper, irq_type_set_by_domain is provided to check whether a domain is allowed to set the IRQ type. For now, only DOM0 is allowed to configure it when ACPI is inuse. When the helper returns 1, the routing function will not check whether the IRQ type is correctly set and configure the GIC. Instead, this will be done when the domain will enable the interrupt. Note that irq_set_spi_type is not called because it validates the type and does not allow it the domain to change the type after the first write. It means that desc->arch.type will never be set, which is fine because the field is only used to configure the type during the routing. Signed-off-by: Julien Grall <julien.grall@xxxxxxx> --- I am thinking to at least extend the behavior to DOM0 using DT. This would make us resilient to a DT not providing the correct type without having to workaround them in Xen.I agree with you. It is also better to have only one way of doing things rather than two. I will update this patch to allow the hardware domain setting the IRQ type. [...] +#define NR_CFG_PER_ICFGR 16 +#define NR_BITS_PER_CFG (32U / NR_CFG_PER_ICFGR) + +/* The function should be called witht the rank lock taken. */ I found Shannon's function more difficult to understand. However the code is simpler, so I will use his function for the next version.
Hmmm it looks like that I forgot to explain in the commit message why I chose to call gic_set_irq_type here. Changing the value of Int_config is UNPREDICTABLE when the corresponding interrupt is not disabled (see 4.3.13 in ARM IHI 0048B.b).So calling gic_set_irq_type when the guest actualy writes to the virtual cfg would require to disable the IRQ before hand. Given that the behavior is UNPREDICTABLE, I chose to set the type before enabling the IRQ because the resulting code is simpler. Regards, -- Julien Grall _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |