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]
Message-ID: <20210810154512.5aa8eeb3.alex.williamson@redhat.com>
Date:   Tue, 10 Aug 2021 15:45:12 -0600
From:   Alex Williamson <alex.williamson@...hat.com>
To:     Peter Xu <peterx@...hat.com>
Cc:     Jason Gunthorpe <jgg@...dia.com>, linux-kernel@...r.kernel.org,
        kvm@...r.kernel.org
Subject: Re: [PATCH 7/7] vfio/pci: Remove map-on-fault behavior

On Tue, 10 Aug 2021 16:54:19 -0400
Peter Xu <peterx@...hat.com> wrote:

> On Thu, Aug 05, 2021 at 11:08:21AM -0600, Alex Williamson wrote:
> > diff --git a/drivers/vfio/pci/vfio_pci_private.h b/drivers/vfio/pci/vfio_pci_private.h
> > index 0aa542fa1e26..9aedb78a4ae3 100644
> > --- a/drivers/vfio/pci/vfio_pci_private.h
> > +++ b/drivers/vfio/pci/vfio_pci_private.h
> > @@ -128,6 +128,7 @@ struct vfio_pci_device {
> >  	bool			needs_reset;
> >  	bool			nointx;
> >  	bool			needs_pm_restore;
> > +	bool			zapped_bars;  
> 
> Would it be nicer to invert the meaning of "zapped_bars" and rename it to
> "memory_enabled"?  Thanks,

I think this has it's own down sides, for example is this really less
confusing?:

  if (!vdev->memory_enabled && __vfio_pci_memory_enabled(vdev))

Are you specifically trying to invert the polarity or just get away
from the name proposed here?  We could use something like
"bars_unmapped", which would have the same polarity (OTOH,
"bars_mapped" suggests something to me about whether the user has
performed any mmaps of BARs).

I do wish there was a more elegant solution than an @var tracking this
state in general, but I haven't come up with such a solution yet.
Thanks,

Alex

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ