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 <[email protected]>
>> Signed-off-by: Jiqian Chen <[email protected]>
> 
> Reviewed-by: Stewart Hildebrand <[email protected]>
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.

Reply via email to