mirror of
https://github.com/torvalds/linux.git
synced 2024-11-22 12:11:40 +00:00
88801d043b
When device on dom0 side has been reset, the vpci on Xen side won't get notification, so that the cached state in vpci is all out of date with the real device state. To solve that problem, add a new function to clear all vpci device state when device is reset on dom0 side. And call that function in pcistub_init_device. Because when using "pci-assignable-add" to assign a passthrough device in Xen, it will reset passthrough device and the vpci state will out of date, and then device will fail to restore bar state. Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com> Signed-off-by: Huang Rui <ray.huang@amd.com> Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org> Message-ID: <20240924061437.2636766-2-Jiqian.Chen@amd.com> Signed-off-by: Juergen Gross <jgross@suse.com>
35 lines
745 B
C
35 lines
745 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
|
|
#ifndef __XEN_PCI_H__
|
|
#define __XEN_PCI_H__
|
|
|
|
#if defined(CONFIG_XEN_DOM0)
|
|
int xen_reset_device(const struct pci_dev *dev);
|
|
int xen_find_device_domain_owner(struct pci_dev *dev);
|
|
int xen_register_device_domain_owner(struct pci_dev *dev, uint16_t domain);
|
|
int xen_unregister_device_domain_owner(struct pci_dev *dev);
|
|
#else
|
|
static inline int xen_reset_device(const struct pci_dev *dev)
|
|
{
|
|
return -1;
|
|
}
|
|
|
|
static inline int xen_find_device_domain_owner(struct pci_dev *dev)
|
|
{
|
|
return -1;
|
|
}
|
|
|
|
static inline int xen_register_device_domain_owner(struct pci_dev *dev,
|
|
uint16_t domain)
|
|
{
|
|
return -1;
|
|
}
|
|
|
|
static inline int xen_unregister_device_domain_owner(struct pci_dev *dev)
|
|
{
|
|
return -1;
|
|
}
|
|
#endif
|
|
|
|
#endif
|