diff mbox

[Xen-devel,v2,41/41] arm : acpi route irq's at time of boot

Message ID 1431893048-5214-42-git-send-email-parth.dixit@linaro.org
State New
Headers show

Commit Message

Parth Dixit May 17, 2015, 8:04 p.m. UTC
NOTE: This is a wrokaround to be fixed later.
Route all the irq's to Dom0 at the time of booting.
Trigger and polarity will be set dyanmaically when
Dom0 request's for it.

Signed-off-by: Parth Dixit <parth.dixit@linaro.org>
---
 xen/arch/arm/domain_build.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

Comments

Parth Dixit July 5, 2015, 1:37 p.m. UTC | #1
+shannon

On 8 June 2015 at 23:14, Julien Grall <julien.grall@citrix.com> wrote:
> Hi,
>
> On 17/05/2015 21:04, Parth Dixit wrote:
>>
>> NOTE: This is a wrokaround to be fixed later.
>
>
> How do you plan to fix it?
>
>> Route all the irq's to Dom0 at the time of booting.
>> Trigger and polarity will be set dyanmaically when
>
>
> s/dyanmaically/dynamically/
>
>> Dom0 request's for it.
>>
>> Signed-off-by: Parth Dixit <parth.dixit@linaro.org>
>> ---
>>   xen/arch/arm/domain_build.c | 20 ++++++++++++++++++++
>>   1 file changed, 20 insertions(+)
>>
>> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
>> index 2ce30bf..cdad86b 100644
>> --- a/xen/arch/arm/domain_build.c
>> +++ b/xen/arch/arm/domain_build.c
>> @@ -1481,6 +1481,26 @@ static int prepare_acpi(struct domain *d, struct
>> kernel_info *kinfo, struct memb
>>       acpi_os_unmap_memory(rsdp_tbl, sizeof(struct acpi_table_rsdp) );
>>
>>       prepare_efi_table(d, kinfo, tbl_add);
>> +
>> +    /* configure interrupts gicv2 only */
>
>
> The indentation seems wrong.
>
> Also, why GICv2 only? I don't see anything GICv2 specific...
>
>> +     for( i = 32 ; i < 255 ; i++ )
>> +     {
>> +        struct irq_desc *desc;
>
>
> Newline.
>
>> +        desc = irq_to_desc(i);
>> +        if( desc->action != NULL)
>> +            continue;
>> +
>> +        vgic_reserve_virq(d, i);
>
>
> This function returns an error code. If you don't use it explain why in a
> comment.
>
>> +        set_irq_type(i, ACPI_IRQ_TYPE_NONE);
>> +        res = route_irq_to_guest(d, i, i, NULL);
>> +        if ( res )
>> +        {
>> +            printk(XENLOG_ERR "Unable to route IRQ %u to domain %u\n",
>> +                    i, d->domain_id);
>> +            continue;
>
>
> Shouldn't we bail out here?
>
> Regards,
>
> --
> Julien Grall
diff mbox

Patch

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 2ce30bf..cdad86b 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -1481,6 +1481,26 @@  static int prepare_acpi(struct domain *d, struct kernel_info *kinfo, struct memb
     acpi_os_unmap_memory(rsdp_tbl, sizeof(struct acpi_table_rsdp) );
 
     prepare_efi_table(d, kinfo, tbl_add);
+
+    /* configure interrupts gicv2 only */
+     for( i = 32 ; i < 255 ; i++ )
+     {
+        struct irq_desc *desc;
+        desc = irq_to_desc(i);
+        if( desc->action != NULL)
+            continue;
+
+        vgic_reserve_virq(d, i);
+        set_irq_type(i, ACPI_IRQ_TYPE_NONE);
+        res = route_irq_to_guest(d, i, i, NULL);
+        if ( res )
+        {
+            printk(XENLOG_ERR "Unable to route IRQ %u to domain %u\n",
+                    i, d->domain_id);
+            continue;
+        }
+     }
+
     /* map rsdp table */
     size = sizeof(struct acpi_table_rsdp);