From: Nicolin Chen <nicolinc@nvidia.com>
To: Robin Murphy <robin.murphy@arm.com>
Cc: <joro@8bytes.org>, <will@kernel.org>, <nicoleotsuka@gmail.com>,
<thierry.reding@gmail.com>, <vdumpa@nvidia.com>,
<nwatterson@nvidia.com>, <jean-philippe@linaro.org>,
<thunder.leizhen@huawei.com>, <chenxiang66@hisilicon.com>,
<Jonathan.Cameron@huawei.com>, <yuzenghui@huawei.com>,
<linux-kernel@vger.kernel.org>,
<iommu@lists.linux-foundation.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-tegra@vger.kernel.org>, <jgg@nvidia.com>
Subject: Re: [PATCH v3 4/5] iommu/arm-smmu-v3: Add host support for NVIDIA Grace CMDQ-V
Date: Mon, 20 Dec 2021 11:27:14 -0800 [thread overview]
Message-ID: <20211220192714.GA27303@Asurada-Nvidia> (raw)
In-Reply-To: <b05183b4-e08a-77ff-219c-009a4e42a32b@arm.com>
Hi Robin,
Thank you for the reply!
On Mon, Dec 20, 2021 at 06:42:26PM +0000, Robin Murphy wrote:
> On 2021-11-19 07:19, Nicolin Chen wrote:
> > From: Nate Watterson <nwatterson@nvidia.com>
> >
> > NVIDIA's Grace Soc has a CMDQ-Virtualization (CMDQV) hardware,
> > which extends the standard ARM SMMU v3 IP to support multiple
> > VCMDQs with virtualization capabilities. In-kernel of host OS,
> > they're used to reduce contention on a single queue. In terms
> > of command queue, they are very like the standard CMDQ/ECMDQs,
> > but only support CS_NONE in the CS field of CMD_SYNC command.
> >
> > This patch adds a new nvidia-grace-cmdqv file and inserts its
> > structure pointer into the existing arm_smmu_device, and then
> > adds related function calls in the arm-smmu-v3 driver.
> >
> > In the CMDQV driver itself, this patch only adds minimal part
> > for host kernel support. Upon probe(), VINTF0 is reserved for
> > in-kernel use. And some of the VCMDQs are assigned to VINTF0.
> > Then the driver will select one of VCMDQs in the VINTF0 based
> > on the CPU currently executing, to issue commands.
>
> Is there a tangible difference to DMA API or VFIO performance?
Our testing environment is currently running on a single-core
CPU, so unfortunately we don't have a perf data at this point.
> [...]
> > +struct arm_smmu_cmdq *nvidia_grace_cmdqv_get_cmdq(struct arm_smmu_device *smmu)
> > +{
> > + struct nvidia_grace_cmdqv *cmdqv = smmu->nvidia_grace_cmdqv;
> > + struct nvidia_grace_cmdqv_vintf *vintf0 = &cmdqv->vintf0;
> > + u16 qidx;
> > +
> > + /* Check error status of vintf0 */
> > + if (!FIELD_GET(VINTF_STATUS, vintf0->status))
> > + return &smmu->cmdq;
> > +
> > + /*
> > + * Select a vcmdq to use. Here we use a temporal solution to
> > + * balance out traffic on cmdq issuing: each cmdq has its own
> > + * lock, if all cpus issue cmdlist using the same cmdq, only
> > + * one CPU at a time can enter the process, while the others
> > + * will be spinning at the same lock.
> > + */
> > + qidx = smp_processor_id() % cmdqv->num_vcmdqs_per_vintf;
>
> How does ordering work between queues? Do they follow a global order
> such that a sync on any queue is guaranteed to complete all prior
> commands on all queues?
CMDQV internal scheduler would insert a SYNC when (for example)
switching from VCMDQ0 to VCMDQ1 while last command in VCMDQ0 is
not SYNC. HW has a configuration bit in the register to disable
this feature, which is by default enabled.
> The challenge to make ECMDQ useful to Linux is how to make sure that all
> the commands expected to be within scope of a future CMND_SYNC plus that
> sync itself all get issued on the same queue, so I'd be mildly surprised
> if you didn't have the same problem.
PATCH-3 in this series actually helps align the command queues,
between issued commands and SYNC, if bool sync == true. Yet, if
doing something like issue->issue->issue_with_sync, it could be
tricker.
Thanks
Nic
next prev parent reply other threads:[~2021-12-20 19:27 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-19 7:19 [PATCH v3 0/5] iommu/arm-smmu-v3: Add NVIDIA Grace CMDQ-V Support Nicolin Chen
2021-11-19 7:19 ` [PATCH v3 1/5] iommu/arm-smmu-v3: Add CS_NONE quirk Nicolin Chen
2021-11-19 7:19 ` [PATCH v3 2/5] iommu/arm-smmu-v3: Make arm_smmu_cmdq_init reusable Nicolin Chen
2021-11-19 7:19 ` [PATCH v3 3/5] iommu/arm-smmu-v3: Pass cmdq pointer in arm_smmu_cmdq_issue_cmdlist() Nicolin Chen
2021-11-19 7:19 ` [PATCH v3 4/5] iommu/arm-smmu-v3: Add host support for NVIDIA Grace CMDQ-V Nicolin Chen
2021-12-20 18:42 ` Robin Murphy
2021-12-20 19:27 ` Nicolin Chen [this message]
2021-12-21 18:55 ` Robin Murphy
2021-12-21 22:00 ` Nicolin Chen
2021-12-22 11:57 ` Robin Murphy
2021-11-19 7:19 ` [PATCH v3 5/5] iommu/nvidia-grace-cmdqv: Limit CMDs for guest owned VINTF Nicolin Chen
2021-12-22 12:32 ` Robin Murphy
2021-12-22 22:52 ` Nicolin Chen
2021-12-23 11:14 ` Robin Murphy
2021-12-24 8:02 ` Nicolin Chen
2021-12-24 12:13 ` Robin Murphy
2021-12-28 5:49 ` Nicolin Chen
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=20211220192714.GA27303@Asurada-Nvidia \
--to=nicolinc@nvidia.com \
--cc=Jonathan.Cameron@huawei.com \
--cc=chenxiang66@hisilicon.com \
--cc=iommu@lists.linux-foundation.org \
--cc=jean-philippe@linaro.org \
--cc=jgg@nvidia.com \
--cc=joro@8bytes.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=nicoleotsuka@gmail.com \
--cc=nwatterson@nvidia.com \
--cc=robin.murphy@arm.com \
--cc=thierry.reding@gmail.com \
--cc=thunder.leizhen@huawei.com \
--cc=vdumpa@nvidia.com \
--cc=will@kernel.org \
--cc=yuzenghui@huawei.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