From: Julien Grall <julien.grall@linaro.org>
To: Anup Patel <anup.patel@linaro.org>, xen-devel@lists.xen.org
Cc: Pranavkumar Sawargaonkar <pranavkumar@linaro.org>,
stefano.stabellini@citrix.com, Ian.Campbell@citrix.com,
stefano.stabellini@eu.citrix.com
Subject: Re: [PATCH] xen/arm: Fix smp_send_call_function_mask() for current CPU
Date: Thu, 14 Aug 2014 13:44:42 +0100 [thread overview]
Message-ID: <53ECAF3A.1080406@linaro.org> (raw)
In-Reply-To: <1408016846-12149-1-git-send-email-anup.patel@linaro.org>
Hi Anup,
On 08/14/2014 12:47 PM, 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.
Please provide any steps, trace that make you think that irqmode ==
SGI_TARGET_LIST and *cpu_mask=0x1 is not working on Foundation V8 Model.
> Further, it is really strange that smp_send_call_function_mask()
> depends on GIC SGIs for calling function on current CPU.
Why it's strange??? The GIC specification doesn't seem to add any
restriction about sending an SGI to the current CPU.
It clearly looks like a bug in another part of Xen. And I doubt it's
because the Foundation Model is not able to support the use case above.
Without any further explanation than "It doesn't work" and "It's
strange", I don't think this patch should be accepted in Xen.
You need at least to point the paragraph in the spec...
> 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.
What was done in x86 may not make sense on ARM....
For me the current code is valid... So far, I didn't see any issue on
different boards. I've also used recently the Foundation v8 Model [1],
without any issue.
> 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();
> + }
> }
Send SGI mask doesn't remove the current CPU, therefore this will result
to send twice the SGIs to the current physical CPU.
While we have a check in smp_call_function_interrupt to avoid spurious
SGI interrupt. It's not acceptable to rely on it knowingly.
In general, if we can avoid test for a specific CPU in the code it's better.
Regards,
[1]
http://www.arm.com/products/tools/models/fast-models/foundation-model.php
--
Julien Grall
next prev parent reply other threads:[~2014-08-14 12:44 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 [this message]
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
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=53ECAF3A.1080406@linaro.org \
--to=julien.grall@linaro.org \
--cc=Ian.Campbell@citrix.com \
--cc=anup.patel@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).