All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Campbell <ian.campbell@citrix.com>
To: Julien Grall <julien.grall@linaro.org>
Cc: Andreas Herrmann <andreas.herrmann@calxeda.com>,
	xen-devel@lists.xenproject.org,
	Andreas Herrmann <herrmann.der.user@googlemail.com>,
	stefano.stabellini@citrix.com, tim@xen.org
Subject: Re: [PATCH v3 11/13] xen/iommu: smmu: Introduce automatic stream-id-masking
Date: Mon, 23 Feb 2015 10:42:35 +0000	[thread overview]
Message-ID: <1424688155.27930.23.camel@citrix.com> (raw)
In-Reply-To: <54E74DB0.6000007@linaro.org>

On Fri, 2015-02-20 at 15:07 +0000, Julien Grall wrote:
> On 20/02/15 13:55, Ian Campbell wrote:
> > On Fri, 2015-02-20 at 13:42 +0000, Julien Grall wrote:
> >>>>     - Use num_s2crs rather than num_streamids in the arm_smmu_free_smrs.
> >>>>     This former is the field used to configure SRMS
> >>>>
> >>>> Cc: Andreas Herrmann <herrmann.der.user@googlemail.com>
> >>>> Signed-off-by: Andreas Herrmann <andreas.herrmann@calxeda.com>
> >>>> Signed-off-by: Julien Grall <julien.grall@linaro.org>
> >>>>
> >>>> ---
> >>>>
> >>>>     This patch was sent on Linux ML back to January 2014. It has never
> >>>>     been pushed upstream as it was only useful for Calxeda.
> >>>
> >>> I know that until know Calxeda has been our only platform with an SMMU,
> >>> but that is no longer the case, so I'm not really convinced we want to
> >>> carry divergence from the upstream driver just for the benefit of this
> >>> effectively obsolete platform.
> >>
> >> Nothing prevent a platform to use more streamids than the number the
> >> number of stream matching registers.
> >>
> >> It appears that Calxeda is only one for now. But it may change later...
> >>
> >> About diverging, Linux is moving fast on the SMMU drivers and rework
> >> often. We will diverge quickly from the code. Actually 3.20 reworked
> >> heavily the driver, but I don't plan to resync the code again for Xen
> >> 4.6 (I would loose at least 2 weeks for it).
> >>
> >> As Calxeda is the only platform we have which support SMMU for now. I'm
> >> doing all my work on it, so this patch is useful for me.
> > 
> > I appreciate that, but does that mean we need to take code for an
> > already obsolete platform into mainline Xen when there are at least 2
> > platforms very close on the horizon which will eventually fill this
> > niche just as well?
> 
> I agree that we will have ARM64 board with SMMU very soon. But this is
> the only ARM32 box the SMMU we have on OSStest.
> 
> Even though the platform is deprecated, it would be nice if we can catch
> ARM32 SMMU regression.
> 
> 
> On a side note, we consider this platform deprecated we should either
> drop the code from Xen or write on the wiki that we don't fully support
> it anymore.

It's all about degrees, I think we are fine to support the existing
feature set and commit to keeping that working, but I'm not sure we
should be enabling new features for the platform, in particular when the
patches in question cause us to have to diverge from the upstream for a
particular driver.


> 
> >>>>     The SMMU used to protect the SATA on this platform has more stream
> >>>>     id than the number of stream matching registers. Therefore we have
> >>>>     to use stream id masking to configure correctly all the stream IDs.
> >>>
> >>> What controls which stream IDs are used by the SATA h/w when issuing
> >>> requests? Can we constrain it somehow (ideally by omitting them from the
> >>> DT) to only use a subset of the stream IDs, such that the number used is
> >>> less than the number of matching registers?
> >>
> >> The StreamIDs is controlled by the device. It identifies a stream of
> >> transactions which originate from a device.
> > 
> > I understand that.
> > 
> > What I mean is, if an SMMU has e.g. 4 stream ids (0x1, 0x2, 0x3, 0x4)
> > and protects e.g. a single SATA device, what determines which stream id
> > a given DMA originating from that SATA device uses?
> >
> > i.e. is it one of:
> >      1. The SATA device uses a single hardcoded (in silicon) stream ID,
> >         the other three are unused,redundant.
> >      2. The SATA device can only use a single stream ID which is
> >         configured somehow by software (either firmware or OS driver).
> >      3. The SATA device can use multiple hardcoded stream IDs and a
> >         given DMA uses one of them based up $ALGORITHMN.
> >      4. The SATA device can use multiple stream IDs as configured by the
> >         OS driver.
> >      5. Something else...
> 
> There is a unique ID per-stream. Having multiple streamIDs means
> multiple DMA request can generated at the same time.
> 
> The StreamID is decided between the SMMU and the device. We can't
> interfere and say use only those streamIDs.

OK I didn't realise there could be a stream per DMA request (as opposed
to one stream per device etc).

> The only things that a guest can do is associating a specific streamIDs
> to a context in the SMMU.

Ack.

  reply	other threads:[~2015-02-23 10:42 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-30 18:49 [PATCH v3 00/13] xen/arm: Resync the SMMU driver with the Linux one Julien Grall
2015-01-30 18:49 ` [PATCH v3 01/13] xen/arm: gic-v2: Change the device name in DT_DEVICE_START Julien Grall
2015-02-20 12:16   ` Ian Campbell
2015-01-30 18:49 ` [PATCH v3 02/13] xen/arm: vgic: Drop unecessary include asm/device.h Julien Grall
2015-02-20 12:16   ` Ian Campbell
2015-01-30 18:49 ` [PATCH v3 03/13] xen/dt: Extend dt_device_match to possibly store data Julien Grall
2015-02-06 12:37   ` Stefano Stabellini
2015-02-20 12:16     ` Ian Campbell
2015-01-30 18:49 ` [PATCH v3 04/13] xen/arm: device: Rename device_type into device_class Julien Grall
2015-02-06 12:38   ` Stefano Stabellini
2015-02-20 12:17     ` Ian Campbell
2015-01-30 18:49 ` [PATCH v3 05/13] xen/iommu: arm: Remove temporary the SMMU driver Julien Grall
2015-02-20 12:18   ` Ian Campbell
2015-02-20 12:53     ` Julien Grall
2015-02-20 13:47       ` Ian Campbell
2015-02-20 13:53         ` Julien Grall
2015-02-20 14:06           ` Ian Campbell
2015-02-20 14:07             ` Julien Grall
2015-01-30 18:49 ` [PATCH v3 06/13] xen/arm: Introduce a generic way to describe device Julien Grall
2015-02-02  8:04   ` Jan Beulich
2015-02-06 12:39   ` Stefano Stabellini
2015-02-20 12:22   ` Ian Campbell
2015-02-24 14:26     ` Julien Grall
2015-02-24 14:45       ` Ian Campbell
2015-01-30 18:49 ` [PATCH v3 07/13] xen/iommu: Consolidate device assignment ops into a single set Julien Grall
2015-02-20 12:25   ` Ian Campbell
2015-01-30 18:49 ` [PATCH v3 08/13] xen/arm: Describe device supported by a driver with dt_match_node Julien Grall
2015-02-20 12:30   ` Ian Campbell
2015-02-24 14:42     ` Julien Grall
2015-01-30 18:49 ` [PATCH v3 09/13] xen/iommu: arm: Import the SMMU driver from Linux Julien Grall
2015-02-20 12:31   ` Ian Campbell
2015-02-20 13:33     ` Julien Grall
2015-02-20 13:48       ` Ian Campbell
2015-01-30 18:49 ` [PATCH v3 10/13] xen/iommu: smmu: Check for duplicate stream IDs when registering master devices Julien Grall
2015-02-20 12:35   ` Ian Campbell
2015-02-20 13:34     ` Julien Grall
2015-02-20 13:48       ` Ian Campbell
2015-02-20 14:47       ` Andreas Herrmann
2015-01-30 18:49 ` [PATCH v3 11/13] xen/iommu: smmu: Introduce automatic stream-id-masking Julien Grall
2015-02-20 13:15   ` Ian Campbell
2015-02-20 13:42     ` Julien Grall
2015-02-20 13:55       ` Ian Campbell
2015-02-20 15:07         ` Julien Grall
2015-02-23 10:42           ` Ian Campbell [this message]
2015-02-23 10:52             ` Julien Grall
2015-02-23 12:48               ` Ian Campbell
2015-01-30 18:49 ` [PATCH v3 12/13] xen/iommu: smmu: Add Xen specific code to be able to use the driver Julien Grall
2015-02-02 18:55   ` Manish
2015-02-02 23:01     ` Julien Grall
2015-02-06 13:20   ` Stefano Stabellini
2015-02-09 15:40     ` Julien Grall
2015-02-19 17:17       ` Julien Grall
2015-02-20 13:29       ` Ian Campbell
2015-02-20 14:01         ` Julien Grall
2015-02-20 13:23     ` Ian Campbell
2015-02-20 13:50       ` Julien Grall
2015-01-30 18:49 ` [PATCH v3 13/13] xen/iommu: smmu: Advertise when the SMMU support coherent table walk Julien Grall
2015-02-06 14:06   ` Stefano Stabellini
2015-02-10  1:36     ` Julien Grall
2015-02-10  1:37       ` Julien Grall
2015-02-20 13:34   ` Ian Campbell
2015-02-20 14:07     ` Julien Grall
2015-02-20 14:13       ` Ian Campbell
2015-02-20 14:15         ` Julien Grall
2015-02-20 14:28           ` Ian Campbell
2015-02-20 14:15 ` [PATCH v3 00/13] xen/arm: Resync the SMMU driver with the Linux one Ian Campbell
2015-02-20 14:19   ` Julien Grall
2015-02-20 14:27     ` 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=1424688155.27930.23.camel@citrix.com \
    --to=ian.campbell@citrix.com \
    --cc=andreas.herrmann@calxeda.com \
    --cc=herrmann.der.user@googlemail.com \
    --cc=julien.grall@linaro.org \
    --cc=stefano.stabellini@citrix.com \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xenproject.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 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.