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

Re: [PATCH v4 03/11] xen/arm: Introduce pci_find_host_bridge_node helper


  • To: Oleksandr Andrushchenko <andr2000@xxxxxxxxx>
  • From: Rahul Singh <Rahul.Singh@xxxxxxx>
  • Date: Wed, 6 Oct 2021 10:24:02 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.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=N3j4r5YO2fyOp4hY/NACH/zn4szN890eJEQyJ5RSjEk=; b=D3X2jugF3MLzSg6UWuitE4p7eCNKdrfq+T8KXseKksoIHd//5kWjH4mM5UzM9VRUe5aSvapd32M2LbT/NeMscH/3CWseqizqHdHB6DZcF4UFn416RZiVJ/rwXPE9eO1/gkLUgNFKp3ySPzxYIt0ylyChzGDrA0X9twE/y8m2htF7wZYiHJhu4cAbDQK4Lt/IEGiWr8+PP59jIQ01m/wDnZk0O6ZHf9tWdGT/11KxrFOaNhWJKdOkPRqetZ2Im7ss0mCpqaSinuTy1Un8vTE4EhToYUAMCVGyCzT8jiby+kyZalxLjMCW+iQxHhfe44mCYaDXvEDzi1rgdlSdUBcjNg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GgDY5bTzQ7na6nyrHcfohSA9FHiNesSEKMwzN2s/41xSzFCk/4hwbuHeHs75ZNzskKOxGdopjBSdU7s5TYPQ5i3XWXto/JwhQer3kQrSgEreRjSAxZx6LL4YdGMQKjoCKerYeIAzrUoxi1FXJclZLgXWbILEA3OexRBfgcRGT73dj01FOogYqInl12GZPlN7jEYvdgBJXW/keG9+Ao0RQ6ezO2c8eR5LZcRuVimzeNS6h14TixbR3XUMU2qQFlg0gRLkkPyhOVJZcqfEabyFenGJL8apIlMHAsYN9KT2J2Xqf7jbFhtGAauBBVlMJCzsPP1wivJQV2UHewPv1G1gmg==
  • Authentication-results-original: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=arm.com;
  • Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, "oleksandr_tyshchenko@xxxxxxxx" <oleksandr_tyshchenko@xxxxxxxx>, "volodymyr_babchuk@xxxxxxxx" <volodymyr_babchuk@xxxxxxxx>, Artem Mygaiev <Artem_Mygaiev@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Paul Durrant <paul@xxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Oleksandr Andrushchenko <oleksandr_andrushchenko@xxxxxxxx>
  • Delivery-date: Wed, 06 Oct 2021 10:24:21 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHXuSnbk6lAyqcLOUmLtP1GAsLbT6vFxjwA
  • Thread-topic: [PATCH v4 03/11] xen/arm: Introduce pci_find_host_bridge_node helper

Hi Oleksandr,

> On 4 Oct 2021, at 3:11 pm, Oleksandr Andrushchenko <andr2000@xxxxxxxxx> wrote:
> 
> From: Oleksandr Andrushchenko <oleksandr_andrushchenko@xxxxxxxx>
> 
> Get host bridge node given a PCI device attached to it.
> 
> This helper will be re-used for adding PCI devices by the subsequent
> patches.
> 
> Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@xxxxxxxx>
> Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>
> Reviewed-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>

Reviewed-by: Rahul Singh <rahul.singh@xxxxxxx>
Tested-by: Rahul Singh <rahul.singh@xxxxxxx>

Regards,
Rahul
> ---
> Since v2:
> - !! dropped Stefano's r-b because of the changes
> - s/PRI_pci/%pp after rebase onto Arm series
> ---
> xen/arch/arm/pci/pci-host-common.c | 16 ++++++++++++++++
> xen/include/asm-arm/pci.h          |  1 +
> 2 files changed, 17 insertions(+)
> 
> diff --git a/xen/arch/arm/pci/pci-host-common.c 
> b/xen/arch/arm/pci/pci-host-common.c
> index 593beeb48ce4..592c01aae5bb 100644
> --- a/xen/arch/arm/pci/pci-host-common.c
> +++ b/xen/arch/arm/pci/pci-host-common.c
> @@ -276,6 +276,22 @@ int pci_get_host_bridge_segment(const struct 
> dt_device_node *node,
>     return -EINVAL;
> }
> 
> +/*
> + * Get host bridge node given a device attached to it.
> + */
> +struct dt_device_node *pci_find_host_bridge_node(struct device *dev)
> +{
> +    struct pci_host_bridge *bridge;
> +    struct pci_dev *pdev = dev_to_pci(dev);
> +
> +    bridge = pci_find_host_bridge(pdev->seg, pdev->bus);
> +    if ( unlikely(!bridge) )
> +    {
> +        printk(XENLOG_ERR "Unable to find PCI bridge for %pp\n", 
> &pdev->sbdf);
> +        return NULL;
> +    }
> +    return bridge->dt_node;
> +}
> /*
>  * Local variables:
>  * mode: C
> diff --git a/xen/include/asm-arm/pci.h b/xen/include/asm-arm/pci.h
> index 603a1fc072d1..e6d4000e2ac8 100644
> --- a/xen/include/asm-arm/pci.h
> +++ b/xen/include/asm-arm/pci.h
> @@ -99,6 +99,7 @@ void __iomem *pci_ecam_map_bus(struct pci_host_bridge 
> *bridge,
> struct pci_host_bridge *pci_find_host_bridge(uint16_t segment, uint8_t bus);
> int pci_get_host_bridge_segment(const struct dt_device_node *node,
>                                 uint16_t *segment);
> +struct dt_device_node *pci_find_host_bridge_node(struct device *dev);
> 
> static always_inline bool is_pci_passthrough_enabled(void)
> {
> -- 
> 2.25.1
> 
> 




 


Rackspace

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