[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: "Hildebrand, Stewart" <Stewart.Hildebrand@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: "Chen, Jiqian" <Jiqian.Chen@xxxxxxx>
  • Date: Thu, 22 Feb 2024 06:22:37 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.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=/8JDNaLthTdtyHVQWbnOQqPmvGWO/rBfwadANohq0Tg=; b=ViSCMAa2rx8HrKMLD0KYNlkvsEmHr0YTTi3yK8eKP3Gq0n8Zj9AnZDmBJhFnTYIpn0Brf3++qrkQSbNw5u6PUSKhAZoxSyiia6pWfsXbi7hDnBsUe5jr7s1J6woWXhz6pQVxsfw+xnYX/0ONxCPx4vT96FfDI8YAgDzNsPleybW+jUS16k6gHdn4I9ZgvF77Tcamq7BTbNF8X6qVRod7Tt5WOerBtWp0RhaxdYNB7pX76c3hfDypg9bC3Kwf0u3vJ64XNPyNKVVG8XAhz7GCzS2EUPgfgqD7MWA0jx/a75BmylZz2fe9okgaMhX6ZtIm5q0R8la+Chwh4QlBltVLyQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Tva159OzZ62B3CGu9Rt6nCKkJ3JyOo0q7UB0gG9Uw8I5duhFj/ketWaTNjAGJT0tf6FLeDd6Jfax7pVa9KutW6Jrp6783ZbErcI3zbbfKy2opF6ZnTfjt1KTnRVQi/RcWvFwsgZ7Laj0GMKAVuJAvcNHMdAPwQhV/jWdByMFxTFMl8aBZjZKZtNlUmGgwOti65jqyXbljminLFheIgTk1Wd5vsD3x6tlTCrgq4KWGf1Qd/7PJ7eP9lD2pu/lbUQlfzLHnMXhq+N0QBc0G0R5FMJKdReKF1cBxvtPOihE7jvZvgt/T5zo7wjGGLkvw2oN9jTDvSsh/4GljaJOSeLZVA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
  • 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, Ray" <Ray.Huang@xxxxxxx>, "Chen, Jiqian" <Jiqian.Chen@xxxxxxx>
  • Delivery-date: Thu, 22 Feb 2024 06:23:20 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHaRR6lSBH6S20cFEGVGIBPBL8sdbECeg+AgBQujAA=
  • Thread-topic: [RFC XEN PATCH v5 1/5] xen/vpci: Clear all vpci status of device

Hi Stewart,

On 2024/2/10 02:02, Stewart Hildebrand wrote:
> 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>
Thanks, I will add in next version.

> 
> If you send another version, the RFC tag may be dropped.
Does only this one patch, or all patches of this series, need to drop RFC tag?

> 
> One thing to keep an eye out for below (not requesting any changes).
Thanks for reminding me, I will always keep rebasing my code from latest 
staging branch before sending new version.

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

-- 
Best regards,
Jiqian Chen.

 


Rackspace

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