[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BY5PR12MB37639528FCF1CDB7D595B6FFB01CA@BY5PR12MB3763.namprd12.prod.outlook.com>
Date: Wed, 23 Aug 2023 14:50:31 +0000
From: Ankit Agrawal <ankita@...dia.com>
To: Jason Gunthorpe <jgg@...dia.com>
CC: "alex.williamson@...hat.com" <alex.williamson@...hat.com>,
Yishai Hadas <yishaih@...dia.com>,
"shameerali.kolothum.thodi@...wei.com"
<shameerali.kolothum.thodi@...wei.com>,
"kevin.tian@...el.com" <kevin.tian@...el.com>,
Aniket Agashe <aniketa@...dia.com>, Neo Jia <cjia@...dia.com>,
Kirti Wankhede <kwankhede@...dia.com>,
"Tarun Gupta (SW-GPU)" <targupta@...dia.com>,
Vikram Sethi <vsethi@...dia.com>,
Andy Currid <acurrid@...dia.com>,
Alistair Popple <apopple@...dia.com>,
John Hubbard <jhubbard@...dia.com>,
Dan Williams <danw@...dia.com>,
"kvm@...r.kernel.org" <kvm@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v7 1/1] vfio/nvgpu: Add vfio pci variant module for grace
hopper
>> + 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.
Powered by blists - more mailing lists