All of lore.kernel.org
 help / color / mirror / Atom feed
From: Varun Sethi <Varun.Sethi@freescale.com>
To: Will Deacon <will.deacon@arm.com>,
	Stuart Yoder <stuart.yoder@freescale.com>
Cc: "Minghuan.Lian@freescale.com" <Minghuan.Lian@freescale.com>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
	Arnd Bergmann <arnd@arndb.de>,
	"Mingkai.Hu@freescale.com" <Mingkai.Hu@freescale.com>,
	"Roy Zang" <tie-fei.zang@freescale.com>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Scott Wood <scottwood@freescale.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: RE: [PATCH 1/2] irqchip/gicv3-its: Support share device ID
Date: Wed, 22 Apr 2015 18:40:33 +0000	[thread overview]
Message-ID: <BN3PR0301MB121901C218955F709AE892F3EAEE0@BN3PR0301MB1219.namprd03.prod.outlook.com> (raw)
In-Reply-To: <20150422170718.GG13019@arm.com>

Hi Will,

> -----Original Message-----
> From: Will Deacon [mailto:will.deacon@arm.com]
> Sent: Wednesday, April 22, 2015 10:37 PM
> To: Yoder Stuart-B08248
> Cc: Sethi Varun-B16395; Lian Minghuan-B31939; linux-pci@vger.kernel.org;
> Arnd Bergmann; Hu Mingkai-B21284; Zang Roy-R61911; Bjorn Helgaas; Wood
> Scott-B07421; linux-arm-kernel@lists.infradead.org
> Subject: Re: [PATCH 1/2] irqchip/gicv3-its: Support share device ID
> 
> Hi Stuart,
> 
> First of, thanks for taking the time to explain this in more detail.
> Comments inline.
> 
> On Fri, Apr 17, 2015 at 03:19:08PM +0100, Stuart Yoder wrote:
> > > On Wed, Apr 15, 2015 at 02:18:13PM +0100, Varun Sethi wrote:
> > > > Yes, deviceid=stream id (i.e. ICID + other bits). I am not sure if
> > > > TBU ID would also be forwarded as a part of stream id to GIC. My
> > > > understanding is that TBU ID is forwarded (as a part of the stream
> > > > ID) to the TCU in case of a TBU translation miss. In case of the
> > > > LS2085 PCIe controller you would have to setup the PCIe device ID
> > > > to stream ID translation table. We may have to restrict the number
> > > > of entries based on the available number of contexts.
> > >
> > > Unfortunately, I'm having a really hard time parsing this thread
> > > (some parts of it simply don't make sense; others use
> > > non-architectural terms and overall I don't get a feeling for the problem).
> > >
> > > Please could you explain your system design step by step so that I
> > > can understand (a) what you've built and (b) why the current design
> > > of Linux is causing you problems?
> > >
> > > Sorry if I'm just being thick, but it's important that we get this right.
> >
> > I'll try to summarize some key points about the system...
> >
> > System is using a single SMMU-500 (1 TCU, 6 TBUs) and GICv3-ITS.
> > There are PCI, fsl-mc, and platform devices that do DMA.  Devices on
> > the PCI and fsl-mc bus generate message interrupts.
> 
> Ah cool, so you have multiple buses sharing a single SMMU? That's going to
> necessitate some ID remapping in the device-tree. Perhaps you could
> comment on Mark Rutland's proposal if it does/doesn't work for you:
> 
>   http://lists.infradead.org/pipermail/linux-arm-kernel/2015-
> March/333199.html
> 
> 
> > The flow a message interrupt would take is this:
> >
> >     --------------
> >       PCI device
> >     --------------
> >           |
> >           | pcidevid + MSI msg
> >           |
> >           V
> >     --------------
> >     PCI controller
> >       pcidevid ->
> >       streamID
> >       mapping
> >     --------------
> >           |
> >           | streamID + MSI msg
> >           |
> >           V
> >     --------------
> >         SMMU
> >     --------------
> >           |
> >           | streamID + MSI msg
> >           |
> >           V
> >     --------------
> >        CCN-504 (Dickens)
> >     --------------
> >           |
> >           | streamID + MSI msg
> >           |
> >           V
> 
> The streamID here as the same as the one coming out of the SMMU, right?
> (just trying to out why you have the CCN-504 in the picture).
> 
> >     --------------
> >       GICv3 ITS    streamID == ITS deviceID
> >     --------------
> >
> > So, the way things work (at least initially) is that each PCI device
> > maps to a single streamID, and thus each device has a separate ITT in
> > the ITS.  So, things should be cool.
> >
> > However, there is an improvement we envision as possible due to the
> > limited number of SMMU contexts (i.e. 64).  If there are
> > 64 SMMU context registers it means that there is a max of
> > 64 software contexts where things can be isolated.  But, say I have an
> > SRIOV card with 64 VFs, and I want to assign 8 of the VFs to a KVM VM.
> > Those 8 PCI devices could share the same streamID/ITS-device-ID since
> > they all share the same isolation context.
> >
> > What would be nice is at the time the 8 VFS are being added to the
> > IOMMU domain is for the pcidevid -> streamID mapping table to be
> > updated dynamically.  It simply lets us make more efficient use of the
> > limited streamIDs we have.
> >
> > I think it is this improvement that Minghuan had in mind in this
> > patch.
> 
> Ok, but in this case it should be possible to use a single context bank for all of
> the VF streamIDs by configuring the appropriate SMR, no? Wouldn't that sort
> of thing be preferable to dynamic StreamID assignment? It would certainly
> make life easier for the MSIs.
> 
Yes, that would happen when the all the VFs are attached to the same domain. But it would be an issue if we have to attach devices to different domains.

-Varun

WARNING: multiple messages have this Message-ID (diff)
From: Varun.Sethi@freescale.com (Varun Sethi)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] irqchip/gicv3-its: Support share device ID
Date: Wed, 22 Apr 2015 18:40:33 +0000	[thread overview]
Message-ID: <BN3PR0301MB121901C218955F709AE892F3EAEE0@BN3PR0301MB1219.namprd03.prod.outlook.com> (raw)
In-Reply-To: <20150422170718.GG13019@arm.com>

Hi Will,

> -----Original Message-----
> From: Will Deacon [mailto:will.deacon at arm.com]
> Sent: Wednesday, April 22, 2015 10:37 PM
> To: Yoder Stuart-B08248
> Cc: Sethi Varun-B16395; Lian Minghuan-B31939; linux-pci at vger.kernel.org;
> Arnd Bergmann; Hu Mingkai-B21284; Zang Roy-R61911; Bjorn Helgaas; Wood
> Scott-B07421; linux-arm-kernel at lists.infradead.org
> Subject: Re: [PATCH 1/2] irqchip/gicv3-its: Support share device ID
> 
> Hi Stuart,
> 
> First of, thanks for taking the time to explain this in more detail.
> Comments inline.
> 
> On Fri, Apr 17, 2015 at 03:19:08PM +0100, Stuart Yoder wrote:
> > > On Wed, Apr 15, 2015 at 02:18:13PM +0100, Varun Sethi wrote:
> > > > Yes, deviceid=stream id (i.e. ICID + other bits). I am not sure if
> > > > TBU ID would also be forwarded as a part of stream id to GIC. My
> > > > understanding is that TBU ID is forwarded (as a part of the stream
> > > > ID) to the TCU in case of a TBU translation miss. In case of the
> > > > LS2085 PCIe controller you would have to setup the PCIe device ID
> > > > to stream ID translation table. We may have to restrict the number
> > > > of entries based on the available number of contexts.
> > >
> > > Unfortunately, I'm having a really hard time parsing this thread
> > > (some parts of it simply don't make sense; others use
> > > non-architectural terms and overall I don't get a feeling for the problem).
> > >
> > > Please could you explain your system design step by step so that I
> > > can understand (a) what you've built and (b) why the current design
> > > of Linux is causing you problems?
> > >
> > > Sorry if I'm just being thick, but it's important that we get this right.
> >
> > I'll try to summarize some key points about the system...
> >
> > System is using a single SMMU-500 (1 TCU, 6 TBUs) and GICv3-ITS.
> > There are PCI, fsl-mc, and platform devices that do DMA.  Devices on
> > the PCI and fsl-mc bus generate message interrupts.
> 
> Ah cool, so you have multiple buses sharing a single SMMU? That's going to
> necessitate some ID remapping in the device-tree. Perhaps you could
> comment on Mark Rutland's proposal if it does/doesn't work for you:
> 
>   http://lists.infradead.org/pipermail/linux-arm-kernel/2015-
> March/333199.html
> 
> 
> > The flow a message interrupt would take is this:
> >
> >     --------------
> >       PCI device
> >     --------------
> >           |
> >           | pcidevid + MSI msg
> >           |
> >           V
> >     --------------
> >     PCI controller
> >       pcidevid ->
> >       streamID
> >       mapping
> >     --------------
> >           |
> >           | streamID + MSI msg
> >           |
> >           V
> >     --------------
> >         SMMU
> >     --------------
> >           |
> >           | streamID + MSI msg
> >           |
> >           V
> >     --------------
> >        CCN-504 (Dickens)
> >     --------------
> >           |
> >           | streamID + MSI msg
> >           |
> >           V
> 
> The streamID here as the same as the one coming out of the SMMU, right?
> (just trying to out why you have the CCN-504 in the picture).
> 
> >     --------------
> >       GICv3 ITS    streamID == ITS deviceID
> >     --------------
> >
> > So, the way things work (at least initially) is that each PCI device
> > maps to a single streamID, and thus each device has a separate ITT in
> > the ITS.  So, things should be cool.
> >
> > However, there is an improvement we envision as possible due to the
> > limited number of SMMU contexts (i.e. 64).  If there are
> > 64 SMMU context registers it means that there is a max of
> > 64 software contexts where things can be isolated.  But, say I have an
> > SRIOV card with 64 VFs, and I want to assign 8 of the VFs to a KVM VM.
> > Those 8 PCI devices could share the same streamID/ITS-device-ID since
> > they all share the same isolation context.
> >
> > What would be nice is at the time the 8 VFS are being added to the
> > IOMMU domain is for the pcidevid -> streamID mapping table to be
> > updated dynamically.  It simply lets us make more efficient use of the
> > limited streamIDs we have.
> >
> > I think it is this improvement that Minghuan had in mind in this
> > patch.
> 
> Ok, but in this case it should be possible to use a single context bank for all of
> the VF streamIDs by configuring the appropriate SMR, no? Wouldn't that sort
> of thing be preferable to dynamic StreamID assignment? It would certainly
> make life easier for the MSIs.
> 
Yes, that would happen when the all the VFs are attached to the same domain. But it would be an issue if we have to attach devices to different domains.

-Varun

  reply	other threads:[~2015-04-22 18:40 UTC|newest]

Thread overview: 74+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-15  9:49 [PATCH] irqchip/gicv3-its: Decrease page size when needed Minghuan Lian
2015-04-15  9:49 ` Minghuan Lian
2015-04-15  9:49 ` [PATCH 1/2] irqchip/gicv3-its: Support share device ID Minghuan Lian
2015-04-15  9:49   ` Minghuan Lian
2015-04-15 11:08   ` Varun Sethi
2015-04-15 11:08     ` Varun Sethi
2015-04-15 11:38     ` Minghuan.Lian
2015-04-15 11:38       ` Minghuan.Lian at freescale.com
2015-04-15 13:18       ` Varun Sethi
2015-04-15 13:18         ` Varun Sethi
2015-04-16 10:40         ` Will Deacon
2015-04-16 10:40           ` Will Deacon
2015-04-17 14:19           ` Stuart Yoder
2015-04-17 14:19             ` Stuart Yoder
2015-04-17 17:57             ` Varun Sethi
2015-04-17 17:57               ` Varun Sethi
2015-04-22 17:07             ` Will Deacon
2015-04-22 17:07               ` Will Deacon
2015-04-22 18:40               ` Varun Sethi [this message]
2015-04-22 18:40                 ` Varun Sethi
2015-04-22 19:41               ` Stuart Yoder
2015-04-22 19:41                 ` Stuart Yoder
2015-04-24 16:18                 ` Will Deacon
2015-04-24 16:18                   ` Will Deacon
2015-04-24 16:44                   ` Marc Zyngier
2015-04-24 16:44                     ` Marc Zyngier
2015-04-24 18:18                     ` Stuart Yoder
2015-04-24 18:18                       ` Stuart Yoder
2015-04-25 10:39                       ` Marc Zyngier
2015-04-25 10:39                         ` Marc Zyngier
2015-04-26 18:20                         ` Varun Sethi
2015-04-26 18:20                           ` Varun Sethi
2015-04-27  7:58                           ` Marc Zyngier
2015-04-27  7:58                             ` Marc Zyngier
2015-04-27 13:08                             ` Varun Sethi
2015-04-27 13:08                               ` Varun Sethi
2015-04-27 17:04                               ` Will Deacon
2015-04-27 17:04                                 ` Will Deacon
2015-05-01 15:23                                 ` Stuart Yoder
2015-05-01 15:23                                   ` Stuart Yoder
2015-05-01 15:26                                   ` Will Deacon
2015-05-01 15:26                                     ` Will Deacon
2015-04-27 17:17                               ` Marc Zyngier
2015-04-27 17:17                                 ` Marc Zyngier
2015-04-24 19:24                     ` Stuart Yoder
2015-04-24 19:24                       ` Stuart Yoder
2015-04-24 18:09                   ` Stuart Yoder
2015-04-24 18:09                     ` Stuart Yoder
2015-04-26 18:26                 ` Varun Sethi
2015-04-26 18:26                   ` Varun Sethi
2015-04-15 16:36   ` Marc Zyngier
2015-04-15 16:36     ` Marc Zyngier
2015-04-16  2:57     ` Minghuan.Lian
2015-04-16  2:57       ` Minghuan.Lian at freescale.com
2015-04-16 10:04       ` Marc Zyngier
2015-04-16 10:04         ` Marc Zyngier
2015-04-16 10:57         ` Minghuan.Lian
2015-04-16 10:57           ` Minghuan.Lian at freescale.com
2015-04-16 11:50           ` Marc Zyngier
2015-04-16 11:50             ` Marc Zyngier
2015-04-16 18:38             ` Varun Sethi
2015-04-16 18:38               ` Varun Sethi
2015-04-17  2:34               ` Minghuan.Lian
2015-04-17  2:34                 ` Minghuan.Lian at freescale.com
2015-04-15  9:49 ` [PATCH 2/2] pci/layerscape: Add LS2085A MSI support Minghuan Lian
2015-04-15  9:49   ` Minghuan Lian
2015-04-15 11:51 ` [PATCH] irqchip/gicv3-its: Decrease page size when needed Jason Cooper
2015-04-15 11:51   ` Jason Cooper
2015-04-15 14:17   ` Marc Zyngier
2015-04-15 14:17     ` Marc Zyngier
2015-04-16  1:15     ` Minghuan.Lian
2015-04-16  1:15       ` Minghuan.Lian at freescale.com
2015-04-15 16:31 ` Marc Zyngier
2015-04-15 16:31   ` Marc Zyngier

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=BN3PR0301MB121901C218955F709AE892F3EAEE0@BN3PR0301MB1219.namprd03.prod.outlook.com \
    --to=varun.sethi@freescale.com \
    --cc=Minghuan.Lian@freescale.com \
    --cc=Mingkai.Hu@freescale.com \
    --cc=arnd@arndb.de \
    --cc=bhelgaas@google.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=scottwood@freescale.com \
    --cc=stuart.yoder@freescale.com \
    --cc=tie-fei.zang@freescale.com \
    --cc=will.deacon@arm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.