From: Stephen Hemminger <stephen@networkplumber.org>
To: Maxime Coquelin <maxime.coquelin@redhat.com>
Cc: dev@dpdk.org, stable@dpdk.org, jianfeng.tan@intel.com,
santosh.shukla@caviumnetworks.com, anatoly.burakov@intel.com,
thomas@monjalon.net, peterx@redhat.com
Subject: Re: [dpdk-dev] [PATCH] bus/pci: forbid VA as IOVA mode if IOMMU address width too small
Date: Mon, 8 Jan 2018 07:34:11 -0800 [thread overview]
Message-ID: <20180108073411.67f12201@xeon-e3> (raw)
In-Reply-To: <20180108135127.25869-1-maxime.coquelin@redhat.com>
On Mon, 8 Jan 2018 14:51:27 +0100
Maxime Coquelin <maxime.coquelin@redhat.com> wrote:
> Intel VT-d supports different address widths for the IOVAs, from
> 39 bits to 56 bits.
>
> While recent processors support at least 48 bits, VT-d emulation
> currently only supports 39 bits. It makes DMA mapping to fail in this
> case when using VA as IOVA mode, as user-space virtual addresses uses
> up to 47 bits (see kernel's Documentation/x86/x86_64/mm.txt).
>
> This patch parses VT-d CAP register value available in sysfs, and
> forbid VA as IOVA mode if the GAW is 39 bits or unknown.
>
> Fixes: f37dfab21c98 ("drivers/net: enable IOVA mode for Intel PMDs")
>
> Cc: stable@dpdk.org
> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> ---
> Hi,
>
> I'm not super happy with the patch as it does platform specific things in
> generic code, but there are no placeholder for IOMMU/VT-d at the moment.
>
> As this patch is to be backported to v17.11 LTS, it cannot be a big rework.
>
> If you have some suggestion to improve it, please let me know.
>
> The fix is quite urgent, as guest device assignment with vIOMMU is broken in
> mainline & v17.11 LTS.
>
> Advantage of this fix over forbidding VA as IOVA when running in emulation is
> that VT-d emulation will soon support 48 bits, so this is future proof. Also,
> VT-d spec supports 39 bits, so we could have physical CPUs supporting it, even
> if I don't know any.
>
> Thanks,
> Maxime
You are assumming that if IOMMU is present that it is being used (ie VFIO).
What about the case of direct access to PF device via IGB_UIO?
> +static inline bool
> +pci_one_device_iommu_support_va(struct rte_pci_device *dev)
> +{
This is not in fast path, there is no reason it should be inline
next prev parent reply other threads:[~2018-01-08 15:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-08 13:51 Maxime Coquelin
2018-01-08 15:34 ` Stephen Hemminger [this message]
2018-01-08 15:48 ` Maxime Coquelin
2018-01-08 15:38 ` Stephen Hemminger
2018-01-08 15:54 ` Maxime Coquelin
2018-01-08 16:48 ` Maxime Coquelin
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=20180108073411.67f12201@xeon-e3 \
--to=stephen@networkplumber.org \
--cc=anatoly.burakov@intel.com \
--cc=dev@dpdk.org \
--cc=jianfeng.tan@intel.com \
--cc=maxime.coquelin@redhat.com \
--cc=peterx@redhat.com \
--cc=santosh.shukla@caviumnetworks.com \
--cc=stable@dpdk.org \
--cc=thomas@monjalon.net \
/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).