xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@arm.com>
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: steve.capper@arm.com, shankerd@codeaurora.org,
	shannon.zhao@linaro.org, wei.chen@arm.com,
	xen-devel@lists.xen.org
Subject: Re: [RFC 2/8] xen/arm: gic: Do not configure affinity for guest IRQ during routing
Date: Wed, 22 Jun 2016 12:19:15 +0100	[thread overview]
Message-ID: <576A7433.9090801@arm.com> (raw)
In-Reply-To: <alpine.DEB.2.10.1606221150570.2575@sstabellini-ThinkPad-X260>

Hi Stefano,

On 22/06/16 11:54, Stefano Stabellini wrote:
> On Tue, 7 Jun 2016, Julien Grall wrote:
>> The affinity of a guest IRQ is set every time the guest enable it (see
>> vgic_enable_irqs).
>>
>> It is not necessary to set the affinity when the IRQ is routed to the
>> guest because Xen will never receive the IRQ until it hass been enabled
>> by the guest.
>>
>> Signed-off-by: Julien grall <julien.grall@arm.com>
>> ---
>>   xen/arch/arm/gic.c | 10 ++++------
>>   1 file changed, 4 insertions(+), 6 deletions(-)
>>
>> diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
>> index 8a1087b..f25381f 100644
>> --- a/xen/arch/arm/gic.c
>> +++ b/xen/arch/arm/gic.c
>> @@ -97,17 +97,13 @@ void gic_restore_state(struct vcpu *v)
>>   }
>>
>>   /*
>> - * needs to be called with a valid cpu_mask, ie each cpu in the mask has
>> - * already called gic_cpu_init
>>    * - desc.lock must be held
>>    * - arch.type must be valid (i.e != IRQ_TYPE_INVALID)
>>    */
>>   static void gic_set_irq_properties(struct irq_desc *desc,
>> -                                   const cpumask_t *cpu_mask,
>>                                      unsigned int priority)
>>   {
>>       gic_hw_ops->set_irq_properties(desc, priority);
>> -    desc->handler->set_affinity(desc, cpu_mask);
>>   }
>>
>>   /* Program the GIC to route an interrupt to the host (i.e. Xen)
>> @@ -123,7 +119,9 @@ void gic_route_irq_to_xen(struct irq_desc *desc, const cpumask_t *cpu_mask,
>>
>>       desc->handler = gic_hw_ops->gic_host_irq_type;
>>
>> -    gic_set_irq_properties(desc, cpu_mask, priority);
>> +    desc->handler->set_affinity(desc, cpu_mask);
>
> You could call irq_set_affinity here, it might make for nicer code.
>
> Actually thinking more about this, I think it would be better to add the
> irq_set_affinity call to xen/arch/arm/irq.c:setup_irq, right after the
> call to gic_route_irq_to_xen.  That way both gic_route_irq_to_xen and
> gic_route_irq_to_guest would behave the same way: just setup the routing
> and not the affinity.
>
> What do you think?

I am fine to call irq_set_affinity from setup_irq. It makes more sense 
than calling the former from gic_route_irq_to_xen.

I will make the change in the next version.

Cheers,

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  reply	other threads:[~2016-06-22 11:19 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-07 16:48 [RFC 0/8] xen/arm: acpi: Support SPIs routing Julien Grall
2016-06-07 16:48 ` [RFC 1/8] xen/arm: gic: Consolidate the IRQ affinity set in a single place Julien Grall
2016-06-22 10:46   ` Stefano Stabellini
2016-06-07 16:48 ` [RFC 2/8] xen/arm: gic: Do not configure affinity for guest IRQ during routing Julien Grall
2016-06-22 10:54   ` Stefano Stabellini
2016-06-22 11:19     ` Julien Grall [this message]
2016-06-07 16:48 ` [RFC 3/8] xen/arm: gic: split set_irq_properties Julien Grall
2016-06-22 10:58   ` Stefano Stabellini
2016-06-07 16:48 ` [RFC 4/8] xen/arm: gic: set_type: Pass the type in parameter rather than in desc->arch.type Julien Grall
2016-06-22 11:25   ` Stefano Stabellini
2016-06-07 16:48 ` [RFC 5/8] xen/arm: gic: Document how gic_set_irq_type should be called Julien Grall
2016-06-22 11:00   ` Stefano Stabellini
2016-06-07 16:48 ` [RFC 6/8] Revert "xen/arm: warn the user that we cannot route SPIs to Dom0 on ACPI" Julien Grall
2016-06-22 11:01   ` Stefano Stabellini
2016-06-07 16:48 ` [RFC 7/8] xen/arm: Allow DOM0 to set the irq type when ACPI is inuse Julien Grall
2016-06-22 11:23   ` Stefano Stabellini
2016-06-22 11:46     ` Julien Grall
2016-06-22 11:49       ` Stefano Stabellini
2016-06-07 16:48 ` [RFC 8/8] xen/arm: acpi: route all unused IRQs to DOM0 Julien Grall
2016-06-22 11:44   ` Stefano Stabellini
2016-06-22 12:19     ` Julien Grall
2016-06-07 18:50 ` [RFC 0/8] xen/arm: acpi: Support SPIs routing Shanker Donthineni
2016-06-08 11:48   ` Shanker Donthineni
2016-06-08 11:49     ` Julien Grall
2016-06-08 12:11       ` Shanker Donthineni
2016-06-08 12:34         ` Julien Grall
2016-06-13 11:42           ` Julien Grall
2016-06-13 17:19             ` Shanker Donthineni
2016-06-13 17:20               ` Julien Grall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=576A7433.9090801@arm.com \
    --to=julien.grall@arm.com \
    --cc=shankerd@codeaurora.org \
    --cc=shannon.zhao@linaro.org \
    --cc=sstabellini@kernel.org \
    --cc=steve.capper@arm.com \
    --cc=wei.chen@arm.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).