]> xenbits.xensource.com Git - people/dariof/xen.git/commit
xen: update the comment about smp_processor_id() in do_softirq(). wip/tracing/xen-internals gitlab/wip/tracing/xen-internals
authorDario Faggioli <dario.faggioli@citrix.com>
Tue, 19 Sep 2017 11:59:46 +0000 (13:59 +0200)
committerDario Faggioli <dfaggioli@suse.com>
Fri, 23 Mar 2018 14:34:26 +0000 (15:34 +0100)
commit84e19bee1913cb8bf9b23eb2c3be982abb05f0a1
treecb17bfb15d0800a43ae8170dc3a44061ff13a6d8
parent738301591ccb663e7d87f431cdda3d5c9d31ab97
xen: update the comment about smp_processor_id() in do_softirq().

It's said that "SCHEDULE_SOFTIRQ may move us to another processor",
which I don't find it very clear, nor that much representative of
what the situation actually is.

We have two possible situations:
- context_switch() is a "terminal function" (i.e., it jumps,
  rather than returning normally. This happens on x86;
- context_switch() "just" returns, and another step of the
  loop is executed. This happens on ARM.

The real reason why we need to re-sample smp_processor_id() is
that, on ARM, where the function return, we get back inside
of the loop, with (potentially) a different stack (because
context_switch() changed what's in the stack pointer register).
And in this case, what's in the new stack, at the address of
the local variable 'cpu', may not be consistent.

State this in the comment.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
---
Changes from v1:
* v1 had a patch that was getting rid of the call to smp_processor_id(), but
  that is wrong (on ARM). So, it has been replaced with this, which only
  adjust the comment.
---
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: George Dunlap <George.Dunlap@eu.citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Julien Grall <julien.grall@arm.com>
Cc: Tim Deegan <tim@xen.org>
xen/common/softirq.c