[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v6 12/13] xen/arm: translate virtual PCI bus topology for guests
- To: Oleksandr Andrushchenko <andr2000@xxxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Fri, 4 Feb 2022 08:56:01 +0100
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=k7GYhuJCbNjhx0WIlcWn5Rn1mDYkjm0tooRLJ8Lgu4U=; b=K5Mxae1F1R6liyBvmEXypYgRXBWkaXJ4tuvxqjHCjRc/I063RNuSghP9i1cITuO/BfWsbLyQpcq4AdKYQJRwdG8DXcBJQsZ/bN//UxQW6JHgI5v5mCqoNrHOM0jFQxY+ZOKrKNjZuzQ+9eTewRP4KNs10raOYqlaFmGaSOv9GUPtxuJav41HvatWMlfwlH8L9QnaAxwDc1eTuq6nbsERbZO5rtXJWGb1B75UNK32fLY/yYQM5zf+BsEKWiyyK1SDj7hu4JxIU/At8q0vaOCz4+H0Ebufw/UmiWtLmRe+3uZCutJMxMjCsoIV2NHECFrLziQ/WY6daaJYCrIA1cbPmQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Hmg68HKQ/927D6fcprksQCtrSIb3HekjOyb6Lz6hQXEx7ir5fe1LVmz7jY80JpAIX6WuutLZdNRtJzBmIECQMm3suxVSwECOUtQbdOaBxOIqQTraKg9vbTY+xvH3Cn24Q5hqR7zAKDNo4UqqhBg8lT+C3X6lAnB2L1qaFAZJ4pmPUXJYe7GhNdIB/DahHE3G52uCVGTEG7ry/AzYo5akA3IV5w2Ok7oOz6W6StosQ6otLFwU+jufDthCGVasXqvzTZuyZwPl6IYij2LE+VaQQ0i/GjdKeyh+0/N4jNPEPv+tGFSboB2P0bS6MwDry/3j0cwD673wnA2wcO0rKTFZfQ==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
- Cc: julien@xxxxxxx, sstabellini@xxxxxxxxxx, oleksandr_tyshchenko@xxxxxxxx, volodymyr_babchuk@xxxxxxxx, artem_mygaiev@xxxxxxxx, roger.pau@xxxxxxxxxx, andrew.cooper3@xxxxxxxxxx, george.dunlap@xxxxxxxxxx, paul@xxxxxxx, bertrand.marquis@xxxxxxx, rahul.singh@xxxxxxx, Oleksandr Andrushchenko <oleksandr_andrushchenko@xxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
- Delivery-date: Fri, 04 Feb 2022 07:56:09 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 04.02.2022 07:34, Oleksandr Andrushchenko wrote:
> --- a/xen/drivers/vpci/vpci.c
> +++ b/xen/drivers/vpci/vpci.c
> @@ -168,6 +168,35 @@ static void vpci_remove_virtual_device(struct domain *d,
> pdev->vpci->guest_sbdf.sbdf = ~0;
> }
>
> +/*
> + * Find the physical device which is mapped to the virtual device
> + * and translate virtual SBDF to the physical one.
> + */
> +bool vpci_translate_virtual_device(const struct domain *d, pci_sbdf_t *sbdf)
> +{
> + struct pci_dev *pdev;
> +
> + ASSERT(!is_hardware_domain(d));
In addition to this, don't you also need to assert that pcidevs_lock is
held (or if it isn't, you'd need to acquire it) for ...
> + for_each_pdev( d, pdev )
... this to be race-free?
Jan
|