From: Anup Patel <anup.patel@linaro.org>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Pranavkumar Sawargaonkar <pranavkumar@linaro.org>,
Julien Grall <julien.grall@linaro.org>,
"stefano.stabellini" <stefano.stabellini@citrix.com>,
Ian Campbell <Ian.Campbell@citrix.com>,
xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH] xen/arm: Fix smp_send_call_function_mask() for current CPU
Date: Fri, 15 Aug 2014 15:42:20 +0530 [thread overview]
Message-ID: <CALrVBktrOOk-Cw-bMc-3fs9RF6c87BHE+3kDTCazikfq14THyQ@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1408151023200.2293@kaball.uk.xensource.com>
Hi Stefano,
On 15 August 2014 14:58, Stefano Stabellini
<stefano.stabellini@eu.citrix.com> wrote:
> Hi Anup,
> thanks for the patch.
>
>
> On Thu, 14 Aug 2014, Anup Patel wrote:
>> The smp_send_call_function_mask() does not work on Foundation v8
>> model with one CPU. The reason being gicv2_send_SGI() is called
>> with irqmode==SGI_TARGET_LIST and *cpu_mask=0x1 on CPU0 which
>> does not work on Foundation v8 model.
>
> I read the GIC spec again, and this has to be a bug in the Foundation v8
> model. Please make sure to raise this issue with ARM so that they can
> fix it.
I had the same feeling when I cross-checked GIC spec after
reading Julien's comment.
>
>
>> Further, it is really strange that smp_send_call_function_mask()
>> depends on GIC SGIs for calling function on current CPU.
>>
>> This patch fixes smp_send_call_function_mask() for current CPU
>> by directly calling smp_call_function_interrupt() on current CPU.
>> This is very similar to what Xen x86 does.
>
> It could be a reasonable improvement regardless of the Foundation v8
> bug. I would recommend to:
>
> - Avoid mentioning the bug in the Foundation model in the commit
> message, because a bug in an emulator is not a good reason to make
> changes in Xen. If that was the only reason, then we would need to
> introduce the change as a per-platform quirk, like
> PLATFORM_QUIRK_GIC_64K_STRIDE.
Sure, I will update the wordings in patch description as per
your suggestion.
>
> - Clear the smp_processor_id() bit from mask, otherwise we end up
> calling the function twice on the processor we are running on at the
> moment.
Sure, I will update this.
Thanks,
Anup
>
>
>
>> Signed-off-by: Anup Patel <anup.patel@linaro.org>
>> Signed-off-by: Pranavkumar Sawargaonkar <pranavkumar@linaro.org>
>> ---
>> xen/arch/arm/smp.c | 7 +++++++
>> 1 file changed, 7 insertions(+)
>>
>> diff --git a/xen/arch/arm/smp.c b/xen/arch/arm/smp.c
>> index 30203b8..4fde3f9 100644
>> --- a/xen/arch/arm/smp.c
>> +++ b/xen/arch/arm/smp.c
>> @@ -20,6 +20,13 @@ void smp_send_event_check_mask(const cpumask_t *mask)
>> void smp_send_call_function_mask(const cpumask_t *mask)
>> {
>> send_SGI_mask(mask, GIC_SGI_CALL_FUNCTION);
>> +
>> + if ( cpumask_test_cpu(smp_processor_id(), mask) )
>> + {
>> + local_irq_disable();
>> + smp_call_function_interrupt();
>> + local_irq_enable();
>> + }
>> }
>>
>> /*
>> --
>> 1.7.9.5
>>
prev parent reply other threads:[~2014-08-15 10:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-14 11:47 [PATCH] xen/arm: Fix smp_send_call_function_mask() for current CPU Anup Patel
2014-08-14 11:49 ` Anup Patel
2014-08-14 12:44 ` Julien Grall
2014-08-14 21:52 ` Julien Grall
2014-08-15 3:58 ` Anup Patel
2014-08-15 9:28 ` Stefano Stabellini
2014-08-15 10:12 ` Anup Patel [this message]
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=CALrVBktrOOk-Cw-bMc-3fs9RF6c87BHE+3kDTCazikfq14THyQ@mail.gmail.com \
--to=anup.patel@linaro.org \
--cc=Ian.Campbell@citrix.com \
--cc=julien.grall@linaro.org \
--cc=pranavkumar@linaro.org \
--cc=stefano.stabellini@citrix.com \
--cc=stefano.stabellini@eu.citrix.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).