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

Re: [RFC XEN PATCH v5 1/5] xen/vpci: Clear all vpci status of device


  • To: Jiqian Chen <Jiqian.Chen@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
  • Date: Fri, 9 Feb 2024 13:02:31 -0500
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • 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=kEBTveNL/p7e41ml1pnFpKoFY8Pak/QF4WgXpYUVY7k=; b=eleNqGrAGim1zv+bxHNA7Zv1XQ5WtktW8AmBlT2wzNowt0v1f5rxw9j5ZilqOTVHHQVgUFg9RgIzInWFevcSnQj8wC1UMDFLOvDKyX+EIesVRsAHTcYzmD9544Lj7IxRZrzzJ1cENGqZkBQ8a7LuaQuiXdyQMiRkms1VDqJAkIV090+U6MA5rLBhlX17oY7GOdGjvmM+E9VkmqAyjjOZEXOhhlIJM1KlbAdsjYzykIJ2tKxSKQ1/D2KWZck2W0ypC5NdDIBYUFf91KSvUIY4w44BH3L4hQNKBGTiVLjMYxV0kPOwbftkXnlI2AmV5qxxIco9UR1EPZWYcnMG5lb+QQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IzMZ1Ca2IYHlvrWIujB0hs9yCQj67lf3gOjhj6Fv7BaLnA0vQ7DNP/pNjk9IsfqpzlF8qFxKAeEkqA0Lt96kOr5auQaT91x2+6E0R2SOxCPk0NumWIAVmjNOlLmjhc8UjdEaNNXvU5D77zG0SLBTj6Tr3dleoreRy7eMRiqqwZUS1xYYhdJo83qm34nHiGil6YrsX6M8wxWrL1YqoggiXFVlkh8eUGdq32MX0Val0N8qy6PUTv3xGZMcGsGLu6ucEc4G/KJnWVKCYzSJv0qWv0EkpXNiTRJlLzs7iXHC1twDBG66v1lCQu7ItMzabXUM/dEs0+mdDB0x2ykFQhUM2A==
  • Cc: Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, "Daniel P . Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>, Huang Rui <Ray.Huang@xxxxxxx>
  • Delivery-date: Fri, 09 Feb 2024 18:02:48 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 1/12/24 01:13, Jiqian Chen wrote:
> When a device has been reset on dom0 side, the vpci on Xen
> side won't get notification, so the cached state in vpci is
> all out of date compare with the real device state.
> To solve that problem, add a new hypercall to clear all vpci
> device state. When the state of device is reset on dom0 side,
> dom0 can call this hypercall to notify vpci.
> 
> Co-developed-by: Huang Rui <ray.huang@xxxxxxx>
> Signed-off-by: Jiqian Chen <Jiqian.Chen@xxxxxxx>

Reviewed-by: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>

If you send another version, the RFC tag may be dropped.

One thing to keep an eye out for below (not requesting any changes).

> ---
> diff --git a/xen/drivers/vpci/vpci.c b/xen/drivers/vpci/vpci.c
> index 72ef277c4f8e..c6df2c6a9561 100644
> --- a/xen/drivers/vpci/vpci.c
> +++ b/xen/drivers/vpci/vpci.c
> @@ -107,6 +107,16 @@ int vpci_add_handlers(struct pci_dev *pdev)
>  
>      return rc;
>  }
> +
> +int vpci_reset_device_state(struct pci_dev *pdev)
> +{
> +    ASSERT(pcidevs_locked());
> +    ASSERT(rw_is_write_locked(&pdev->domain->pci_lock));
> +
> +    vpci_remove_device(pdev);
> +    return vpci_add_handlers(pdev);

Note that these two functions may be renamed soon by the patch at [1].
Whichever patch goes in later will need to be rebased to account for the
rename.

[1] https://lists.xenproject.org/archives/html/xen-devel/2024-02/msg00134.html

> +}
> +
>  #endif /* __XEN__ */
>  
>  static int vpci_register_cmp(const struct vpci_register *r1,




 


Rackspace

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