[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: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 12 Sep 2023 11:37:31 +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=vSI3v53eU1/YqOJpOLURXahaxJrjt5HtgzTGd1ZERvI=; b=b9L1vfnrayVbBeziZncslkHkxqNRirVxt7itMBFth/Q894Q8xT/savwVp4prb/yh+ri3hK+Bm9iL+kuFjI8den7AeRRQZ77PmyJ23J0VypmOotgPfZBL8T5zpuZoY7fA4oswbnWZNB2WSfdP6fWQ2oiRQnhPJ5WHv3qNmQ/Sh3xrYgFUv/ryB4Wl2HyAbro1LKJh9xuleh4pWvxhssFXMRc301I7XiwOgyfhpOaOWUuYhW/nQ8zbAiTrmzEAyUJQOMaxMscqX+FcKSxxQOlSrkfqsr67k0OMj8tK+/1LcEVDYa2DmvtRUW8Lzct1P4Rr3jUJ7nnhteNgKHCrRAKVbQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=R6MLdxT3+izsy+6JNxbjyulRBoRW7mJSFycLI9w9FHxR2ZQE74jVkLgSww2jWpwLz5cxr2hX7KXaXT0BV2P2fczAWazlnXOa7W24b9YyTV9QnxVvJswEF/PgSaEZUUyp1HWIjivvbP4nNlOZgPvVbkwL+GSf2Kbk5AMNfSXxoK/xeCPdI3TRANatEkJDaO3W44KHKXCQ8UpQBHhPE5mLkcUeq9OrP8x9SwJwxBXXyIheElEfa826SQNqrpkXxUxTDRESjLslkyAUE21dzh58gTfrst9fomFfz3sMwd+ZlFaWmxSFE1fa+1r/V2hYsyE4CeBEPLmJtgm8JVPuTsan9Q==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • 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: Tue, 12 Sep 2023 09:37:52 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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 ...

> @@ -1506,6 +1520,15 @@ static int assign_device(struct domain *d, u16 seg, u8 
> bus, u8 devfn, u32 flag)
>          rc = iommu_call(hd->platform_ops, assign_device, d, devfn,
>                          pci_to_dev(pdev), flag);
>      }
> +    if ( rc )
> +        goto done;
> +
> +    if ( IS_ENABLED(CONFIG_HAS_VPCI_GUEST_SUPPORT) && d != dom_io)
> +    {
> +        write_lock(&d->pci_lock);
> +        rc = vpci_assign_device(pdev);
> +        write_unlock(&d->pci_lock);
> +    }

... relevant only here?

Jan



 


Rackspace

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