lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 19 Aug 2022 12:42:48 +0200
From:   Niklas Schnelle <schnelle@...ux.ibm.com>
To:     Pierre Morel <pmorel@...ux.ibm.com>, mjrosato@...ux.ibm.com
Cc:     rdunlap@...radead.org, linux-kernel@...r.kernel.org, lkp@...el.com,
        borntraeger@...ux.ibm.com, farman@...ux.ibm.com,
        linux-s390@...r.kernel.org, kvm@...r.kernel.org, gor@...ux.ibm.com,
        hca@...ux.ibm.com, frankja@...ux.ibm.com
Subject: Re: [PATCH] KVM: s390: pci: Hook to access KVM lowlevel from VFIO

On Fri, 2022-08-19 at 10:44 +0200, Pierre Morel wrote:
> 
> On 8/19/22 09:14, Niklas Schnelle wrote:
> > On Thu, 2022-08-18 at 18:46 +0200, Pierre Morel wrote:
> > > We have a cross dependency between KVM and VFIO when using
> > > s390 vfio_pci_zdev extensions for PCI passthrough
> > > To be able to keep both subsystem modular we add a registering
> > > hook inside the S390 core code.
> > > 
> > > This fixes a build problem when VFIO is built-in and KVM is built
> > > as a module.
> > > 
> > > Reported-by: Randy Dunlap <rdunlap@...radead.org>
> > > Reported-by: kernel test robot <lkp@...el.com>
> > > Signed-off-by: Pierre Morel <pmorel@...ux.ibm.com>
> > > Fixes: 09340b2fca007 ("KVM: s390: pci: add routines to start/stop inter..")
> > 
> > Please don't shorten the Fixes tag, the subject line is likely also
> > checked by some automated tools. It's okay for this line to be over the
> > column limit and checkpatch.pl --strict also accepts it.
> > 
> 
> OK
> 
> > > Cc: <stable@...r.kernel.org>
> > > ---
> > >   arch/s390/include/asm/kvm_host.h | 17 ++++++-----------
> > >   arch/s390/kvm/pci.c              | 10 ++++++----
> > >   arch/s390/pci/Makefile           |  2 ++
> > >   arch/s390/pci/pci_kvm_hook.c     | 11 +++++++++++
> > >   drivers/vfio/pci/vfio_pci_zdev.c |  8 ++++++--
> > >   5 files changed, 31 insertions(+), 17 deletions(-)
> > >   create mode 100644 arch/s390/pci/pci_kvm_hook.c
> > > 
> > > 
> > ---8<---
> > >   
> > >   	kvm_put_kvm(kvm);
> > >   }
> > > -EXPORT_SYMBOL_GPL(kvm_s390_pci_unregister_kvm);
> > >   
> > >   void kvm_s390_pci_init_list(struct kvm *kvm)
> > >   {
> > > @@ -678,6 +678,8 @@ int kvm_s390_pci_init(void)
> > >   
> > >   	spin_lock_init(&aift->gait_lock);
> > >   	mutex_init(&aift->aift_lock);
> > > +	zpci_kvm_hook.kvm_register = kvm_s390_pci_register_kvm;
> > > +	zpci_kvm_hook.kvm_unregister = kvm_s390_pci_unregister_kvm;
> > >   
> > >   	return 0;
> > >   }
> > > diff --git a/arch/s390/pci/Makefile b/arch/s390/pci/Makefile
> > > index bf557a1b789c..c02dbfb415d9 100644
> > > --- a/arch/s390/pci/Makefile
> > > +++ b/arch/s390/pci/Makefile
> > > @@ -7,3 +7,5 @@ obj-$(CONFIG_PCI)	+= pci.o pci_irq.o pci_dma.o pci_clp.o pci_sysfs.o \
> > >   			   pci_event.o pci_debug.o pci_insn.o pci_mmio.o \
> > >   			   pci_bus.o
> > >   obj-$(CONFIG_PCI_IOV)	+= pci_iov.o
> > > +
> > > +obj-y += pci_kvm_hook.o
> > 
> > I thought we wanted to compile this only for CONFIG_PCI?
> 
> Ah sorry, that is indeed what I understood with Matt but then I 
> misunderstood your own answer from yesterday.
> I change to
> obj-$(CONFIG_PCI) += pci_kvm_hook.o
> 
> > > diff --git a/arch/s390/pci/pci_kvm_hook.c b/arch/s390/pci/pci_kvm_hook.c
> > > new file mode 100644
> > > index 000000000000..ff34baf50a3e
> > ---8<---
> > 

Ok with the two things above plus the comment by Matt incorporated:

Reviewed-by: Niklas Schnelle <schnelle@...ux.ibm.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ