public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Cornelia Huck <cohuck@redhat.com>
Cc: <kvm@vger.kernel.org>, Alex Williamson <alex.williamson@redhat.com>
Subject: Re: [PATCH 1/3] vfio: IOMMU_API should be selected
Date: Wed, 3 Mar 2021 08:52:17 -0400	[thread overview]
Message-ID: <20210303125217.GO4247@nvidia.com> (raw)
In-Reply-To: <20210303133626.3598b41b.cohuck@redhat.com>

On Wed, Mar 03, 2021 at 01:36:26PM +0100, Cornelia Huck wrote:
> On Tue, 23 Feb 2021 15:17:46 -0400
> Jason Gunthorpe <jgg@nvidia.com> wrote:
> 
> > As IOMMU_API is a kconfig without a description (eg does not show in the
> > menu) the correct operator is select not 'depends on'. Using 'depends on'
> > for this kind of symbol means VFIO is not selectable unless some other
> > random kconfig has already enabled IOMMU_API for it.
> > 
> > Fixes: cba3345cc494 ("vfio: VFIO core")
> > Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
> >  drivers/vfio/Kconfig | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/vfio/Kconfig b/drivers/vfio/Kconfig
> > index 5533df91b257d6..90c0525b1e0cf4 100644
> > +++ b/drivers/vfio/Kconfig
> > @@ -21,7 +21,7 @@ config VFIO_VIRQFD
> >  
> >  menuconfig VFIO
> >  	tristate "VFIO Non-Privileged userspace driver framework"
> > -	depends on IOMMU_API
> > +	select IOMMU_API
> >  	select VFIO_IOMMU_TYPE1 if (X86 || S390 || ARM || ARM64)
> >  	help
> >  	  VFIO provides a framework for secure userspace device drivers.
> 
> I'm wondering whether this should depend on MMU?

Hum. My ARM cross compiler says it won't compile:

../drivers/vfio/vfio_iommu_type1.c: In function 'follow_fault_pfn':
../drivers/vfio/vfio_iommu_type1.c:536:22: error: implicit declaration of function 'pte_write'; did you mean 'vfs_write'? [-Werror=implicit-function-declaration]
  if (write_fault && !pte_write(*ptep))
                      ^~~~~~~~~
                      vfs_write
../drivers/vfio/vfio_iommu_type1.c:539:10: error: implicit declaration of function 'pte_pfn'; did you mean 'put_pfn'? [-Werror=implicit-function-declaration]
   *pfn = pte_pfn(*ptep);
          ^~~~~~~
          put_pfn
In file included from ../include/linux/highmem.h:8,
                 from ../drivers/vfio/vfio_iommu_type1.c:27:
../include/linux/mm.h:2200:2: error: implicit declaration of function 'pte_unmap'; did you mean 'memunmap'? [-Werror=implicit-function-declaration]
  pte_unmap(pte);     \
  ^~~~~~~~~
../drivers/vfio/vfio_iommu_type1.c:541:2: note: in expansion of macro 'pte_unmap_unlock'
  pte_unmap_unlock(ptep, ptl);
  ^~~~~~~~~~~~~~~~

So, yes, it does.

Interesting that a compile bot hasn't reported this before.

-       select VFIO_IOMMU_TYPE1 if (X86 || S390 || ARM || ARM64)
+       select VFIO_IOMMU_TYPE1 if MMU && (X86 || S390 || ARM || ARM64)

Is enough to make !MMU ARM compile.

I'll send an additonal patch

Jason

  reply	other threads:[~2021-03-04  0:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-23 19:17 [PATCH 0/3] Tidy some parts of the VFIO kconfig world Jason Gunthorpe
2021-02-23 19:17 ` [PATCH 1/3] vfio: IOMMU_API should be selected Jason Gunthorpe
2021-02-24  9:50   ` Auger Eric
2021-03-03 12:36   ` Cornelia Huck
2021-03-03 12:52     ` Jason Gunthorpe [this message]
2021-02-23 19:17 ` [PATCH 2/3] vfio-platform: Add COMPILE_TEST to VFIO_PLATFORM Jason Gunthorpe
2021-02-24  9:42   ` Auger Eric
2021-02-24 13:00     ` Jason Gunthorpe
2021-02-23 19:17 ` [PATCH 3/3] ARM: amba: Allow some ARM_AMBA users to compile with COMPILE_TEST Jason Gunthorpe
2021-02-24  9:49   ` Auger Eric

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=20210303125217.GO4247@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=alex.williamson@redhat.com \
    --cc=cohuck@redhat.com \
    --cc=kvm@vger.kernel.org \
    /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