* [PATCH 1/1] iova: Allow compiling the library without IOMMU support
@ 2019-01-02 21:16 Sakari Ailus
[not found] ` <20190102211657.13192-1-sakari.ailus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
0 siblings, 1 reply; 5+ messages in thread
From: Sakari Ailus @ 2019-01-02 21:16 UTC (permalink / raw)
To: Joerg Roedel
Cc: mchehab-DgEjT+Ai2ygdnm+yROfE0A,
iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
hans.verkuil-FYB4Gu1CFyUAvxtiuMwx3w,
laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw,
bingbu.cao-ral2JQCrhuEAvxtiuMwx3w,
rajmohan.mani-ral2JQCrhuEAvxtiuMwx3w,
yong.zhi-ral2JQCrhuEAvxtiuMwx3w,
tian.shu.qiu-ral2JQCrhuEAvxtiuMwx3w,
linux-media-u79uwXL29TY76Z2rM5mHXA
Drivers such as the Intel IPU3 ImgU driver use the IOVA library to manage
the device's own virtual address space while not implementing the IOMMU
API. Currently the IOVA library is only compiled if the IOMMU support is
enabled, resulting into a failure during linking due to missing symbols.
Fix this by defining IOVA library Kconfig bits independently of IOMMU
support configuration, and descending to the iommu directory
unconditionally during the build.
Signed-off-by: Sakari Ailus <sakari.ailus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
---
drivers/Makefile | 2 +-
drivers/iommu/Kconfig | 7 ++++---
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/Makefile b/drivers/Makefile
index 578f469f72fb..d9c469983592 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -56,7 +56,7 @@ obj-y += tty/
obj-y += char/
# iommu/ comes before gpu as gpu are using iommu controllers
-obj-$(CONFIG_IOMMU_SUPPORT) += iommu/
+obj-y += iommu/
# gpu/ comes after char for AGP vs DRM startup and after iommu
obj-y += gpu/
diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig
index d9a25715650e..d2c83e62873d 100644
--- a/drivers/iommu/Kconfig
+++ b/drivers/iommu/Kconfig
@@ -1,3 +1,7 @@
+# The IOVA library may also be used by non-IOMMU_API users
+config IOMMU_IOVA
+ tristate
+
# IOMMU_API always gets selected by whoever wants it.
config IOMMU_API
bool
@@ -81,9 +85,6 @@ config IOMMU_DEFAULT_PASSTHROUGH
If unsure, say N here.
-config IOMMU_IOVA
- tristate
-
config OF_IOMMU
def_bool y
depends on OF && IOMMU_API
--
2.11.0
^ permalink raw reply related [flat|nested] 5+ messages in thread[parent not found: <20190102211657.13192-1-sakari.ailus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>]
* Re: [PATCH 1/1] iova: Allow compiling the library without IOMMU support [not found] ` <20190102211657.13192-1-sakari.ailus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org> @ 2019-01-02 22:52 ` Laurent Pinchart 2019-01-03 20:11 ` Sakari Ailus 2019-01-11 11:27 ` Joerg Roedel 1 sibling, 1 reply; 5+ messages in thread From: Laurent Pinchart @ 2019-01-02 22:52 UTC (permalink / raw) To: Sakari Ailus Cc: mchehab-DgEjT+Ai2ygdnm+yROfE0A, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, hans.verkuil-FYB4Gu1CFyUAvxtiuMwx3w, bingbu.cao-ral2JQCrhuEAvxtiuMwx3w, rajmohan.mani-ral2JQCrhuEAvxtiuMwx3w, yong.zhi-ral2JQCrhuEAvxtiuMwx3w, tian.shu.qiu-ral2JQCrhuEAvxtiuMwx3w, linux-media-u79uwXL29TY76Z2rM5mHXA Hi Sakari, Thank you for the patch. On Wednesday, 2 January 2019 23:16:57 EET Sakari Ailus wrote: > Drivers such as the Intel IPU3 ImgU driver use the IOVA library to manage > the device's own virtual address space while not implementing the IOMMU > API. Why is that ? Could the IPU3 IOMMU be implemented as an IOMMU driver ? > Currently the IOVA library is only compiled if the IOMMU support is > enabled, resulting into a failure during linking due to missing symbols. > > Fix this by defining IOVA library Kconfig bits independently of IOMMU > support configuration, and descending to the iommu directory > unconditionally during the build. > > Signed-off-by: Sakari Ailus <sakari.ailus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org> > --- > drivers/Makefile | 2 +- > drivers/iommu/Kconfig | 7 ++++--- > 2 files changed, 5 insertions(+), 4 deletions(-) > > diff --git a/drivers/Makefile b/drivers/Makefile > index 578f469f72fb..d9c469983592 100644 > --- a/drivers/Makefile > +++ b/drivers/Makefile > @@ -56,7 +56,7 @@ obj-y += tty/ > obj-y += char/ > > # iommu/ comes before gpu as gpu are using iommu controllers > -obj-$(CONFIG_IOMMU_SUPPORT) += iommu/ > +obj-y += iommu/ > > # gpu/ comes after char for AGP vs DRM startup and after iommu > obj-y += gpu/ > diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig > index d9a25715650e..d2c83e62873d 100644 > --- a/drivers/iommu/Kconfig > +++ b/drivers/iommu/Kconfig > @@ -1,3 +1,7 @@ > +# The IOVA library may also be used by non-IOMMU_API users > +config IOMMU_IOVA > + tristate > + > # IOMMU_API always gets selected by whoever wants it. > config IOMMU_API > bool > @@ -81,9 +85,6 @@ config IOMMU_DEFAULT_PASSTHROUGH > > If unsure, say N here. > > -config IOMMU_IOVA > - tristate > - > config OF_IOMMU > def_bool y > depends on OF && IOMMU_API -- Regards, Laurent Pinchart ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] iova: Allow compiling the library without IOMMU support 2019-01-02 22:52 ` Laurent Pinchart @ 2019-01-03 20:11 ` Sakari Ailus [not found] ` <20190103201126.zzqpn2eylm4m2zxn-WV0MzMiPiMJ82hYKe6nXyg@public.gmane.org> 0 siblings, 1 reply; 5+ messages in thread From: Sakari Ailus @ 2019-01-03 20:11 UTC (permalink / raw) To: Laurent Pinchart Cc: mchehab-DgEjT+Ai2ygdnm+yROfE0A, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, hans.verkuil-FYB4Gu1CFyUAvxtiuMwx3w, bingbu.cao-ral2JQCrhuEAvxtiuMwx3w, rajmohan.mani-ral2JQCrhuEAvxtiuMwx3w, yong.zhi-ral2JQCrhuEAvxtiuMwx3w, tian.shu.qiu-ral2JQCrhuEAvxtiuMwx3w, linux-media-u79uwXL29TY76Z2rM5mHXA Hi Laurent, On Thu, Jan 03, 2019 at 12:52:00AM +0200, Laurent Pinchart wrote: > Hi Sakari, > > Thank you for the patch. > > On Wednesday, 2 January 2019 23:16:57 EET Sakari Ailus wrote: > > Drivers such as the Intel IPU3 ImgU driver use the IOVA library to manage > > the device's own virtual address space while not implementing the IOMMU > > API. > > Why is that ? Could the IPU3 IOMMU be implemented as an IOMMU driver ? You could do that, but: - it's a single PCI device so there's no advantage in doing so and - doing that would render the device inoperable if an IOMMU is enabled in the system, as chaining IOMMUs is not supported in the IOMMU framework AFAIK. > > > Currently the IOVA library is only compiled if the IOMMU support is > > enabled, resulting into a failure during linking due to missing symbols. > > > > Fix this by defining IOVA library Kconfig bits independently of IOMMU > > support configuration, and descending to the iommu directory > > unconditionally during the build. > > > > Signed-off-by: Sakari Ailus <sakari.ailus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org> > > --- > > drivers/Makefile | 2 +- > > drivers/iommu/Kconfig | 7 ++++--- > > 2 files changed, 5 insertions(+), 4 deletions(-) > > > > diff --git a/drivers/Makefile b/drivers/Makefile > > index 578f469f72fb..d9c469983592 100644 > > --- a/drivers/Makefile > > +++ b/drivers/Makefile > > @@ -56,7 +56,7 @@ obj-y += tty/ > > obj-y += char/ > > > > # iommu/ comes before gpu as gpu are using iommu controllers > > -obj-$(CONFIG_IOMMU_SUPPORT) += iommu/ > > +obj-y += iommu/ > > > > # gpu/ comes after char for AGP vs DRM startup and after iommu > > obj-y += gpu/ > > diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig > > index d9a25715650e..d2c83e62873d 100644 > > --- a/drivers/iommu/Kconfig > > +++ b/drivers/iommu/Kconfig > > @@ -1,3 +1,7 @@ > > +# The IOVA library may also be used by non-IOMMU_API users > > +config IOMMU_IOVA > > + tristate > > + > > # IOMMU_API always gets selected by whoever wants it. > > config IOMMU_API > > bool > > @@ -81,9 +85,6 @@ config IOMMU_DEFAULT_PASSTHROUGH > > > > If unsure, say N here. > > > > -config IOMMU_IOVA > > - tristate > > - > > config OF_IOMMU > > def_bool y > > depends on OF && IOMMU_API > > > -- > Regards, > > Laurent Pinchart > > > -- Sakari Ailus sakari.ailus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <20190103201126.zzqpn2eylm4m2zxn-WV0MzMiPiMJ82hYKe6nXyg@public.gmane.org>]
* Re: [PATCH 1/1] iova: Allow compiling the library without IOMMU support [not found] ` <20190103201126.zzqpn2eylm4m2zxn-WV0MzMiPiMJ82hYKe6nXyg@public.gmane.org> @ 2019-01-03 21:33 ` Aaron Sierra 0 siblings, 0 replies; 5+ messages in thread From: Aaron Sierra @ 2019-01-03 21:33 UTC (permalink / raw) To: Sakari Ailus, Laurent Pinchart Cc: linux-media-u79uwXL29TY76Z2rM5mHXA, iommu, hans verkuil, rajmohan mani, bingbu cao, mchehab-DgEjT+Ai2ygdnm+yROfE0A, tian shu qiu, yong zhi ----- Original Message ----- > From: "Sakari Ailus" <sakari.ailus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org> > Sent: Thursday, January 3, 2019 2:11:27 PM Hi Laurent and Sakari, I don't have much else to offer here, but wanted to second Sakari's use case below. > Hi Laurent, > > On Thu, Jan 03, 2019 at 12:52:00AM +0200, Laurent Pinchart wrote: >> Hi Sakari, >> >> Thank you for the patch. >> >> On Wednesday, 2 January 2019 23:16:57 EET Sakari Ailus wrote: >> > Drivers such as the Intel IPU3 ImgU driver use the IOVA library to manage >> > the device's own virtual address space while not implementing the IOMMU >> > API. >> >> Why is that ? Could the IPU3 IOMMU be implemented as an IOMMU driver ? > > You could do that, but: > > - it's a single PCI device so there's no advantage in doing so and I also use the IOVA library for a PCI device (PCIe-VME bridge) that has IOMMU features, but isn't a general purpose IOMMU. I am eagerly following along. -Aaron > - doing that would render the device inoperable if an IOMMU is enabled in > the system, as chaining IOMMUs is not supported in the IOMMU framework > AFAIK. > >> >> > Currently the IOVA library is only compiled if the IOMMU support is >> > enabled, resulting into a failure during linking due to missing symbols. >> > >> > Fix this by defining IOVA library Kconfig bits independently of IOMMU >> > support configuration, and descending to the iommu directory >> > unconditionally during the build. >> > >> > Signed-off-by: Sakari Ailus <sakari.ailus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org> ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] iova: Allow compiling the library without IOMMU support [not found] ` <20190102211657.13192-1-sakari.ailus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org> 2019-01-02 22:52 ` Laurent Pinchart @ 2019-01-11 11:27 ` Joerg Roedel 1 sibling, 0 replies; 5+ messages in thread From: Joerg Roedel @ 2019-01-11 11:27 UTC (permalink / raw) To: Sakari Ailus Cc: mchehab-DgEjT+Ai2ygdnm+yROfE0A, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, hans.verkuil-FYB4Gu1CFyUAvxtiuMwx3w, laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw, bingbu.cao-ral2JQCrhuEAvxtiuMwx3w, rajmohan.mani-ral2JQCrhuEAvxtiuMwx3w, yong.zhi-ral2JQCrhuEAvxtiuMwx3w, tian.shu.qiu-ral2JQCrhuEAvxtiuMwx3w, linux-media-u79uwXL29TY76Z2rM5mHXA On Wed, Jan 02, 2019 at 11:16:57PM +0200, Sakari Ailus wrote: > Drivers such as the Intel IPU3 ImgU driver use the IOVA library to manage > the device's own virtual address space while not implementing the IOMMU > API. Currently the IOVA library is only compiled if the IOMMU support is > enabled, resulting into a failure during linking due to missing symbols. > > Fix this by defining IOVA library Kconfig bits independently of IOMMU > support configuration, and descending to the iommu directory > unconditionally during the build. > > Signed-off-by: Sakari Ailus <sakari.ailus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org> Applied, thanks. ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-01-11 11:27 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-02 21:16 [PATCH 1/1] iova: Allow compiling the library without IOMMU support Sakari Ailus
[not found] ` <20190102211657.13192-1-sakari.ailus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2019-01-02 22:52 ` Laurent Pinchart
2019-01-03 20:11 ` Sakari Ailus
[not found] ` <20190103201126.zzqpn2eylm4m2zxn-WV0MzMiPiMJ82hYKe6nXyg@public.gmane.org>
2019-01-03 21:33 ` Aaron Sierra
2019-01-11 11:27 ` Joerg Roedel
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox