xen/pci: Add a function to reset device for xen
authorJiqian Chen <Jiqian.Chen@amd.com>
Tue, 24 Sep 2024 06:14:35 +0000 (14:14 +0800)
committerJuergen Gross <jgross@suse.com>
Wed, 25 Sep 2024 07:54:40 +0000 (09:54 +0200)
commit88801d043b1d16caae76a5e2e5991e8b1f55ce7f
treeebf5a437d235f1c70d05bcb757ef2631f4c0fa7c
parentc3dea3d54f4d399f8044547f0f1abdccbdfb0fee
xen/pci: Add a function to reset device for xen

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>
drivers/xen/pci.c
drivers/xen/xen-pciback/pci_stub.c
include/xen/interface/physdev.h
include/xen/pci.h