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

Re: [PATCH v8 12/13] xen/arm: translate virtual PCI bus topology for guests


  • To: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 20 Jul 2023 08:54:05 +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:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=e1p7v/xnAfS3GdvV0n3XaCjPonJf4p36L4CnTiaPwEo=; b=G7ysDjnGLk5C0tJCEKdCjmkUCpkahvR9jaxqf3LmNqRyVREh7bVCjHmsqi8Ngc7Rhje9bqnSy1GoXvY0B03VL6KsrloAf2U0IdKmUrdhjc+kfEJfusXazlZH1zzZ3qEoeNJPXvn45/rQ7nvamTHY+OD+B+feNIe0xG24jMY7AnxB4GiGmaPVd+h0o+d7iEiSw4MOn35pTZW38aylfqXtP8AlUcHAV3Rbng594TvqMXJuFKttCBMA7PTl4fXkdsWJtlp0Y1daCpdSWhoLeYCEUQq37pcX6UyhjY0kC3jbJT8+G2Dyb6B6D9b6kxDwww3u5sqJpeYo2NRi23t4fwY72g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DECQIz602xp+9BS2Dqmc143170jNb2qL5KNLvEUQVEAdtgOYWrknTfcyBknbGiZxgmGhI4Eng3mouFumd7Y/q73OE5sOhNXW6tD76AEHr5oTaqhsKnVczOPNEmSOjSLF2K/AkJhbw+h38TACP3X06BZm964JcyWyqowYGvvPliFyf1RvAbEMp2zKS/D7hoDeWMRjAVV/fyCjUhw4HAMcEf6arB+4lTP3HJDERt35dou+cCpKOKllS1IO7M43DoWIyr+2kSjDSlgjz6pY/XJ1Y/7AvyI9nsF7w9PFrwndtgF1GBweKS6gNT55T+Jxo37C7QFvn+ueV5nPlrsPwT8V9w==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 20 Jul 2023 06:54:22 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 20.07.2023 02:32, Volodymyr Babchuk wrote:
> --- a/xen/drivers/vpci/vpci.c
> +++ b/xen/drivers/vpci/vpci.c
> @@ -177,6 +177,30 @@ static int add_virtual_device(struct pci_dev *pdev)
>      return 0;
>  }
>  
> +/*
> + * Find the physical device which is mapped to the virtual device
> + * and translate virtual SBDF to the physical one.
> + * This must hold domain's pci_lock in read mode.

How about an assertion to that effect?

> + */
> +bool vpci_translate_virtual_device(struct domain *d, pci_sbdf_t *sbdf)
> +{
> +    struct pci_dev *pdev;
> +
> +    ASSERT(!is_hardware_domain(d));
> +
> +    for_each_pdev( d, pdev )

Nit: Style (either you consider for_each_pdev a [pseudo-]keyword or you
don't; depending on that there's either a blank missing or there are two
too many).

Jan



 


Rackspace

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