Re: [PATCH v7 1/1] vfio/nvgpu: Add vfio pci variant module for grace hopper

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 23 Aug 2023 12:16:23 -0300
Jason Gunthorpe <jgg@xxxxxxxxxx> wrote:

> On Wed, Aug 23, 2023 at 09:14:07AM -0600, Alex Williamson wrote:
> > On Wed, 23 Aug 2023 14:50:31 +0000
> > Ankit Agrawal <ankita@xxxxxxxxxx> wrote:
> >   
> > > >> +     if (index == VFIO_PCI_BAR2_REGION_INDEX) {
> > > >> +             if (!nvdev->opregion) {
> > > >> +                     nvdev->opregion = memremap(nvdev->hpa, nvdev->mem_length, MEMREMAP_WB);
> > > >> +                     if (!nvdev->opregion)
> > > >> +                             return -ENOMEM;
> > > >> +             }    
> > > >
> > > > [AW] Seems like this would be susceptible to concurrent accesses causing
> > > > duplicate mappings.
> > > >
> > > > [JG] Needs some kind of locking on opregion    
> > > 
> > > Right, will add a new lock item in nvdev to control the access to opregion/memmap.
> > > Please let me know if it is preferable to do memremap in open_device instead of
> > > read/write.  
> > 
> > That's a valid option also, certainly avoids the locking and
> > serialization per access.  Thanks,  
> 
> open_device is no good, that would waste large amounts of kernel
> memory for page tables to support something we don't expect to be
> used.

A lock it is then, I guess this is a very large range of memory.  The
contention/serialization is also not a priority, we expect access
through the mmap for anything other than debug.  Thanks,

Alex




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux