From: Jason Gunthorpe <jgg@nvidia.com>
To: Alex Williamson <alex.williamson@redhat.com>
Cc: Yishai Hadas <yishaih@nvidia.com>,
saeedm@nvidia.com, kvm@vger.kernel.org, netdev@vger.kernel.org,
kuba@kernel.org, kevin.tian@intel.com, joao.m.martins@oracle.com,
leonro@nvidia.com, maorg@nvidia.com, cohuck@redhat.com
Subject: Re: [PATCH V4 vfio 04/10] vfio: Add an IOVA bitmap support
Date: Fri, 26 Aug 2022 09:58:02 -0300 [thread overview]
Message-ID: <YwjDWqNblA2gZRpi@nvidia.com> (raw)
In-Reply-To: <20220825132701.07f9a1c3.alex.williamson@redhat.com>
On Thu, Aug 25, 2022 at 01:27:01PM -0600, Alex Williamson wrote:
> > + /* length of the IOVA range for the whole bitmap */
> > + unsigned long length;
>
> OTOH this could arguably be size_t and iova dma_addr_t. Thanks,
iova, for the purposes of iommu, is always unsigned long:
int (*map)(struct iommu_domain *domain, unsigned long iova,
phys_addr_t paddr, size_t size, int prot, gfp_t gfp);
The use of dma_addr_t is something vfio does, which is sort of
problematic because vfio also assumes that dma_addr_t can safely be
implicitly cast to unsigned long, and on some 32 bit configurations
this is not true.
As this is intended to move to the drives/iommu some day it should
remain aligned to the iommu scheme.
And also make sure there are the proper checks when casting from u64
at the uAPI boundary to unsigned long internally that the user
provided u64 doesn't overflow the unsigned long.
Jason
next prev parent reply other threads:[~2022-08-26 12:58 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-15 15:10 [PATCH V4 vfio 00/10] Add device DMA logging support for mlx5 driver Yishai Hadas
2022-08-15 15:11 ` [PATCH V4 vfio 01/10] net/mlx5: Introduce ifc bits for page tracker Yishai Hadas
2022-08-15 15:11 ` [PATCH V4 vfio 02/10] net/mlx5: Query ADV_VIRTUALIZATION capabilities Yishai Hadas
2022-08-15 15:11 ` [PATCH V4 vfio 03/10] vfio: Introduce DMA logging uAPIs Yishai Hadas
2022-08-15 15:11 ` [PATCH V4 vfio 04/10] vfio: Add an IOVA bitmap support Yishai Hadas
2022-08-25 19:27 ` Alex Williamson
2022-08-25 22:24 ` Joao Martins
2022-08-25 23:15 ` Alex Williamson
2022-08-26 9:37 ` Joao Martins
2022-08-26 12:02 ` Alex Williamson
2022-08-26 12:10 ` Joao Martins
2022-08-26 13:01 ` Jason Gunthorpe
2022-08-26 12:58 ` Jason Gunthorpe [this message]
2022-08-15 15:11 ` [PATCH V4 vfio 05/10] vfio: Introduce the DMA logging feature support Yishai Hadas
2022-08-25 20:49 ` Alex Williamson
2022-08-25 22:26 ` Joao Martins
2022-08-25 22:46 ` Alex Williamson
2022-08-26 12:52 ` Jason Gunthorpe
2022-08-28 13:29 ` Yishai Hadas
2022-08-15 15:11 ` [PATCH V4 vfio 06/10] vfio/mlx5: Init QP based resources for dirty tracking Yishai Hadas
2022-08-15 15:11 ` [PATCH V4 vfio 07/10] vfio/mlx5: Create and destroy page tracker object Yishai Hadas
2022-08-15 15:11 ` [PATCH V4 vfio 08/10] vfio/mlx5: Report dirty pages from tracker Yishai Hadas
2022-08-15 15:11 ` [PATCH V4 vfio 09/10] vfio/mlx5: Manage error scenarios on tracker Yishai Hadas
2022-08-15 15:11 ` [PATCH V4 vfio 10/10] vfio/mlx5: Set the driver DMA logging callbacks Yishai Hadas
2022-08-25 11:13 ` [PATCH V4 vfio 00/10] Add device DMA logging support for mlx5 driver Yishai Hadas
2022-08-25 19:37 ` Alex Williamson
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=YwjDWqNblA2gZRpi@nvidia.com \
--to=jgg@nvidia.com \
--cc=alex.williamson@redhat.com \
--cc=cohuck@redhat.com \
--cc=joao.m.martins@oracle.com \
--cc=kevin.tian@intel.com \
--cc=kuba@kernel.org \
--cc=kvm@vger.kernel.org \
--cc=leonro@nvidia.com \
--cc=maorg@nvidia.com \
--cc=netdev@vger.kernel.org \
--cc=saeedm@nvidia.com \
--cc=yishaih@nvidia.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;
as well as URLs for NNTP newsgroup(s).