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

Re: [PATCH v9 04/16] vpci: add hooks for PCI device assign/de-assign


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Date: Wed, 13 Sep 2023 23:53:56 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=R8jphZXcJoUURiNVR/XYzjWprHsv9k8YGB7Cs5IEUP4=; b=l5LGtgXaVj1n6G+PvJ5FmPd4zWUiSPNebvHKtPNdxsULPyXvZ9oZt5bO+yVoFjpGTa2HD/D+X2iBuRYz/P4oNtjYdqMGFiaWdyG7hcDLgBlhGO6gNtn5pFFQbtpcf/i103NlsKPHk9J8FSPkmoNmnTm5xnpFjtQFSKo+L/j7/Kkld1K8dNxRoiLc9qv++K/CclsIm8FkmEhhNXMJoxBpqgGAQserPMLG1/uBYwmxWDiKxd4/erZel19nE6mzfcFk8YC2TlgMmbHOOar44UEf/23W2+lRTEsiRwAad6qobcjgXov/l0/QmbARv0SAwFSmz343CfpVhHBvKmQ8H4GVoA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YppZ0symDO/kQKM3NE6dNCDhZlhAw6lLJvaZQtadlEtNwrJIxnTUrxyWfKuhlLFOPcBt/WNb+m8h68gbEQrJlXhL/mvLVf5vIiYVq/47qBFJy8kkWXd/kY0lwDsuanqnOiMWMeIUDwRuubrUySTmwjsYxQrt0Dy8xDoSA/+Sr+XDfsz8L6zikbPk4SGFtfXrNp7aWm5nHGUizQ4H9j18yK0D4mGviT63DKnMumwxVsDlD6rRJA9zJWt4teKWJT9SgDev2foOexzy9MgNwhVQs6I7tvfkqwfUBLw9H4t59xlCoqd3futiTSgMO5lV2VxqeNTYhMyJrsCo7GyLmEJelw==
  • Cc: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>, Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Paul Durrant <paul@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 13 Sep 2023 23:54:30 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHZ2s9Kc9kNunOnfUurMYypVVbdQ7AXA+KAgADqFoCAAGrqgIABKtcA
  • Thread-topic: [PATCH v9 04/16] vpci: add hooks for PCI device assign/de-assign

Hi,

Jan Beulich <jbeulich@xxxxxxxx> writes:

> On 13.09.2023 01:41, Volodymyr Babchuk wrote:
>> Jan Beulich <jbeulich@xxxxxxxx> writes:
>>> On 30.08.2023 01:19, Volodymyr Babchuk wrote:
>>>> @@ -1481,6 +1488,13 @@ static int assign_device(struct domain *d, u16 seg, 
>>>> u8 bus, u8 devfn, u32 flag)
>>>>      if ( pdev->broken && d != hardware_domain && d != dom_io )
>>>>          goto done;
>>>>  
>>>> +    if ( IS_ENABLED(CONFIG_HAS_VPCI_GUEST_SUPPORT) )
>>>> +    {
>>>> +        write_lock(&pdev->domain->pci_lock);
>>>> +        vpci_deassign_device(pdev);
>>>> +        write_unlock(&pdev->domain->pci_lock);
>>>> +    }
>>>
>>> Why is the DomIO special case ...
>> 
>> vpci_deassign_device() does nothing if vPCI was initialized for a
>> domain. So it not wrong to call this function even if pdev belongs to dom_io.
>
> Well, okay, but then you acquire a lock just to do nothing (apart
> from the apparent asymmetry).

Yes, I agree. I'll add the same check as below. Thanks for the review.


-- 
WBR, Volodymyr


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.