All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: "Tian, Kevin" <kevin.tian@intel.com>
Cc: Robin Murphy <robin.murphy@arm.com>,
	Nicolin Chen <nicolinc@nvidia.com>,
	"joro@8bytes.org" <joro@8bytes.org>,
	"will@kernel.org" <will@kernel.org>,
	"agross@kernel.org" <agross@kernel.org>,
	"andersson@kernel.org" <andersson@kernel.org>,
	"konrad.dybcio@linaro.org" <konrad.dybcio@linaro.org>,
	"yong.wu@mediatek.com" <yong.wu@mediatek.com>,
	"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>,
	"thierry.reding@gmail.com" <thierry.reding@gmail.com>,
	"alex.williamson@redhat.com" <alex.williamson@redhat.com>,
	"cohuck@redhat.com" <cohuck@redhat.com>,
	"vdumpa@nvidia.com" <vdumpa@nvidia.com>,
	"jonathanh@nvidia.com" <jonathanh@nvidia.com>,
	"iommu@lists.linux.dev" <iommu@lists.linux.dev>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-arm-msm@vger.kernel.org" <linux-arm-msm@vger.kernel.org>,
	"linux-mediatek@lists.infradead.org" 
	<linux-mediatek@lists.infradead.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>
Subject: Re: [PATCH 1/4] iommu: Add a broken_unmanaged_domain flag in iommu_ops
Date: Wed, 1 Feb 2023 10:55:54 -0400	[thread overview]
Message-ID: <Y9p9ehPsg9Hdn1OK@nvidia.com> (raw)
In-Reply-To: <BN9PR11MB52769E3A3DD09983C11677F88CD19@BN9PR11MB5276.namprd11.prod.outlook.com>

On Wed, Feb 01, 2023 at 03:14:03AM +0000, Tian, Kevin wrote:
> > From: Jason Gunthorpe <jgg@nvidia.com>
> > Sent: Monday, January 30, 2023 9:33 PM
> > 
> > On Sun, Jan 29, 2023 at 08:11:48AM +0000, Tian, Kevin wrote:
> > 
> > > " I'd also question sprd-iommu, which hardly has a generally-useful
> > > domain size, and has only just recently gained the ability to unmap
> > > anything successfully."
> > 
> > So long as it has a correct kernel API and exposes the right (small)
> > aperture then it is OK.
> > 
> > The device will not be useful for qemu, but it would run some dpdk
> > configurations just fine.
> 
> I still didn't get the restriction here. Can you elaborate why it works
> with dpdk but not qemu?

dpdk needs like, say, 64M of aperture and doesn't care what the IOVAs
are

qemu needs the entire guest memory of aperture and must have IOVAs
that are 1:1 with the GPA.

So aperture size and location can exclude qemu

> Can qemu verify this restriction via existing path or need new uAPI
> flag to communicate?

It already happens, the aperture/etc is convayed to qemu through
IOMMUFD_CMD_IOAS_IOVA_RANGES and if qemu cannot get the IOVA's it
needs to create the guest it should fail.

Jason

WARNING: multiple messages have this Message-ID (diff)
From: Jason Gunthorpe <jgg@nvidia.com>
To: "Tian, Kevin" <kevin.tian@intel.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"iommu@lists.linux.dev" <iommu@lists.linux.dev>,
	"will@kernel.org" <will@kernel.org>,
	"joro@8bytes.org" <joro@8bytes.org>,
	"cohuck@redhat.com" <cohuck@redhat.com>,
	"linux-mediatek@lists.infradead.org"
	<linux-mediatek@lists.infradead.org>,
	"jonathanh@nvidia.com" <jonathanh@nvidia.com>,
	"konrad.dybcio@linaro.org" <konrad.dybcio@linaro.org>,
	"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>,
	"alex.williamson@redhat.com" <alex.williamson@redhat.com>,
	"agross@kernel.org" <agross@kernel.org>,
	Nicolin Chen <nicolinc@nvidia.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-arm-msm@vger.kernel.org" <linux-arm-msm@vger.kernel.org>,
	"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>,
	"thierry.reding@gmail.com" <thierry.reding@gmail.com>,
	Robin Murphy <robin.murphy@arm.com>,
	"andersson@kernel.org" <andersson@kernel.org>,
	"yong.wu@mediatek.com" <yong.wu@mediatek.com>
Subject: Re: [PATCH 1/4] iommu: Add a broken_unmanaged_domain flag in iommu_ops
Date: Wed, 1 Feb 2023 10:55:54 -0400	[thread overview]
Message-ID: <Y9p9ehPsg9Hdn1OK@nvidia.com> (raw)
In-Reply-To: <BN9PR11MB52769E3A3DD09983C11677F88CD19@BN9PR11MB5276.namprd11.prod.outlook.com>

On Wed, Feb 01, 2023 at 03:14:03AM +0000, Tian, Kevin wrote:
> > From: Jason Gunthorpe <jgg@nvidia.com>
> > Sent: Monday, January 30, 2023 9:33 PM
> > 
> > On Sun, Jan 29, 2023 at 08:11:48AM +0000, Tian, Kevin wrote:
> > 
> > > " I'd also question sprd-iommu, which hardly has a generally-useful
> > > domain size, and has only just recently gained the ability to unmap
> > > anything successfully."
> > 
> > So long as it has a correct kernel API and exposes the right (small)
> > aperture then it is OK.
> > 
> > The device will not be useful for qemu, but it would run some dpdk
> > configurations just fine.
> 
> I still didn't get the restriction here. Can you elaborate why it works
> with dpdk but not qemu?

dpdk needs like, say, 64M of aperture and doesn't care what the IOVAs
are

qemu needs the entire guest memory of aperture and must have IOVAs
that are 1:1 with the GPA.

So aperture size and location can exclude qemu

> Can qemu verify this restriction via existing path or need new uAPI
> flag to communicate?

It already happens, the aperture/etc is convayed to qemu through
IOMMUFD_CMD_IOAS_IOVA_RANGES and if qemu cannot get the IOVA's it
needs to create the guest it should fail.

Jason

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2023-02-01 14:56 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-27 20:04 [PATCH 0/4] iommu: Reject drivers with broken_unmanaged_domain Nicolin Chen
2023-01-27 20:04 ` Nicolin Chen
2023-01-27 20:04 ` [PATCH 1/4] iommu: Add a broken_unmanaged_domain flag in iommu_ops Nicolin Chen
2023-01-27 20:04   ` Nicolin Chen
2023-01-27 21:58   ` Robin Murphy
2023-01-27 21:58     ` Robin Murphy
2023-01-27 23:39     ` Nicolin Chen
2023-01-27 23:39       ` Nicolin Chen
2023-01-27 23:54     ` Jason Gunthorpe
2023-01-27 23:54       ` Jason Gunthorpe
2023-01-29  8:11       ` Tian, Kevin
2023-01-29  8:11         ` Tian, Kevin
2023-01-30 13:33         ` Jason Gunthorpe
2023-01-30 13:33           ` Jason Gunthorpe
2023-02-01  3:14           ` Tian, Kevin
2023-02-01  3:14             ` Tian, Kevin
2023-02-01 14:55             ` Jason Gunthorpe [this message]
2023-02-01 14:55               ` Jason Gunthorpe
2023-02-02  3:50               ` Tian, Kevin
2023-02-02  3:50                 ` Tian, Kevin
2023-01-29  7:54   ` Tian, Kevin
2023-01-29  7:54     ` Tian, Kevin
2023-01-27 20:04 ` [PATCH 2/4] iommu/dma: Do not init domain if broken_unmanaged_domain Nicolin Chen
2023-01-27 20:04   ` Nicolin Chen
2023-01-27 21:59   ` Robin Murphy
2023-01-27 21:59     ` Robin Murphy
2023-01-27 22:51     ` Nicolin Chen
2023-01-27 22:51       ` Nicolin Chen
2023-01-27 20:04 ` [PATCH 3/4] iommufd: Do not allocate device object " Nicolin Chen
2023-01-27 20:04   ` Nicolin Chen
2023-01-27 20:04 ` [PATCH 4/4] vfio: Do not allocate domain " Nicolin Chen
2023-01-27 20:04   ` Nicolin Chen
2023-01-29  7:46 ` [PATCH 0/4] iommu: Reject drivers with broken_unmanaged_domain Tian, Kevin
2023-01-29  7:46   ` Tian, Kevin

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=Y9p9ehPsg9Hdn1OK@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=agross@kernel.org \
    --cc=alex.williamson@redhat.com \
    --cc=andersson@kernel.org \
    --cc=cohuck@redhat.com \
    --cc=iommu@lists.linux.dev \
    --cc=jonathanh@nvidia.com \
    --cc=joro@8bytes.org \
    --cc=kevin.tian@intel.com \
    --cc=konrad.dybcio@linaro.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=matthias.bgg@gmail.com \
    --cc=nicolinc@nvidia.com \
    --cc=robin.murphy@arm.com \
    --cc=thierry.reding@gmail.com \
    --cc=vdumpa@nvidia.com \
    --cc=will@kernel.org \
    --cc=yong.wu@mediatek.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.