xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Marc Zyngier <marc.zyngier@arm.com>
To: Ian Campbell <ian.campbell@citrix.com>,
	Vijay Kilari <vijay.kilari@gmail.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	"Prasun.Kapoor@caviumnetworks.com"
	<Prasun.Kapoor@caviumnetworks.com>,
	Vijaya Kumar K <vijaya.kumar@caviumnetworks.com>,
	Tim Deegan <tim@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Julien Grall <julien.grall@citrix.com>,
	"stefano.stabellini@citrix.com" <stefano.stabellini@citrix.com>,
	"manish.jaggi@caviumnetworks.com"
	<manish.jaggi@caviumnetworks.com>
Subject: Re: [PATCH v4 05/17] xen/arm: ITS: implement hw_irq_controller for LPIs
Date: Thu, 16 Jul 2015 16:21:22 +0100	[thread overview]
Message-ID: <55A7CBF2.1030304@arm.com> (raw)
In-Reply-To: <1437058155.32371.222.camel@citrix.com>

On 16/07/15 15:49, Ian Campbell wrote:
> On Wed, 2015-07-15 at 22:31 +0530, Vijay Kilari wrote:
>> Sorry. I may not be clear.
>>
>> In Linux when MSIx is enabled.
>> Device is created first and its_device->its_collection is set for
>> first onine cpu
>> and mapvi is called with collection set in its_create_device() as below.
> [...]
>> When affinity is set, movi is sent with collection id selected
>> for the cpu_mask.
> 
> OK, so at start of day all events for a given device end up mapped to a
> single processor, but as individual interrupts are rebalanced they will
> then become spread out among different CPUs, that makes sense.
> 
> I'm not sure I follow the scheme which Linux is using to achieve that
> behaviour though, so I've CC'd Marc.
> 
> It seems to me from looking at the Linux code that its_dev->collection
> doesn't, as one might expect, contain the collection associated with the
> device (and therefore all Events of that device), but rather it contains
> the collection corresponding to a single Event which is the one which
> most recently had its affinity changed, i.e. the one with an potentially
> outstanding INV.
> 
> So its_send_movi sends the MOVI command which ends up calling INV on
> that collection, which at this point is the _old_ collection. Then it
> stores the new collection for that Event in its_dev->collection.
> 
> What I don't follow is how set_lpi_config copes with this, since it
> always sends the INV for an Event to the corresponding its_dev's
> collection, but after a bunch of Events/IRQs have been rebalanced there
> doesn't seem to be any guarantee that this would corresponding to the
> current collection associated with the interrupt which has been
> reconfigured.
> 
> Marc, have I misunderstood what the Linux ITS driver is trying to
> achieve or how it goes about it?

Seems like there is a lot of terminology related confusion here, so
let's start from the beginning:

The ITS maps a [DevID, EventID] pair to a [LPI, Collection] pair, where
DevID is the device writing the MSI, EventID is the payload being
written, LPI is the actual interrupt number, and Collection is roughly
equivalent to a target CPU.

The DevID is not directly associated to a Collection; it is the LPI that
is mapped to a Collection (through the MAPVI command). When you perform
a MOVI, you are moving the *result* of the [DevID, EventID] pair
(effectively an LPI) from a Collection to another.

> Perhaps lpi_set_config (and by extension its_(un)mask_irq) is only
> called at start of day?

lpi_set_config is indeed only used when we put the interrupt in service.
It updates the configuration table for the redistributor (the thing
pointed to by the Collection) in charge of this LPI (*LPI*, not device
or event) and issue an INV so that the redistributor (gets the new
value). And yes, this is always done by [DevID, EventID] pair.

When you perform a MOVI, this implicitly contains an INV for the target
redistributor (MOVI will also move the pending state, and the old
redistributor will be left alone).

> I'm not sure if Xen is going to (want to) follow the way Linux arranges
> this stuff, but I would very much like to at least understand it, since
> it may have implications...

Hope this helps,

	M.
-- 
Jazz is not dead. It just smells funny...

  reply	other threads:[~2015-07-16 15:21 UTC|newest]

Thread overview: 113+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-10  7:42 [PATCH v4 00/17] Add ITS support vijay.kilari
2015-07-10  7:42 ` [PATCH v4 01/17] xen/arm: Add bitmap_find_next_zero_area helper function vijay.kilari
2015-07-10  9:01   ` Jan Beulich
2015-07-10  9:28     ` Vijay Kilari
2015-07-10  9:30       ` Vijay Kilari
2015-07-10  9:45     ` Vijay Kilari
2015-07-10 10:07       ` Jan Beulich
2015-07-10  7:42 ` [PATCH v4 02/17] xen: Add log2 functionality vijay.kilari
2015-07-10  7:42 ` [PATCH v4 03/17] xen/arm: ITS: Port ITS driver to Xen vijay.kilari
2015-07-10 13:01   ` Ian Campbell
2015-07-15 10:23   ` Julien Grall
2015-07-10  7:42 ` [PATCH v4 04/17] xen/arm: ITS: Add helper functions to manage its_devices vijay.kilari
2015-07-10 13:05   ` Ian Campbell
2015-07-15 10:37   ` Julien Grall
2015-07-15 14:21     ` Vijay Kilari
2015-07-15 14:28       ` Julien Grall
2015-07-10  7:42 ` [PATCH v4 05/17] xen/arm: ITS: implement hw_irq_controller for LPIs vijay.kilari
2015-07-10 13:46   ` Ian Campbell
2015-07-11 14:40     ` Vijay Kilari
2015-07-11 18:08       ` Julien Grall
2015-07-13  9:17       ` Ian Campbell
2015-07-13 21:18   ` Julien Grall
2015-07-15  7:16     ` Vijay Kilari
2015-07-15  8:26       ` Julien Grall
2015-07-15  9:32         ` Ian Campbell
2015-07-15  9:49           ` Julien Grall
2015-07-15 10:01             ` Ian Campbell
2015-07-15 14:15           ` Vijay Kilari
2015-07-15 14:22             ` Julien Grall
2015-07-15 14:28             ` Ian Campbell
2015-07-15 17:01               ` Vijay Kilari
2015-07-16 14:49                 ` Ian Campbell
2015-07-16 15:21                   ` Marc Zyngier [this message]
2015-07-16 16:18                     ` Ian Campbell
2015-07-16 16:27                       ` Marc Zyngier
2015-07-16 16:37                         ` Ian Campbell
2015-07-18 10:13           ` Julien Grall
2015-07-20 11:52             ` Ian Campbell
2015-07-20 12:22             ` Ian Campbell
2015-07-15 18:19   ` Julien Grall
2015-07-10  7:42 ` [PATCH v4 06/17] xen/arm: ITS: Add virtual ITS driver vijay.kilari
2015-07-10 13:54   ` Ian Campbell
2015-07-11 14:48     ` Vijay Kilari
2015-07-13  9:27       ` Ian Campbell
2015-07-10 14:15   ` Ian Campbell
2015-07-11 14:48     ` Vijay Kilari
2015-07-13  9:25       ` Ian Campbell
2015-07-15 12:17   ` Julien Grall
2015-07-10  7:42 ` [PATCH v4 07/17] xen/arm: ITS: Add virtual ITS commands support vijay.kilari
2015-07-10 14:35   ` Ian Campbell
2015-07-11 14:49     ` Vijay Kilari
2015-07-13  9:22       ` Ian Campbell
2015-07-13 11:15         ` Vijay Kilari
2015-07-13 11:37           ` Ian Campbell
2015-07-17 15:01             ` Vijay Kilari
2015-07-15 13:02     ` Julien Grall
2015-07-15 13:56       ` Ian Campbell
2015-07-15 12:57   ` Julien Grall
2015-07-17 14:12     ` Vijay Kilari
2015-07-17 15:15       ` Julien Grall
2015-07-17 15:34         ` Ian Campbell
2015-07-17 15:44           ` Julien Grall
2015-07-10  7:42 ` [PATCH v4 08/17] xen/arm: ITS: Add APIs to add and assign device vijay.kilari
2015-07-10 14:52   ` Ian Campbell
2015-07-15 13:14     ` Julien Grall
2015-07-16 13:40       ` Vijay Kilari
2015-07-16 14:38         ` Julien Grall
2015-07-15 14:15   ` Julien Grall
2015-07-18  9:44     ` Vijay Kilari
2015-07-18 10:06       ` Julien Grall
2015-07-10  7:42 ` [PATCH v4 09/17] xen/arm: ITS: Add GITS registers emulation vijay.kilari
2015-07-10 14:56   ` Ian Campbell
2015-07-15 16:13   ` Julien Grall
2015-07-10  7:42 ` [PATCH v4 10/17] xen/arm: ITS: Enable physical and virtual ITS driver compilation vijay.kilari
2015-07-15 16:16   ` Julien Grall
2015-07-10  7:42 ` [PATCH v4 11/17] xen/arm: ITS: Add GICR register emulation vijay.kilari
2015-07-10 15:10   ` Ian Campbell
2015-07-11 18:25     ` Julien Grall
2015-07-13  9:28       ` Ian Campbell
2015-07-13  9:53         ` Ian Campbell
2015-07-13 16:53   ` Stefano Stabellini
2015-07-15 17:32   ` Julien Grall
2015-07-16 14:15     ` Vijay Kilari
2015-07-16 14:41       ` Julien Grall
2015-07-16 14:46         ` Vijay Kilari
2015-07-16 14:58           ` Julien Grall
2015-07-10  7:42 ` [PATCH v4 12/17] xen/arm: ITS: Initialize LPI irq descriptors and route vijay.kilari
2015-07-10 15:30   ` Ian Campbell
2015-07-20 13:07     ` Vijay Kilari
2015-07-20 13:25       ` Julien Grall
2015-07-22 13:31     ` Vijay Kilari
2015-07-22 13:39       ` Julien Grall
2015-07-22 14:17         ` Julien Grall
2015-07-13 17:03   ` Stefano Stabellini
2015-07-13 17:13   ` Stefano Stabellini
2015-07-13 17:36     ` Julien Grall
2015-07-15 18:13   ` Julien Grall
2015-07-16  8:06     ` Julien Grall
2015-07-16  8:37   ` Julien Grall
2015-07-10  7:42 ` [PATCH v4 13/17] xen/arm: ITS: Initialize physical ITS vijay.kilari
2015-07-13 17:06   ` Stefano Stabellini
2015-07-10  7:42 ` [PATCH v4 14/17] xen/arm: ITS: Add domain specific ITS initialization vijay.kilari
2015-07-10 15:41   ` Ian Campbell
2015-07-15 17:41   ` Julien Grall
2015-07-10  7:42 ` [PATCH v4 15/17] xen/arm: ITS: Map ITS translation space vijay.kilari
2015-07-10 15:43   ` Ian Campbell
2015-07-15  9:01   ` Julien Grall
2015-07-10  7:42 ` [PATCH v4 16/17] xen/arm: ITS: Generate ITS node for Dom0 vijay.kilari
2015-07-13 16:32   ` Stefano Stabellini
2015-07-13 17:31     ` Julien Grall
2015-07-13 17:36       ` Stefano Stabellini
2015-07-10  7:42 ` [PATCH v4 17/17] xen/arm: ITS: Add pci devices in ThunderX vijay.kilari
2015-07-10 15:45   ` Ian Campbell

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=55A7CBF2.1030304@arm.com \
    --to=marc.zyngier@arm.com \
    --cc=Prasun.Kapoor@caviumnetworks.com \
    --cc=ian.campbell@citrix.com \
    --cc=julien.grall@citrix.com \
    --cc=manish.jaggi@caviumnetworks.com \
    --cc=stefano.stabellini@citrix.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=tim@xen.org \
    --cc=vijay.kilari@gmail.com \
    --cc=vijaya.kumar@caviumnetworks.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).