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

Re: [PATCH v3 11/11] xen/arm: Translate virtual PCI bus topology for guests


  • To: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 30 Sep 2021 12:25:19 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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; bh=lcKUmlalB7FPEGLasEPn2v96X2SEhgV64/x47Ny5XaM=; b=PTp+96KP+8ehuRU0n4zwQdg1kbvdUEltu0lqoGgyR6TLn00sbgTNcY19GhZOu6wQ3sg31NYv8DvyprfBblF1pFkOKRYm/xHf0YjkzkIIITMSE9H2xyfCaYKl0EPNFNEGn/5DuX95RdPNzOr5sn9icMEugv1sgv7+1wS1gGpeE4w49HXFgP/n1UnJTQYjOiPTaHmSKq74j8F09Hf4KwrOrP03EUs/4FEQ4ZaLC71mc3Z3u/wuuN1sikfN0FX25YAD0y1wu45gzG7qlae4DEl9rd7zjhx0pxxPlTtQc2WhZEbTmy/jFB0FZgVJ0QzxrqFCc/YRVWk32NokUI6cHWCPWg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HPQ5/4UnpE+eONtfczvsVjRYksIikTczeUnxxncADsPwfKxIsyUGoSTixOxbSBRFz6W/6iFAXfySPIT6k8q1fVCjLKLugEgjYB0dePOSFQjXDefdwHtQcHMpivTuJbVqi46BW0WLaBWuEFFi3bfU6A90XtGl9ypGKm3JG9G+ra9xdOsQ6NPBSQVLqLPo946oU19LpXZZhDmBGkGRZ2gOqonojoyaUYN20INN9TxX+w/TSnlXDuv85oI52bqqeXOedIzsjRecUrXM+UHlE1BPqES1mAb6hjN4u9kEfoAY5HyHTb+5aN10baS4rLG0iHSqTUZsmOBxWDvn760XxZ8idw==
  • Authentication-results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=suse.com;
  • Cc: "julien@xxxxxxx" <julien@xxxxxxx>, "sstabellini@xxxxxxxxxx" <sstabellini@xxxxxxxxxx>, Oleksandr Tyshchenko <Oleksandr_Tyshchenko@xxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Artem Mygaiev <Artem_Mygaiev@xxxxxxxx>, "roger.pau@xxxxxxxxxx" <roger.pau@xxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Rahul Singh <rahul.singh@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 30 Sep 2021 10:25:29 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 30.09.2021 11:35, Oleksandr Andrushchenko wrote:
> On 30.09.21 11:53, Jan Beulich wrote:
>> On 30.09.2021 09:52, Oleksandr Andrushchenko wrote:
>>> --- a/xen/drivers/passthrough/pci.c
>>> +++ b/xen/drivers/passthrough/pci.c
>>> @@ -889,6 +889,31 @@ int pci_remove_virtual_device(struct domain *d, const 
>>> struct pci_dev *pdev)
>>>       xfree(vdev);
>>>       return 0;
>>>   }
>>> +
>>> +/*
>>> + * Find the physical device which is mapped to the virtual device
>>> + * and translate virtual SBDF to the physical one.
>>> + */
>>> +bool pci_translate_virtual_device(const struct domain *d, pci_sbdf_t *sbdf)
>>> +{
>>> +    struct vpci_dev *vdev;
>> const (afaict)
> Ok
>>
>>> +    bool found = false;
>>> +
>>> +    pcidevs_lock();
>>> +    list_for_each_entry ( vdev, &d->vdev_list, list )
>>> +    {
>>> +        if ( vdev->sbdf.sbdf == sbdf->sbdf )
>>> +        {
>>> +            /* Replace virtual SBDF with the physical one. */
>>> +            *sbdf = vdev->pdev->sbdf;
>>> +            found = true;
>>> +            break;
>>> +        }
>>> +    }
>>> +    pcidevs_unlock();
>> As per the comments on the earlier patch, locking as well as placement
>> may need reconsidering.
> Other then that do you have other comments on this?

Iirc this was the only thing here. But I haven't got around to look
at patches 4-9 yet ...

Jan




 


Rackspace

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