[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 05/11] xen/arm: vpl011: Initialize nr_spis in vgic_init in Xen to atleast 1
On 03/16/2017 06:50 AM, Bhupinder Thakur wrote: Hi, Hi Bhupinder, On 5 March 2017 at 13:51, Julien Grall <julien.grall@xxxxxxx> wrote:Hi Bhupinder, Commit title: s/atleat/at least/ On 02/21/2017 11:26 AM, Bhupinder Thakur wrote:Ensure that nr_spis intialized in in vgic_init is atleast 1 to allow allocation ofs/intialized/initialized/ and again s/atleast/at least/pl011 spi virq. Signed-off-by: Bhupinder Thakur <bhupinder.thakur@xxxxxxxxxx> --- xen/arch/arm/vgic.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c index 364d5f0..614b3ec 100644 --- a/xen/arch/arm/vgic.c +++ b/xen/arch/arm/vgic.c @@ -121,6 +121,11 @@ int domain_vgic_init(struct domain *d, unsigned int nr_spis) /* Limit the number of virtual SPIs supported to (1020 - 32) = 988 */ if ( nr_spis > (1020 - NR_LOCAL_IRQS) ) return -EINVAL; +#ifdef CONFIG_VPL011_CONSOLE + /* Atleast 1 spi should be available for assigning to vpl011 */ + else if ( nr_spis < (1020 - NR_LOCAL_IRQS) ) + nr_spis += 1; +#endifPlease don't do that. The toolstack should allocated the correct number of SPIs depending on the configuration of the guest.Currently there is one parameter "irqs", which can be specified in the guest configuration file to specify the list of physical irqs allowed to a guest. The nr_spis is set to the maximum value of the irq specified in the irqs list. Can I use this parameter to specify the irq for pl011? I think not because this parameter is related to physical irqs to be allowed to a guest. nr_spis in the DOMCTL create domain indicates the number of SPIs that will be available in the GIC emulation and exposed to the guest via GICD_TYPER. The virtual SPIs will be routed in a second step (see DOMCTL_bind_pt_irq. The other option is to reserve a SPI for pl011 at compile time and use that value. Let me know. Whilst I am ok to have the pl011 SPI number hardcoded, I don't like the approach taken in this patch because the toolstack is in charge of the guest layout (interrupt, memory...) and not the hypervisor. The values are hardcoded today because we decided to do a fix layout for simplicity. It is likely to be changed in the future. The toolstack knows how much memory the user requested, the list of devices available... So it is the goal of the toolstack to bump the number of SPIs before creating the domain if a PL011 will be exposed. Also, the interaction between the pl011 and the parameter "irqs" in the domain configuration file will need to be documented. By that I mean explaining from which number the SPIs will be allocated when choosing a pl011 enabling. Note the probably want to allow the user to choose the pl011 IRQ and MMIO region. If he doesn't provide any, we would use the default value. Cheers, -- Julien Grall _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |