[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v6 15/22] arm/acpi: Permit access all Xen unused SPIs for Dom0
Hi Shannon, On 17/03/16 09:41, Shannon Zhao wrote: From: Shannon Zhao <shannon.zhao@xxxxxxxxxx> Permit access all Xen unused SPIs for Dom0 except the interrupts that Xen uses. You say exactly the same things with all "Xen unused SPIs for Dom0" and "except the interrupts that Xen uses". I would instead say: "Allow DOM0 to use all SPIs but the ones used by Xen." Then when Dom0 configures the interrupt, it could set the interrupt type and route it to Dom0. Signed-off-by: Shannon Zhao <shannon.zhao@xxxxxxxxxx> Reviewed-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx> --- xen/arch/arm/domain_build.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index 6726e45..1e5ee0e 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -1359,6 +1359,33 @@ static int prepare_dtb(struct domain *d, struct kernel_info *kinfo) #ifdef CONFIG_ACPI #define ACPI_DOM0_FDT_MIN_SIZE 4096 +static int acpi_permit_spi_access(struct domain *d) +{ + int i, res; + struct irq_desc *desc; + + /* Here just permit Dom0 to access the SPIs which Xen doesn't use. Then when Coding style: /* * FOo * Bar */ + * Dom0 configures the interrupt, set the interrupt type and route it to + * Dom0. + */ + for( i = NR_LOCAL_IRQS; i < vgic_num_irqs(d); i++ ) + { + desc = irq_to_desc(i); + if( desc->action != NULL) Well some of the SPIs used by Xen may not be registered yet. For instance the SMMU driver doesn't register any SPIs until it's necessary (i.e a device is assigned to a domain). + continue; + + res = irq_permit_access(d, i); + if ( res ) + { + printk(XENLOG_ERR "Unable to permit to dom%u access to IRQ %u\n", + d->domain_id, i); + return res; + } + } + + return 0; +} + static int make_chosen_node(const struct kernel_info *kinfo, struct membank tbl_add[]) { @@ -1849,6 +1876,10 @@ static int prepare_acpi(struct domain *d, struct kernel_info *kinfo) if ( rc != 0 ) return rc; + rc = acpi_permit_spi_access(d); + if ( rc != 0 ) + return rc; + return 0; } #else -- Julien Grall _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |