[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4E56A1CF.5050008@web.de>
Date: Thu, 25 Aug 2011 21:26:07 +0200
From: Jan Kiszka <jan.kiszka@....de>
To: "Michael S. Tsirkin" <mst@...hat.com>
CC: Brian King <brking@...ux.vnet.ibm.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
"linux-pci@...r.kernel.org" <linux-pci@...r.kernel.org>,
Alex Williamson <alex.williamson@...hat.com>,
Jesse Barnes <jbarnes@...tuousgeek.org>,
Matthew Wilcox <matthew@....cx>
Subject: Re: Broken pci_block_user_cfg_access interface
On 2011-08-25 21:07, Michael S. Tsirkin wrote:
> On Thu, Aug 25, 2011 at 08:52:08PM +0200, Jan Kiszka wrote:
>> On 2011-08-25 20:19, Michael S. Tsirkin wrote:
>>> On Thu, Aug 25, 2011 at 03:06:01PM +0200, Jan Kiszka wrote:
>>>>> I took a look at the sysfs triggered pci reset function and don't see any way
>>>>> that the controlling device driver ever gets to be involved in this reset.
>>>>> If code outside the ipr driver were to reset the adapter, the adapter firmware
>>>>> would be left in an uninitialized state and until scsi core starts timing
>>>>> out ops and driving EH, the card would be unusable. I can't imagine the
>>>>> ipr driver is unique in this.
>>>>
>>>> Right, that's why a PCI core service is needed for coordination.
>>>>
>>>> Jan
>>>
>>> But why do we want to trigger reset through sysfs while the
>>> driver runs?
>>
>> A perfectly valid race conditions are created by KVM and VFIO: shared
>> IRQ handler is triggered while the user space part wants to reset the
>> assigned device.
>
> OK, that would be solved by blocking sysfs reset while
> config access is blocked, right?
...and VFIO's reset IOCTL. And any other potential pci_reset_function
caller. And you still need to synchronize those config space accesses
that don't wait for the block_ucfg_access while some reset is being
performed. This really screams for a redesign of config space locking.
Jan
Download attachment "signature.asc" of type "application/pgp-signature" (263 bytes)
Powered by blists - more mailing lists