From: Jason Gunthorpe <jgg@nvidia.com>
To: Sean Christopherson <seanjc@google.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>,
Paolo Bonzini <pbonzini@redhat.com>,
Alexander Gordeev <agordeev@linux.ibm.com>,
Christian Borntraeger <borntraeger@linux.ibm.com>,
Borislav Petkov <bp@alien8.de>,
Catalin Marinas <catalin.marinas@arm.com>,
Christophe Leroy <christophe.leroy@csgroup.eu>,
Dave Hansen <dave.hansen@linux.intel.com>,
David Hildenbrand <david@redhat.com>,
Janosch Frank <frankja@linux.ibm.com>,
Vasily Gorbik <gor@linux.ibm.com>,
Heiko Carstens <hca@linux.ibm.com>,
"H. Peter Anvin" <hpa@zytor.com>,
Claudio Imbrenda <imbrenda@linux.ibm.com>,
James Morse <james.morse@arm.com>,
kvm@vger.kernel.org, kvmarm@lists.linux.dev,
linux-arm-kernel@lists.infradead.org, linux-s390@vger.kernel.org,
linuxppc-dev@lists.ozlabs.org, Marc Zyngier <maz@kernel.org>,
Ingo Molnar <mingo@redhat.com>,
Nicholas Piggin <npiggin@gmail.com>,
Oliver Upton <oliver.upton@linux.dev>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Sven Schnelle <svens@linux.ibm.com>,
Thomas Gleixner <tglx@linutronix.de>,
Will Deacon <will@kernel.org>,
x86@kernel.org, Zenghui Yu <yuzenghui@huawei.com>
Subject: Re: Ping? Re: [PATCH rc] kvm: Prevent compiling virt/kvm/vfio.c unless VFIO is selected
Date: Wed, 29 Nov 2023 21:16:50 -0400 [thread overview]
Message-ID: <20231130011650.GD1389974@nvidia.com> (raw)
In-Reply-To: <ZWfgYdSoJAZqL2Gx@google.com>
On Wed, Nov 29, 2023 at 05:07:45PM -0800, Sean Christopherson wrote:
> On Wed, Nov 29, 2023, Michael Ellerman wrote:
> > Sean Christopherson <seanjc@google.com> writes:
> > > On Fri, Nov 10, 2023, Michael Ellerman wrote:
> > >> Jason Gunthorpe <jgg@nvidia.com> writes:
> > >> > There are a bunch of reported randconfig failures now because of this,
> > >> > something like:
> > >> >
> > >> >>> arch/powerpc/kvm/../../../virt/kvm/vfio.c:89:7: warning: attribute declaration must precede definition [-Wignored-attributes]
> > >> > fn = symbol_get(vfio_file_iommu_group);
> > >> > ^
> > >> > include/linux/module.h:805:60: note: expanded from macro 'symbol_get'
> > >> > #define symbol_get(x) ({ extern typeof(x) x __attribute__((weak,visibility("hidden"))); &(x); })
> > >> >
> > >> > It happens because the arch forces KVM_VFIO without knowing if VFIO is
> > >> > even enabled.
> > >>
> > >> This is still breaking some builds. Can we get this fix in please?
> > >>
> > >> cheers
> > >>
> > >> > Split the kconfig so the arch selects the usual HAVE_KVM_ARCH_VFIO and
> > >> > then KVM_VFIO is only enabled if the arch wants it and VFIO is turned on.
> > >
> > > Heh, so I was trying to figure out why things like vfio_file_set_kvm() aren't
> > > problematic, i.e. why the existing mess didn't cause failures. I can't repro the
> > > warning (requires clang-16?), but IIUC the reason only the group code is problematic
> > > is that vfio.h creates a stub for vfio_file_iommu_group() and thus there's no symbol,
> > > whereas vfio.h declares vfio_file_set_kvm() unconditionally.
> >
> > That warning I'm unsure about.
>
> Ah, it's the same warning, I just missed the CONFIG_MODULES=n requirement.
Oh, wait, doesn't that mean the approach won't work? IIRC doesn't
symbol_get turn into just &fn when non-modular turning this into a
link failure without the kconfig part?
Jason
WARNING: multiple messages have this Message-ID (diff)
From: Jason Gunthorpe <jgg@nvidia.com>
To: Sean Christopherson <seanjc@google.com>
Cc: kvm@vger.kernel.org, David Hildenbrand <david@redhat.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Dave Hansen <dave.hansen@linux.intel.com>,
"H. Peter Anvin" <hpa@zytor.com>,
Alexander Gordeev <agordeev@linux.ibm.com>,
Claudio Imbrenda <imbrenda@linux.ibm.com>,
Will Deacon <will@kernel.org>,
linux-s390@vger.kernel.org, Janosch Frank <frankja@linux.ibm.com>,
x86@kernel.org, Ingo Molnar <mingo@redhat.com>,
Zenghui Yu <yuzenghui@huawei.com>,
Christian Borntraeger <borntraeger@linux.ibm.com>,
Vasily Gorbik <gor@linux.ibm.com>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Heiko Carstens <hca@linux.ibm.com>,
Nicholas Piggin <npiggin@gmail.com>,
Borislav Petkov <bp@alien8.de>,
kvmarm@lists.linux.dev, Thomas Gleixner <tglx@linutronix.de>,
linux-arm-kernel@lists.infradead.org,
Oliver Upton <oliver.upton@linux.dev>,
James Morse <james.morse@arm.com>,
Sven Schnelle <svens@linux.ibm.com>,
Marc Zyngier <maz@kernel.org>,
Paolo Bonzini <pbonzini@redhat.com>,
linuxppc-dev@lists.ozlabs.org
Subject: Re: Ping? Re: [PATCH rc] kvm: Prevent compiling virt/kvm/vfio.c unless VFIO is selected
Date: Wed, 29 Nov 2023 21:16:50 -0400 [thread overview]
Message-ID: <20231130011650.GD1389974@nvidia.com> (raw)
In-Reply-To: <ZWfgYdSoJAZqL2Gx@google.com>
On Wed, Nov 29, 2023 at 05:07:45PM -0800, Sean Christopherson wrote:
> On Wed, Nov 29, 2023, Michael Ellerman wrote:
> > Sean Christopherson <seanjc@google.com> writes:
> > > On Fri, Nov 10, 2023, Michael Ellerman wrote:
> > >> Jason Gunthorpe <jgg@nvidia.com> writes:
> > >> > There are a bunch of reported randconfig failures now because of this,
> > >> > something like:
> > >> >
> > >> >>> arch/powerpc/kvm/../../../virt/kvm/vfio.c:89:7: warning: attribute declaration must precede definition [-Wignored-attributes]
> > >> > fn = symbol_get(vfio_file_iommu_group);
> > >> > ^
> > >> > include/linux/module.h:805:60: note: expanded from macro 'symbol_get'
> > >> > #define symbol_get(x) ({ extern typeof(x) x __attribute__((weak,visibility("hidden"))); &(x); })
> > >> >
> > >> > It happens because the arch forces KVM_VFIO without knowing if VFIO is
> > >> > even enabled.
> > >>
> > >> This is still breaking some builds. Can we get this fix in please?
> > >>
> > >> cheers
> > >>
> > >> > Split the kconfig so the arch selects the usual HAVE_KVM_ARCH_VFIO and
> > >> > then KVM_VFIO is only enabled if the arch wants it and VFIO is turned on.
> > >
> > > Heh, so I was trying to figure out why things like vfio_file_set_kvm() aren't
> > > problematic, i.e. why the existing mess didn't cause failures. I can't repro the
> > > warning (requires clang-16?), but IIUC the reason only the group code is problematic
> > > is that vfio.h creates a stub for vfio_file_iommu_group() and thus there's no symbol,
> > > whereas vfio.h declares vfio_file_set_kvm() unconditionally.
> >
> > That warning I'm unsure about.
>
> Ah, it's the same warning, I just missed the CONFIG_MODULES=n requirement.
Oh, wait, doesn't that mean the approach won't work? IIRC doesn't
symbol_get turn into just &fn when non-modular turning this into a
link failure without the kconfig part?
Jason
WARNING: multiple messages have this Message-ID (diff)
From: Jason Gunthorpe <jgg@nvidia.com>
To: Sean Christopherson <seanjc@google.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>,
Paolo Bonzini <pbonzini@redhat.com>,
Alexander Gordeev <agordeev@linux.ibm.com>,
Christian Borntraeger <borntraeger@linux.ibm.com>,
Borislav Petkov <bp@alien8.de>,
Catalin Marinas <catalin.marinas@arm.com>,
Christophe Leroy <christophe.leroy@csgroup.eu>,
Dave Hansen <dave.hansen@linux.intel.com>,
David Hildenbrand <david@redhat.com>,
Janosch Frank <frankja@linux.ibm.com>,
Vasily Gorbik <gor@linux.ibm.com>,
Heiko Carstens <hca@linux.ibm.com>,
"H. Peter Anvin" <hpa@zytor.com>,
Claudio Imbrenda <imbrenda@linux.ibm.com>,
James Morse <james.morse@arm.com>,
kvm@vger.kernel.org, kvmarm@lists.linux.dev,
linux-arm-kernel@lists.infradead.org, linux-s390@vger.kernel.org,
linuxppc-dev@lists.ozlabs.org, Marc Zyngier <maz@kernel.org>,
Ingo Molnar <mingo@redhat.com>,
Nicholas Piggin <npiggin@gmail.com>,
Oliver Upton <oliver.upton@linux.dev>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Sven Schnelle <svens@linux.ibm.com>,
Thomas Gleixner <tglx@linutronix.de>,
Will Deacon <will@kernel.org>,
x86@kernel.org, Zenghui Yu <yuzenghui@huawei.com>
Subject: Re: Ping? Re: [PATCH rc] kvm: Prevent compiling virt/kvm/vfio.c unless VFIO is selected
Date: Wed, 29 Nov 2023 21:16:50 -0400 [thread overview]
Message-ID: <20231130011650.GD1389974@nvidia.com> (raw)
In-Reply-To: <ZWfgYdSoJAZqL2Gx@google.com>
On Wed, Nov 29, 2023 at 05:07:45PM -0800, Sean Christopherson wrote:
> On Wed, Nov 29, 2023, Michael Ellerman wrote:
> > Sean Christopherson <seanjc@google.com> writes:
> > > On Fri, Nov 10, 2023, Michael Ellerman wrote:
> > >> Jason Gunthorpe <jgg@nvidia.com> writes:
> > >> > There are a bunch of reported randconfig failures now because of this,
> > >> > something like:
> > >> >
> > >> >>> arch/powerpc/kvm/../../../virt/kvm/vfio.c:89:7: warning: attribute declaration must precede definition [-Wignored-attributes]
> > >> > fn = symbol_get(vfio_file_iommu_group);
> > >> > ^
> > >> > include/linux/module.h:805:60: note: expanded from macro 'symbol_get'
> > >> > #define symbol_get(x) ({ extern typeof(x) x __attribute__((weak,visibility("hidden"))); &(x); })
> > >> >
> > >> > It happens because the arch forces KVM_VFIO without knowing if VFIO is
> > >> > even enabled.
> > >>
> > >> This is still breaking some builds. Can we get this fix in please?
> > >>
> > >> cheers
> > >>
> > >> > Split the kconfig so the arch selects the usual HAVE_KVM_ARCH_VFIO and
> > >> > then KVM_VFIO is only enabled if the arch wants it and VFIO is turned on.
> > >
> > > Heh, so I was trying to figure out why things like vfio_file_set_kvm() aren't
> > > problematic, i.e. why the existing mess didn't cause failures. I can't repro the
> > > warning (requires clang-16?), but IIUC the reason only the group code is problematic
> > > is that vfio.h creates a stub for vfio_file_iommu_group() and thus there's no symbol,
> > > whereas vfio.h declares vfio_file_set_kvm() unconditionally.
> >
> > That warning I'm unsure about.
>
> Ah, it's the same warning, I just missed the CONFIG_MODULES=n requirement.
Oh, wait, doesn't that mean the approach won't work? IIRC doesn't
symbol_get turn into just &fn when non-modular turning this into a
link failure without the kconfig part?
Jason
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2023-11-30 1:16 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-20 18:18 [PATCH rc] kvm: Prevent compiling virt/kvm/vfio.c unless VFIO is selected Jason Gunthorpe
2023-09-20 18:18 ` Jason Gunthorpe
2023-09-22 0:00 ` Michael Ellerman
2023-09-22 0:00 ` Michael Ellerman
2023-11-10 6:08 ` Ping? " Michael Ellerman
2023-11-10 6:08 ` Michael Ellerman
2023-11-10 6:08 ` Michael Ellerman
2023-11-29 2:21 ` Sean Christopherson
2023-11-29 2:21 ` Sean Christopherson
2023-11-29 2:21 ` Sean Christopherson
2023-11-29 9:38 ` Michael Ellerman
2023-11-29 9:38 ` Michael Ellerman
2023-11-29 9:38 ` Michael Ellerman
2023-11-30 1:07 ` Sean Christopherson
2023-11-30 1:07 ` Sean Christopherson
2023-11-30 1:07 ` Sean Christopherson
2023-11-30 1:16 ` Jason Gunthorpe [this message]
2023-11-30 1:16 ` Jason Gunthorpe
2023-11-30 1:16 ` Jason Gunthorpe
2023-11-30 2:02 ` Sean Christopherson
2023-11-30 2:02 ` Sean Christopherson
2023-11-30 2:02 ` Sean Christopherson
2023-11-30 6:38 ` Michael Ellerman
2023-11-30 6:38 ` Michael Ellerman
2023-11-30 6:38 ` Michael Ellerman
2023-11-30 12:07 ` Jason Gunthorpe
2023-11-30 12:07 ` Jason Gunthorpe
2023-11-30 12:07 ` Jason Gunthorpe
2023-11-29 12:48 ` Jason Gunthorpe
2023-11-29 12:48 ` Jason Gunthorpe
2023-11-29 12:48 ` Jason Gunthorpe
2023-11-29 18:31 ` Sean Christopherson
2023-11-29 18:31 ` Sean Christopherson
2023-11-29 18:31 ` Sean Christopherson
2023-11-29 21:45 ` Alex Williamson
2023-11-29 21:45 ` Alex Williamson
2023-11-29 21:45 ` 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=20231130011650.GD1389974@nvidia.com \
--to=jgg@nvidia.com \
--cc=agordeev@linux.ibm.com \
--cc=borntraeger@linux.ibm.com \
--cc=bp@alien8.de \
--cc=catalin.marinas@arm.com \
--cc=christophe.leroy@csgroup.eu \
--cc=dave.hansen@linux.intel.com \
--cc=david@redhat.com \
--cc=frankja@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=hpa@zytor.com \
--cc=imbrenda@linux.ibm.com \
--cc=james.morse@arm.com \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-s390@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maz@kernel.org \
--cc=mingo@redhat.com \
--cc=mpe@ellerman.id.au \
--cc=npiggin@gmail.com \
--cc=oliver.upton@linux.dev \
--cc=pbonzini@redhat.com \
--cc=seanjc@google.com \
--cc=suzuki.poulose@arm.com \
--cc=svens@linux.ibm.com \
--cc=tglx@linutronix.de \
--cc=will@kernel.org \
--cc=x86@kernel.org \
--cc=yuzenghui@huawei.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.