From: Stefan Bader <stefan.bader@canonical.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
Ben Guthro <ben@guthro.net>,
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
Lin Ming <mlin@ss.pku.edu.cn>
Subject: Re: Question about apic ipi interface
Date: Thu, 09 May 2013 16:33:49 +0200 [thread overview]
Message-ID: <518BB3CD.7000402@canonical.com> (raw)
In-Reply-To: <1368089794.17285.111.camel@zakaz.uk.xensource.com>
[-- Attachment #1.1: Type: text/plain, Size: 2804 bytes --]
On 09.05.2013 10:56, Ian Campbell wrote:
> On Wed, 2013-05-08 at 17:26 +0100, Stefan Bader wrote:
>> On 23.04.2013 12:07, Stefan Bader wrote:
>>> I was looking at some older patch and there is one thing I do not understand.
>>>
>>> commit f447d56d36af18c5104ff29dcb1327c0c0ac3634
>>> xen: implement apic ipi interface
>>>
>>> Specifically there the implementation of xen_send_IPI_mask_allbutself().
>>>
>>> void xen_send_IPI_mask_allbutself(const struct cpumask *mask,
>>> int vector)
>>> {
>>> unsigned cpu;
>>> unsigned int this_cpu = smp_processor_id();
>>>
>>> if (!(num_online_cpus() > 1))
>>> return;
>>>
>>> for_each_cpu_and(cpu, mask, cpu_online_mask) {
>>> if (this_cpu == cpu)
>>> continue;
>>>
>>> xen_smp_send_call_function_single_ipi(cpu);
>>> }
>>> }
>>>
>>> Why is this using xen_smp_send_call_function_single_ipi()? This dumps the
>>> supplied vector and always uses XEN_CALL_FUNCTION_SINGLE_VECTOR. In contrast the
>>> xen_send_IPI_all() and xen_send_IPI_self() keep the (mapped) vector.
>>>
>>> Mildly wondering about whether call function would need special casing (just
>>> because xen_smp_send_call_function_ipi() is special). But I don't have the big
>>> picture there.
>>>
>>
>> This never got really answered, so lets try this: Does the following patch seem
>> to make sense?
>
> It certainly seems too. Although I traced the call chain back to
> default_send_IPI_allbutself() which nothing actually seems to call. Or
> my grep is faulty...
>
> There is a call path via send_IPI_allbutself which looks to only
> potentially be called as:
> apic->send_IPI_allbutself(APIC_DM_NMI);
> apic->send_IPI_allbutself(NMI_VECTOR);
> (the other calls are in native_smp_foo which I assume doesn't apply).
If I am not missing something send_IPI_allbutself as a function only exists on
non-x86 archs. And as you say the other users seem to be in a function that gets
replaced under Xen PV.
>
> xen_map_vector( doesn't seem to handle those two, I'm not sure if that
> will constitute a regression since it doesn't seem likely that either of
> those would have worked properly with the current code either.
Yeah best case it would hide unimplemented vectors to be used. With the change
this would at least be obvious. Like I found when realizing that all this only
applies to dom0 because other PV domUs seem to get the noop_apic assigned. So
one can do a "echo l >/proc/sysrq-trigger" and get vector 0x2 (NMI_VECTOR) not
implemented (in dom0). Luckily the only bad thing happening is a delay and no
stack traces being produced.
-Stefan
>
> Ian.
>
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 899 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2013-05-09 14:33 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-23 10:07 Question about apic ipi interface Stefan Bader
2013-04-23 12:15 ` Ben Guthro
2013-04-23 12:23 ` Stefan Bader
2013-04-23 12:48 ` Stefan Bader
2013-05-08 16:26 ` Stefan Bader
2013-05-08 17:00 ` Ben Guthro
2013-05-09 8:56 ` Ian Campbell
2013-05-09 14:33 ` Stefan Bader [this message]
2013-05-22 19:40 ` Konrad Rzeszutek Wilk
2013-05-23 9:24 ` Stefan Bader
2013-05-24 14:19 ` Konrad Rzeszutek Wilk
2013-05-28 12:43 ` Konrad Rzeszutek Wilk
2013-05-28 12:50 ` Stefan Bader
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=518BB3CD.7000402@canonical.com \
--to=stefan.bader@canonical.com \
--cc=Ian.Campbell@citrix.com \
--cc=ben@guthro.net \
--cc=konrad.wilk@oracle.com \
--cc=mlin@ss.pku.edu.cn \
--cc=xen-devel@lists.xensource.com \
/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).